[BUG] Claude Desktop Code sessions fail to persist on Windows MSIX - EXDEV cross-device link error
Bug Description
Claude Desktop Code sessions fail to persist on Windows due to MSIX filesystem virtualization causing atomic write operations to fail with EXDEV: cross-device link not permitted error.
Environment
- OS: Windows 11 Pro 10.0.26200
- Claude Desktop Version: 1.4758.0.0 (MSIX from Microsoft Store)
- Package Family: Claude_pzs8sxrjxfjjc
- Deployment Mode: 3P (gateway provider)
Root Cause Analysis
MSIX Filesystem Virtualization Conflict
Claude Desktop uses atomic write pattern for session persistence:
- Write session data to
.json.tmpfile - Rename
.json.tmp→.json(atomic operation)
However, Windows MSIX filesystem virtualization redirects:
- Virtual path:
C:\Users\{user}\AppData\Roaming\Claude-3p\ - Physical path:
D:\WpSystem\{user_sid}\...\LocalCache\Roaming\Claude-3p\
When the application calls fs.promises.rename(), Windows treats this as a cross-device operation because the virtual path appears to be on drive C: while the actual storage is on drive D:. This triggers:
Error: EXDEV: cross-device link not permitted, rename '...\session.json.tmp' -> '...\session.json'
Evidence from Logs
2026-04-30 11:38:09 [error] Failed to save session local_e9dec550-f8f4-41a6-8d79-ed3f128db6cd: EXDEV: cross-device link not permitted
2026-04-30 11:38:43 [info] Loaded 0 persisted sessions from C:\Users\55438\AppData\Roaming\Claude-3p\claude-code-sessions\...
Physical directory only contains .tmp files, no .json files:
-rw-r--r-- 1 55438 197609 668 Apr 29 11:46 local_xxx.json.tmp
-rw-r--r-- 1 55438 197609 531 Apr 29 18:51 local_yyy.json.tmp
Impact
- All Claude Code sessions within Claude Desktop are lost after app restart
- Cowork Mode sessions also affected (they use different storage path but same atomic write pattern)
- Users lose work context, conversation history, and project-specific configurations
Suggested Fix
Replace atomic rename pattern with direct write in MSIX environments:
// Current problematic approach:
await fs.writeFile(tmpPath, data);
await fs.rename(tmpPath, finalPath); // Fails with EXDEV on MSIX
// Suggested fix:
await fs.writeFile(finalPath, data); // Direct write works on MSIX
Alternatively, detect MSIX environment and use copy + delete instead of rename:
await fs.copyFile(tmpPath, finalPath);
await fs.unlink(tmpPath);
Related Issues
This is similar to issues reported in other Electron apps running as MSIX packages on Windows. The filesystem virtualization layer does not properly handle rename operations within the virtualized directory.
Workaround
Manual workaround (not practical for regular use):
- Locate physical storage path:
D:\WpSystem\...\Claude-3p\claude-code-sessions\... - Rename all
.json.tmpfiles to.jsonmanually - Restart Claude Desktop
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗