claude-code - 💡(How to fix) Fix [BUG] Claude Desktop MSIX fails to launch — EBADF on renameSync(git-worktrees.json) — on Windows 11 25H2 Build 26200 [1 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#49709Fetched 2026-04-17 08:33:37
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

Error: EBADF: bad file descriptor, rename 'C:\Users<USER>\AppData\Roaming\Claude\git-worktrees.json.tmp-6397517374631e6a' -> 'C:\Users<USER>\AppData\Roaming\Claude\git-worktrees.json' at renameSync (node:fs:1012:11) at s (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar.vite\build\index.js:45:159468) at Object.g [as writeFileSync] (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar.vite\build\index.js:45:166571) at a._write (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar.vite\build\index.js:53:41898) at set store (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar.vite\build\index.js:53:40431) at new F (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar.vite\build\index.js:53:38186) at new a (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar.vite\build\index.js:53:44208) at new pSr (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar.vite\build\index.js:988:5930) at Object.<anonymous> (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar.vite\build\index.js:992:542) at Module._compile (node:internal/modules/cjs/loader:1820:14) at Module._extensions..js (node:internal/modules/cjs/loader:1953:10) at Module.load (node:internal/modules/cjs/loader:1540:32) at Module._load (node:internal/modules/cjs/loader:1342:12) ... { errno: -4083, code: 'EBADF', syscall: 'rename', path: 'C:\Users\<USER>\AppData\Roaming\Claude\git-worktrees.json.tmp-6397517374631e6a', dest: 'C:\Users\<USER>\AppData\Roaming\Claude\git-worktrees.json' } (node:143952) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.

Root Cause

Root cause: The failing call site is electron-store's atomic-write path (write to <target>.tmp-<hash>, then renameSync over target). MSIX transparently redirects %APPDATA%\Claude to the VFS path %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude. On 25H2 Build 26200, the VFS layer invalidates the file handle before the rename syscall completes, so renameSync returns EBADF. This worked on 24H2 — the VFS behavior is a Windows regression, but the write pattern is also fragile and fixable client-side. Impact: Critical severity. The only workaround is the Squirrel build via winget install Anthropic.Claude, but Squirrel does not ship Cowork. Cowork users on Win11 25H2 currently have no working install path. Prior reports (locked by bot, mis-triaged to claude-code repo — this issue is correctly filed against Claude Desktop):

Fix Action

Fix / Workaround

Root cause: The failing call site is electron-store's atomic-write path (write to <target>.tmp-<hash>, then renameSync over target). MSIX transparently redirects %APPDATA%\Claude to the VFS path %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude. On 25H2 Build 26200, the VFS layer invalidates the file handle before the rename syscall completes, so renameSync returns EBADF. This worked on 24H2 — the VFS behavior is a Windows regression, but the write pattern is also fragile and fixable client-side. Impact: Critical severity. The only workaround is the Squirrel build via winget install Anthropic.Claude, but Squirrel does not ship Cowork. Cowork users on Win11 25H2 currently have no working install path. Prior reports (locked by bot, mis-triaged to claude-code repo — this issue is correctly filed against Claude Desktop):

Attempted workarounds that did NOT resolve the issue:

Only working workaround: Install the Squirrel build via winget install Anthropic.Claude — but this build does not include Cowork, so it is not a viable solution for users who need Cowork.

Code Example

Error: EBADF: bad file descriptor, rename 'C:\Users\<USER>\AppData\Roaming\Claude\git-worktrees.json.tmp-6397517374631e6a' -> 'C:\Users\<USER>\AppData\Roaming\Claude\git-worktrees.json'
    at renameSync (node:fs:1012:11)
    at s (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:45:159468)
    at Object.g [as writeFileSync] (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:45:166571)
    at a._write (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:53:41898)
    at set store (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:53:40431)
    at new F (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:53:38186)
    at new a (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:53:44208)
    at new pSr (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:988:5930)
    at Object.<anonymous> (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:992:542)
    at Module._compile (node:internal/modules/cjs/loader:1820:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1953:10)
    at Module.load (node:internal/modules/cjs/loader:1540:32)
    at Module._load (node:internal/modules/cjs/loader:1342:12)
    ...
{
  errno: -4083,
  code: 'EBADF',
  syscall: 'rename',
  path: 'C:\\Users\\<USER>\\AppData\\Roaming\\Claude\\git-worktrees.json.tmp-6397517374631e6a',
  dest: 'C:\\Users\\<USER>\\AppData\\Roaming\\Claude\\git-worktrees.json'
}
(node:143952) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
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?

Claude Desktop (MSIX build, version 1.3109.0.0) fails to launch on Windows 11 25H2 Build 26200.8037. The app crashes before any window is created, with a "Claude Desktop failed to launch" dialog. The crash occurs on every launch attempt — 100% reproduction rate, no user action required between install and crash. Environment:

OS: Windows 11 Pro 25H2, Build 26200.8037 Claude Desktop: 1.3109.0.0 (MSIX, installed via Microsoft Store) Package path: C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc
Regression: Works on Windows 11 24H2. Breaks deterministically on 25H2 Build 26200.

Root cause: The failing call site is electron-store's atomic-write path (write to <target>.tmp-<hash>, then renameSync over target). MSIX transparently redirects %APPDATA%\Claude to the VFS path %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude. On 25H2 Build 26200, the VFS layer invalidates the file handle before the rename syscall completes, so renameSync returns EBADF. This worked on 24H2 — the VFS behavior is a Windows regression, but the write pattern is also fragile and fixable client-side. Impact: Critical severity. The only workaround is the Squirrel build via winget install Anthropic.Claude, but Squirrel does not ship Cowork. Cowork users on Win11 25H2 currently have no working install path. Prior reports (locked by bot, mis-triaged to claude-code repo — this issue is correctly filed against Claude Desktop):

anthropics/claude-code#33055 (same bug, version 1.1.6041) anthropics/claude-code#40311 (same bug, version 1.1.9310)

Suggested fixes (any one unblocks affected users without waiting on Microsoft):

Write persistent state to %LOCALAPPDATA%\Claude\ directly — not intercepted by MSIX VFS, atomic rename works normally. Cleanest option. Catch EBADF on rename and fall back to writeFileSync + fsync. Smallest diff. Switch to an atomic-write library that doesn't rely on cross-boundary rename (e.g., lockfile-based).

What Should Happen?

Claude Desktop MSIX should launch successfully on Windows 11 25H2 Build 26200, just as it does on 24H2. The app should be able to read and write its config files (git-worktrees.json and others) without crashing, regardless of whether writes are redirected through the MSIX VFS layer.

Error Messages/Logs

Error: EBADF: bad file descriptor, rename 'C:\Users\<USER>\AppData\Roaming\Claude\git-worktrees.json.tmp-6397517374631e6a' -> 'C:\Users\<USER>\AppData\Roaming\Claude\git-worktrees.json'
    at renameSync (node:fs:1012:11)
    at s (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:45:159468)
    at Object.g [as writeFileSync] (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:45:166571)
    at a._write (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:53:41898)
    at set store (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:53:40431)
    at new F (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:53:38186)
    at new a (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:53:44208)
    at new pSr (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:988:5930)
    at Object.<anonymous> (C:\Program Files\WindowsApps\Claude_1.3109.0.0_x64__pzs8sxrjxfjjc\app\resources\app.asar\.vite\build\index.js:992:542)
    at Module._compile (node:internal/modules/cjs/loader:1820:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1953:10)
    at Module.load (node:internal/modules/cjs/loader:1540:32)
    at Module._load (node:internal/modules/cjs/loader:1342:12)
    ...
{
  errno: -4083,
  code: 'EBADF',
  syscall: 'rename',
  path: 'C:\\Users\\<USER>\\AppData\\Roaming\\Claude\\git-worktrees.json.tmp-6397517374631e6a',
  dest: 'C:\\Users\\<USER>\\AppData\\Roaming\\Claude\\git-worktrees.json'
}
(node:143952) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Steps to Reproduce

  1. On Windows 11 25H2 Build 26200 (confirmed on 26200.8037), install Claude Desktop MSIX from the Microsoft Store or claude.ai/download.
  2. Launch Claude Desktop via any method — Start menu, shell:AppsFolder, or running claude.exe directly from the package path.
  3. The app crashes immediately with "Claude Desktop failed to launch". No window is ever rendered.
  4. Check logs — the EBADF rename error on git-worktrees.json is present on every launch attempt.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

1.3109.0.0

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Attempted workarounds that did NOT resolve the issue:

Complete uninstall + reinstall Pre-creating git-worktrees.json as an empty file in both the real %APPDATA%\Claude\ path and the MSIX VFS path Deleting stale .tmp-* sidecar files before launch Re-registering the MSIX package via Add-AppxPackage

Only working workaround: Install the Squirrel build via winget install Anthropic.Claude — but this build does not include Cowork, so it is not a viable solution for users who need Cowork.

extent analysis

TL;DR

The most likely fix is to write persistent state to %LOCALAPPDATA%\Claude\ directly, bypassing the MSIX VFS layer, or catch the EBADF error on rename and fall back to writeFileSync + fsync.

Guidance

  1. Verify the issue: Confirm that the crash occurs due to the EBADF error on rename by checking the error logs for the specific error message.
  2. Apply a workaround: Consider using the Squirrel build via winget install Anthropic.Claude as a temporary workaround, although this does not include Cowork.
  3. Code changes: Update the code to write to %LOCALAPPDATA%\Claude\ directly or implement a fallback for EBADF errors, such as using writeFileSync + fsync.
  4. Test on different environments: Verify the fix on Windows 11 25H2 Build 26200 and other relevant environments to ensure the solution is robust.

Example

// Example of writing to %LOCALAPPDATA%\Claude\ directly
const path = require('path');
const fs = require('fs');
const userDataPath = path.join(process.env.LOCALAPPDATA, 'Claude');
fs.writeFileSync(path.join(userDataPath, 'git-worktrees.json'), 'content');

Notes

The provided solutions are based on the information given in the issue and might require adjustments based on the actual implementation details of Claude Desktop.

Recommendation

Apply a workaround by writing persistent state to %LOCALAPPDATA%\Claude\ directly, as this seems to be the cleanest option that unblocks affected users without waiting on Microsoft to address the VFS layer issue.

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] Claude Desktop MSIX fails to launch — EBADF on renameSync(git-worktrees.json) — on Windows 11 25H2 Build 26200 [1 comments, 2 participants]