EBUSY: concurrent instances race on .claude.json (Windows)
Resolved 💬 3 comments Opened Apr 11, 2026 by jeffyaw Closed Apr 14, 2026
Summary
Running multiple Claude Code instances simultaneously on Windows causes EBUSY: resource busy or locked errors when writing to ~/.claude.json. The file is 72KB and written with writeFileSync without file locking, so concurrent instances race on it.
Reproduction
- Open two Claude Code sessions (e.g., terminal + desktop app, or two terminals)
- Use both actively
- One will eventually hit:
ERROR EBUSY: resource busy or locked, open 'C:\Users\<user>\.claude.json'
at writeFileSync (unknown)
VZ8 (B:/~BUN/root/src/entrypoints/cli.js:135:1271)
NcK (B:/~BUN/root/src/entrypoints/cli.js:442:23227)
p6 (B:/~BUN/root/src/entrypoints/cli.js:442:21289)
<anonymous> (B:/~BUN/root/src/entrypoints/cli.js:8305:475)
Au (B:/~BUN/root/src/entrypoints/cli.js:492:63164)
zm8 (B:/~BUN/root/src/entrypoints/cli.js:492:76228)
dR (B:/~BUN/root/src/entrypoints/cli.js:492:76109)
zm8 (B:/~BUN/root/src/entrypoints/cli.js:492:77018)
dR (B:/~BUN/root/src/entrypoints/cli.js:492:76109)
Root cause
Windows file locks are mandatory (unlike Unix advisory locks), so writeFileSync from one process blocks/fails when another process has the file open. A write-to-temp-then-rename pattern or proper file locking would fix this.
Environment
- Windows 11 Pro 10.0.26200
- Claude Code (latest as of 2026-04-10)
---
Filed by Jeff Yaw, Yaw Labs (jeff@yaw.sh)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗