[FEATURE] CLAUDE_DATA_DIR env var or config key to relocate %APPDATA%\Claude\ on Windows
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
On Windows, the Claude Code desktop app (Store/MSIX package) stores all user data in %APPDATA%\Claude\. There is no setting, env var, or CLI flag to relocate this to another drive.
The app is installed with the unvirtualizedResources capability, so data writes to real %APPDATA% — not a Store VFS sandbox. This means reinstalling to another drive only moves the 518 MB Electron binary; the 15+ GB of user data stays on C: regardless.
Measured sizes on an active install:
| Path | Size | Growth |
|---|---|---|
| vm_bundles\rootfs.vhdx | 10 GB | ~1 GB per active session day |
| vm_bundles\rootfs.vhdx.zst | 2.2 GB | Static |
| vm_bundles\sessiondata.vhdx | 1.3 GB | Grows with sessions |
| local-agent-mode-sessions\ | 472 MB | Grows with sessions |
| %APPDATA%\Claude\ total | ~15.4 GB | Growing |
rootfs.vhdx is a dynamically-expanding VHDX. On an active development machine it can fill a typical system SSD within weeks.
Proposed Solution
A CLAUDE_DATA_DIR environment variable (or equivalent config key in claude_desktop_config.json) that relocates the entire user data directory:
// claude_desktop_config.json
{
"dataDir": "D:\\ClaudeData\\Claude"
}
or via environment variable:
CLAUDE_DATA_DIR=D:\ClaudeData\Claude
All subdirectories (vm_bundles\, local-agent-mode-sessions\, claude-code\, etc.) resolve relative to this root. On first launch with the new setting, Claude Code should either migrate data automatically or print clear instructions to move the directory manually.
Alternative Solutions
Exhaustively checked — none work:
CLAUDE_*env vars — none control data location%APPDATA%\Claude\config.json— UI preferences only (scale, theme, window position)claude_desktop_config.json— behaviour preferences only~/.claude/settings.json— hooks and permissions only- App manifest — no
userDatapath override declared Move-AppxPackageto D: — only moves the 518 MB Electron binary, data stays on C:- Registry keys (like Outlook's
ForceOSTPath) — none exist for Claude Code
Current workaround: NTFS directory junction (C:\Users\...\AppData\Roaming\Claude → D:\ClaudeData\Claude). Works but is unsupported, fragile across Windows Updates, and inaccessible to non-technical users.
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
Scenario: Active developer on a 512 GB system SSD (Alienware M15 / similar), running Claude Code daily for geospatial AI development.
- Fresh install:
%APPDATA%\Claude\= ~13 GB - After two weeks of active use:
rootfs.vhdxgrows ~1 GB per session day as the Linux VM accumulates pip/npm packages - With a secondary 521 GB SSD sitting 80% empty, there is no way to redirect this growth without an unsupported NTFS junction hack
- With
CLAUDE_DATA_DIR=D:\ClaudeData\Claudein config: all VM data, sessions, and cache land on the secondary SSD automatically — C: stays healthy indefinitely
Additional Context
Prior art for this pattern:
- VS Code:
--user-data-dirCLI flag +code-portable-data/support - Chromium:
--user-data-dirflag - XDG Base Directory spec:
XDG_DATA_HOME/XDG_CONFIG_HOME - Microsoft Outlook:
ForceOSTPathregistry value (REG_EXPAND_SZ) — exact analogue
Related issues:
- #25762 — env var for
~/.claude/config dir (same theme, different path)
Platform: Windows 11, Claude Code desktop (Store/MSIX) v1.6608.2.0, Alienware M15, 410 GB C: SSD
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗