You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EBUSY: resource busy or locked on .claude.json with multiple concurrent instances (Windows) #25699
When running multiple Claude Code CLI instances and/or Claude Desktop simultaneously on Windows, writeFileSync to ~/.claude.json intermittently fails with:
ERROR EBUSY: resource busy or locked, open 'C:\Users\apami\.claude.json'
at writeFileSync (unknown)
Iq (B:/~BUN/root/claude.exe:6171:1226)
rHf (B:/~BUN/root/claude.exe:6171:4208)
BA (B:/~BUN/root/claude.exe:6171:2887)
<anonymous> (B:/~BUN/root/claude.exe:3797:23173)
cA (B:/~BUN/root/claude.exe:679:62572)
w1 (B:/~BUN/root/claude.exe:679:75521)
ED (B:/~BUN/root/claude.exe:679:75405)
w1 (B:/~BUN/root/claude.exe:679:76304)
ED (B:/~BUN/root/claude.exe:679:75405)
Environment
OS: Windows 11 Pro 10.0.26200
Claude Code version: Latest (native install via .local/bin/claude.exe)
Multiple Claude processes write to the shared ~/.claude.json file (19KB, contains telemetry counters, session stats, feature flags, project configs). On Windows, file writes acquire mandatory locks (unlike Unix advisory locks). When two processes call writeFileSync() at the same instant, one gets EBUSY.
Windows Defender real-time protection makes this worse — it briefly locks the file for scanning after each write, extending the contention window.
Suggested Fix
Replace the bare writeFileSync() with one of:
Atomic write: Write to ~/.claude.json.tmp, then fs.renameSync() to ~/.claude.json — rename is atomic on both Windows (NTFS) and Unix
Retry with backoff: Wrap writeFileSync in a retry loop (e.g., 3 attempts, 50-200ms exponential backoff) to handle transient locks
Both: Atomic write + retry on the rename for belt-and-suspenders
Workaround
Adding a Windows Defender exclusion for ~/.claude.json and claude.exe reduces the lock window and makes collisions less frequent, but doesn't fully eliminate the race.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
github-actions commentedon Feb 14, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
github-actions commentedon Feb 17, 2026
This issue has been automatically closed as a duplicate of #20168.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
github-actions commentedon Feb 24, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.