[BUG] Windows MSIX: sessions lost on restart — EXDEV rename failure + AppX filesystem virtualization

Resolved 💬 3 comments Opened Apr 2, 2026 by bkim346 Closed Apr 5, 2026

Preflight Checklist

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

What's Wrong?

Bug

On Windows, Claude Desktop (MSIX install) loses all sidebar sessions on every restart.

Root Cause

Two compounding issues:

  1. EXDEV rename failure: The app writes session metadata as .json.tmp (via system temp dir on C:), then calls fs.rename() to the final .json path. When TEMP and APPDATA are on different volumes, rename() fails with EXDEV: cross-device link not permitted. Sessions work in-memory but .json files are never written, so they vanish on restart.
  1. MSIX filesystem virtualization: On MSIX/AppX installs, %APPDATA%\Claude is virtualized — only the app process can see it at that path. The real data lives at %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\. External scripts (cmd, PowerShell, Python) cannot access the virtualized path, making manual workarounds difficult to discover.

Log Evidence

[error] Failed to save session local_8c7405a5-...: EXDEV: cross-device link not permitted,
rename '...\local_8c7405a5-....json.tmp' -> '...\local_8c7405a5-....json'

What Should Happen?

Environment

  • Windows 11 Education
  • Claude Desktop installed via Microsoft Store (MSIX)
  • TEMP on C: drive, AppData on D: drive (different volumes)

Suggested Fix

Use fs.copyFile + fs.unlink as fallback when fs.rename() throws EXDEV. This is a standard Node.js pattern (fs-extra.move() handles it automatically).

Workaround

import os, shutil
session_base = os.path.join(
    os.environ["LOCALAPPDATA"],
    "Packages", "Claude_pzs8sxrjxfjjc",
    "LocalCache", "Roaming", "Claude", "claude-code-sessions"
)
for root, dirs, files in os.walk(session_base):
    for f in files:
        if f.endswith(".json.tmp"):
            src = os.path.join(root, f)
            shutil.copy2(src, src[:-4])


### Error Messages/Logs

```shell

Steps to Reproduce

  1. Install Claude Desktop from Microsoft Store (MSIX package) on Windows
  2. Have TEMP directory on a different drive than APPDATA (e.g., TEMP on C:, AppData on D:)
  3. Open Claude Desktop and create a few sessions
  4. Close and reopen Claude Desktop
  5. All previous sessions are gone from the sidebar
  6. Check logs at %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\logs\main.log for EXDEV errors

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.87

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗