claude-code - 💡(How to fix) Fix [BUG] Desktop app Code sessions fail to finalize — .tmp files persist, never rename to .json (Windows MSIX)

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…

Error Message

Error Messages/Logs

Root Cause

Summary On Windows, Claude Desktop Code sessions write to local_<UUID>.json.tmp but the atomic rename to local_<UUID>.json never succeeds. Sessions work fully during use (prompt → response → sidebar entry), but nothing persists. The sidebar is permanently empty across app restarts because no finalized session file is ever produced. Orphan .tmp files accumulate. Environment

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?

Summary On Windows, Claude Desktop Code sessions write to local_<UUID>.json.tmp but the atomic rename to local_<UUID>.json never succeeds. Sessions work fully during use (prompt → response → sidebar entry), but nothing persists. The sidebar is permanently empty across app restarts because no finalized session file is ever produced. Orphan .tmp files accumulate. Environment

OS: Windows 11, personal machine (not corporate-managed) Claude Desktop: MSIX install from claude.ai/download (fresh install, preceded by full uninstall of prior Microsoft Store build) Claude Code CLI: 2.1.114, native install at C:\Users<user>.local\bin\claude.exe Git: 2.42.0.windows.1 Session storage path: C:\Users<user>\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude-code-sessions<accountId><orgId>\

Ruled out

EFS encryption (folder decrypted, .tmp files still not renamed) Windows Defender Controlled Folder Access (confirmed off) Corporate endpoint security / EDR (personal machine) OneDrive interference (AppData is not OneDrive-synced) Missing Git (installed and on PATH) File permissions (writes succeed; only rename fails) Stale Store install (clean uninstall + fresh MSIX from claude.ai/download) Unclean app exit (reproduces with clean File → Quit)

Additional context A second machine (Surface Pro) with nominally similar setup — same account, OneDrive-synced project folders, same Claude Desktop install method — produces proper local_<UUID>.json files and populates the sidebar normally. This points to a machine-specific condition on the affected machine that interferes with the .tmp → .json rename step specifically, but I've been unable to identify what it is through folder/file attribute inspection

What Should Happen?

Expected A local_<UUID>.json file exists after close; session reappears in sidebar on next launch. Actual Only local_<UUID>.json.tmp exists. Session does not appear in sidebar on relaunch. Repeated sessions produce additional orphan .tmp files. Diagnostic evidence Confirmed with Get-ChildItem ... -Recurse -Force:

.tmp files are created successfully (writes work) .tmp files have only Archive attribute — no Encrypted, no ReadOnly, no unusual flags Folder attribute is U (unencrypted) per cipher after running cipher /d New .tmp files are written as unencrypted, confirming EFS is not the cause

Error Messages/Logs

Steps to Reproduce

Steps to reproduce

Launch Claude Desktop, open Code tab Start new local session against any folder (with or without Git repo) Send a prompt, receive a response Session name appears in sidebar, no errors shown Quit the app cleanly (File → Quit, not force-close) Inspect session storage folder

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

Latest

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

No response

extent analysis

TL;DR

The issue can be resolved by investigating and addressing the machine-specific condition that interferes with the rename operation of temporary session files to their final names.

Guidance

  • Investigate potential file system or security software interference on the affected machine that could be blocking the rename operation, focusing on differences between the affected machine and the one where the issue does not occur.
  • Verify file system permissions and attributes on the session storage path to ensure there are no restrictions that could prevent the rename operation.
  • Consider temporarily disabling any security or file system monitoring software on the affected machine to see if it resolves the issue.
  • Review system event logs for any errors related to file operations or security software that might indicate the cause of the rename failure.

Example

No specific code example is applicable in this case, as the issue appears to be related to system configuration or file system interactions rather than code-level logic.

Notes

The fact that the issue is machine-specific and does not occur on another machine with a similar setup suggests that the problem is likely related to the environment or configuration of the affected machine rather than the Claude Code application itself.

Recommendation

Apply a workaround by manually monitoring and potentially renaming the .tmp files to .json if the application does not do so automatically, while continuing to investigate the root cause of the rename failure. This approach can help mitigate the issue temporarily but does not address the underlying problem.

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 [BUG] Desktop app Code sessions fail to finalize — .tmp files persist, never rename to .json (Windows MSIX)