[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
16 Comments
important feature, needed urgently
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Thanks for the triage. I reviewed all three flagged issues and this is distinct from each:
#56089 targets
%LocalAppData%\...\claudevm.bundle\(the Cowork VM path). This issue is about%AppData%\Claude\— the desktop app Electron data directory — a different path containing not just the VM bundle but alsolocal-agent-mode-sessions\, caches, and all persistent app state (~15 GB total, growing ~1 GB/session).#31284 requests a configurable home directory path for Linux/macOS. This is Windows-specific, concerning the MSIX Store app's
%AppData%directory which cannot be relocated by any native mechanism (verified exhaustively: no CLI flag, env var, registry key, or config file controls this path).#25762 requests an env var for the CLI's
~/.claude/config dir. This issue is about the desktop app's%AppData%\Claude\(the Electron userdata folder) — a separate 15 GB data store unaffected by any~/.claude/relocation.The common thread is "Claude writes to a hardcoded path I can't move" but the affected paths, mechanisms, and solutions differ per platform and app mode. Keeping open for the Windows desktop app
%AppData%\Claude\case specifically.+1. Windows 10, 107 GB C: drive at 90% full.
%AppData%\Claude\is 12.6 GB, withvm_bundles\claudevm.bundle\alone at 12.3 GB (9 GB liverootfs.vhdx+ 2.2 GBrootfs.vhdx.zsttemplate, plus initrd/vmlinuz pairs). On smaller system drives this is unworkable.Confirmed via prior investigation (and consistent with #42119) that NTFS junctions and directory symlinks fail — Node's
fs.rename()in the bundle extraction resolves real paths before calling the OS, bypassing reparse points. No native Windows mechanism can relocate this path.Even just relocating
vm_bundles\(via aCLAUDE_DATA_DIRenv var or a field in%AppData%\Claude\config.jsonread at launch) would solve ~80% of the disk pressure for Windows users on small system drives.I also need an urgent solution for this. C drive is limited and been able to mode this data to my D (data) drive is a must!
+1, this issue block me, 150GB of C: in working laptop
same situation here; c: is small and will stay small.
I have a similar issue. Installed less than a week ago, today C: drive already has 11GB less space available than immediately after install, now at 19% free and counting down, whilst second drive is sitting at 77% free, and the ideal place for Claude to live.
Editing to add detail:
My setup is three SSDs: C: for OS only, Z: for software, X: for storage, with Windows' "new apps save to" set to Z:.
On that configuration, Cowork's workspace failed to provision entirely with a repeating EXDEV: cross-device link not permitted error on the rootfs.vhdx rename, even though both the source temp folder and the destination were in the same directory under C:\Users\<me>\AppData\Roaming\Claude\vm_bundles\. The log showed the app binary was running from Z:\WindowsApps\Claude_...\app.asar while its data lived on C:, so the MSIX sandbox treated a same-folder rename as crossing a device boundary.
The only thing that fixed it (and gave me a workable Cowork) was forcing the app itself back onto C: by setting default install drive to C:, uninstalling, reinstalling. Per the original post, that moves only the Electron binary, as the bulky vm_bundles data was always going to stay on C: regardless, so I've now got a dynamically-expanding VHDX pinned to my OS drive, which is exactly what I built a three-drive layout to avoid.
A CLAUDE_DATA_DIR / config key to relocate the whole user-data directory would have solved both of my problems in one go (the EXDEV failure on multi-drive setups, and the long-term growth of rootfs.vhdx on the system SSD).
So very strong +1 as the former issue I have solved, but the later still remains until this feature request is implemented.
+1 on having an ENV VAR that can switch out the vm bundles to SSD and not cause older MS Laptops to not work.
Adding another use case for this: I'd like Claude Desktop's data (vm_bundles, sessions, etc.) off C: for two reasons:
A CLAUDE_DATA_DIR config option (or similar) as proposed here would solve both. Junctions are too fragile as a workaround since they can break on updates.
+1, this is a genuinely baffling choice that is even more baffling it wasn't caught internally. Lean C for OS critical stuff is a very common setup, and not letting users specifically control where files and data live is just irresponsible application development. Makes the application completely unusable for me and most of my team.
Adding a working data point from Windows, in case it helps scope this.
CLI is already solved.
CLAUDE_CONFIG_DIRrelocates the entire~/.claudetree including credentials, so two accounts coexist cleanly today — separate settings, skills, plugins, sessions and logins. It just isn't documented as the multi-account mechanism, so people don't find it.Desktop has no equivalent, and on MSIX builds the data path is undocumented. On Claude desktop
1.40609.0(Store/MSIX install), user data lives at:%APPDATA%\Claude— the path most third-party guides cite — does not exist on these builds, which sends people down the wrong path when debugging MCP config.The finding that might matter: a directory junction placed at that location, pointing out of the package container to a normal folder, is followed correctly by the app. Profile switching works today by swapping that link:
Verified with a full round trip: switch to profile B, sign in, close, switch back to A, and A's session and history are intact. Keeping profile data outside the container means a package reset destroys the link rather than the data.
That suggests the app doesn't hard-depend on its data being inside the sandbox, so a
CLAUDE_DATA_DIRenv var — or a native profile picker — looks feasible without deeper changes.One rough edge worth separating out: plugin caches are per-profile, but
enabledPluginsandextraKnownMarketplaceslive insettings.json. Copying asettings.jsonbetween profiles makes the new profile auto-install plugins it has no cache for, and plugins with hooks then fail in ways that block prompts.Script and full write-up: https://github.com/Thoe657/claude-multiple-profiles
I have Claude Desktop on my PC and notice it keeps getting bigger—it’s already taking up 10 GB, including the data cache. That doesn't bother me; what is essential for me is that the data cache be located at:
%APPDATA%\Local\Packages\Claude_pzs8sxrjxfjjc
If I have problems with Windows and need to format and reinstall it, I will lose all my Claude data—chats, artifacts, files, and documents.
To address this, I would like you to add an option to change the cache location—for example, to a separate SSD where I store all my open-weight models and other AI-related data—to keep my data safe.
Example:
%APPDATA%\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache --> D:\Claude\LocalCache
I have a 8 TB NVMe SSD to handle all the model and Claude cache data with practically no limits.
Hi,
I also need this, for portability. The usual fix of using a junction to point at another folder does not wrok with claude unfortunately, for reasons outlined in #91409
+1, but I just wanted to add another reason why this fix is needed beyond just running out of C: drive space (though that affects me, too).
My workstation is intentionally split up across different drives for performance. Windows is on a standard SSD, but I offload high-throughput, file-intensive tasks like virtual machines and scratch workspaces to a dedicated, ultra-fast secondary NVMe drive.
Because
rootfs.vhdxis a live, active virtual disk, forcing it onto the system drive creates unnecessary bottlenecking and completely bypasses the faster storage available on the secondary drive.Since Windows HCS blocks mounting VHDX files through
mklinkdirectory junctions, there is no clean way to work around this without breaking the app or risking system stability by moving the entire%USERPROFILE%.A native configuration key in
claude_desktop_config.jsonto change the path would completely solve this for multi-drive setups like mine. It's not too different of a use case, but I figured I'd share since I can't imagine I'm the only one doing it this way.Hit this a lot on Windows: the Store/MSIX install can sit elsewhere, but
%APPDATA%\Claude\(esp.vm_bundles\rootfs.vhdx+ session VHDX) still grows on C: with no supported relocate — junction is the usual workaround.Useful split while waiting on
CLAUDE_DATA_DIR/ config relocate:rootfs.vhdx/sessiondata.vhdxif Claude is running; anything you still need fromlocal-agent-mode-sessions\.I maintain void (local disk reclaim for build artifacts + AI agent data/worktrees/models; Safe/Caution/Danger; nothing deleted without confirmation; Guard for free-space warnings). It can surface agent junk and model caches; it does not relocate Claude’s
%APPDATA%\Clauderoot — that still needs Anthropic’s env/config (or a junction). Happy to dig into which paths on your machine look Safe vs Danger if useful.