claude-code - 💡(How to fix) Fix Claude Desktop (MSIX/Windows Store build) fails to persist session metadata with EXDEV error — sidebar empty on every restart [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52872Fetched 2026-04-25 06:18:37
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2

On Windows with the MSIX-packaged Claude Desktop, the Code feature's left-side conversation sidebar is empty on every app restart. Root cause: fs.rename fails with EXDEV: cross-device link not permitted when persisting session metadata, so nothing is ever saved to claude-code-sessions\<id>\<account>\.

Error Message

Error Messages/Logs

[error] Failed to save session local_076d5b59-b251-415e-bb76-9c219b2ee8b3:

Root Cause

On Windows with the MSIX-packaged Claude Desktop, the Code feature's left-side conversation sidebar is empty on every app restart. Root cause: fs.rename fails with EXDEV: cross-device link not permitted when persisting session metadata, so nothing is ever saved to claude-code-sessions\<id>\<account>\.

Fix Action

Fix / Workaround

Workaround I'm using

Code Example

## Log evidence (`%APPDATA%\Claude\logs\main.log`)

Repeatedly throughout the log (hundreds of occurrences):

\`\`\`
[error] Failed to save session local_076d5b59-b251-415e-bb76-9c219b2ee8b3: 
EXDEV: cross-device link not permitted, 
rename 'C:\Users\86182\AppData\Roaming\Claude\claude-code-sessions\418561af-c0f6-411e-a70c-43f08eb0d9a8\057243bc-100f-4fb1-a3ea-4c95406dbb58\local_076d5b59-b251-415e-bb76-9c219b2ee8b3.json.tmp' 
-> '....json'
    at async Object.rename (node:internal/fs/promises:782:10)
    at async EC.writeSessionToDisk (E:\WindowsApps\Claude_1.3883.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:1391:7012)
\`\`\`

## Confirmed impact

- `claude-code-sessions\<id>\<account>\` is **empty** (no `.json` files ever persisted)
- `git-worktrees.json` tracks all 12 historical worktrees correctly — not the issue
- Conversation content JSONLs at `%USERPROFILE%\.claude\projects\<namespace>\*.jsonl` **are** saved (different code path, uses a different storage mechanism) — so only the sidebar index is broken, actual content is preserved

## Likely root cause

MSIX file-system virtualization causes the `.json.tmp` and target `.json` to resolve to different physical volumes after virtualization redirect, even though both logical paths are under `%APPDATA%\Claude\`. `fs.rename` can't perform atomic cross-volume rename → EXDEV.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Environment

  • OS: Windows 11 Home (China edition), build 10.0.26200
  • Claude Desktop version: 1.3883.0.0
  • Install type: MSIX package at E:\WindowsApps\Claude_1.3883.0.0_x64__pzs8sxrjxfjjc\
  • Installation source: Official download

Summary

On Windows with the MSIX-packaged Claude Desktop, the Code feature's left-side conversation sidebar is empty on every app restart. Root cause: fs.rename fails with EXDEV: cross-device link not permitted when persisting session metadata, so nothing is ever saved to claude-code-sessions\<id>\<account>\.

Workaround I'm using

None effective from Desktop UI. Reading conversation content directly from the JSONL files as read-only history; no way to resume sessions within Desktop itself.

Happy to provide additional logs or test any fix.

What Should Happen?

Suggested fix

Fall back to fs.copyFile + fs.unlink when fs.rename fails with EXDEV. Standard pattern for Node.js atomic writes on systems with virtualized/redirected filesystems. Example:

```javascript try { await fs.rename(tmp, dest); } catch (err) { if (err.code === 'EXDEV') { await fs.copyFile(tmp, dest); await fs.unlink(tmp); } else { throw err; } } ```

Error Messages/Logs

## Log evidence (`%APPDATA%\Claude\logs\main.log`)

Repeatedly throughout the log (hundreds of occurrences):

\`\`\`
[error] Failed to save session local_076d5b59-b251-415e-bb76-9c219b2ee8b3: 
EXDEV: cross-device link not permitted, 
rename 'C:\Users\86182\AppData\Roaming\Claude\claude-code-sessions\418561af-c0f6-411e-a70c-43f08eb0d9a8\057243bc-100f-4fb1-a3ea-4c95406dbb58\local_076d5b59-b251-415e-bb76-9c219b2ee8b3.json.tmp' 
-> '....json'
    at async Object.rename (node:internal/fs/promises:782:10)
    at async EC.writeSessionToDisk (E:\WindowsApps\Claude_1.3883.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:1391:7012)
\`\`\`

## Confirmed impact

- `claude-code-sessions\<id>\<account>\` is **empty** (no `.json` files ever persisted)
- `git-worktrees.json` tracks all 12 historical worktrees correctly — not the issue
- Conversation content JSONLs at `%USERPROFILE%\.claude\projects\<namespace>\*.jsonl` **are** saved (different code path, uses a different storage mechanism) — so only the sidebar index is broken, actual content is preserved

## Likely root cause

MSIX file-system virtualization causes the `.json.tmp` and target `.json` to resolve to different physical volumes after virtualization redirect, even though both logical paths are under `%APPDATA%\Claude\`. `fs.rename` can't perform atomic cross-volume rename → EXDEV.

Steps to Reproduce

  1. Open Claude Desktop, go to Code
  2. Start a conversation, send a few messages
  3. Close the app
  4. Reopen the app
  5. Observe: conversation sidebar on the left is empty. Previously-used worktrees still appear in the worktree list (correctly loaded from git-worktrees.json), but clicking into any of them shows an empty conversation history.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

1.3883.0.0

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

No response

extent analysis

TL;DR

Fall back to fs.copyFile + fs.unlink when fs.rename fails with EXDEV to fix the issue with persisting session metadata.

Guidance

  • The error EXDEV: cross-device link not permitted occurs when fs.rename tries to rename a file across different physical volumes, which is not allowed.
  • To fix this, use fs.copyFile to copy the temporary file to the destination and then fs.unlink to remove the temporary file, as suggested in the issue.
  • This approach is a standard pattern for atomic writes on systems with virtualized or redirected filesystems.
  • Verify that the conversation sidebar is populated correctly after implementing this fix by restarting the app and checking the sidebar.

Example

try {
  await fs.rename(tmp, dest);
} catch (err) {
  if (err.code === 'EXDEV') {
    await fs.copyFile(tmp, dest);
    await fs.unlink(tmp);
  } else {
    throw err;
  }
}

Notes

This fix assumes that the issue is indeed caused by the fs.rename failure due to cross-device linking. If the issue persists after implementing this fix, further investigation may be necessary.

Recommendation

Apply the suggested workaround of falling back to fs.copyFile + fs.unlink when fs.rename fails with EXDEV, as it is a standard pattern for handling this issue on systems with virtualized or redirected filesystems.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Claude Desktop (MSIX/Windows Store build) fails to persist session metadata with EXDEV error — sidebar empty on every restart [2 comments, 2 participants]