[Bug] Multiple Claude Code instances freeze on macOS due to file locking conflict
Bug Description
Title: [BUG] Multiple Claude Code instances in same VS Code project freeze/block each other on macOS (v2.0.59-2.0.60)
Environment:
- Platform: macOS
- Claude CLI version: 2.0.59 / 2.0.60
- IDE: VS Code (integrated terminal)
Bug Description:
When running two Claude Code instances simultaneously in VS Code's integrated terminal, both pointed at the same project directory, one instance blocks/freezes the other. Typing a command in the frozen instance causes it to sit and accept no input. Restarting the frozen instance makes it work, but then causes the previously-working instance to freeze.
Steps to Reproduce:
- Open VS Code in a project directory on macOS
- Open integrated terminal, run
claude - Open second integrated terminal in same project, run
claude - Attempt to use both instances — one will freeze and accept no input
- Restart frozen instance — it works, but first instance now freezes
Expected Behavior:
Both instances should remain responsive and functional, or Claude should detect multiple instances and provide a clear error message.
Actual Behavior:
One instance becomes completely unresponsive. No error message displayed. Input appears queued but not processed.
Related Issues: #8699, #13188, #4014
Additional Context:
This behavior started appearing around v2.0.59/2.0.60. Suspect the "background agent support" feature introduced in v2.0.60 may be related.
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 2.0.60
- Feedback ID: 8e03919a-424a-4d90-8caa-240912712f5c
Errors
[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/lohonyaigyozo/.local/share/claude/versions/2.0.60 (expected in multi-process scenarios)\n at Eh0 (/$bunfs/root/claude:2714:1622)\n at jCA (/$bunfs/root/claude:2712:35598)\n at async w$7 (/$bunfs/root/claude:2712:37706)\n at async iv (/$bunfs/root/claude:2714:236)\n at async <anonymous> (/$bunfs/root/claude:2714:13006)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T18:08:46.654Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/lohonyaigyozo/.local/share/claude/versions/2.0.60 (expected in multi-process scenarios)\n at Eh0 (/$bunfs/root/claude:2714:1622)\n at jCA (/$bunfs/root/claude:2712:35598)\n at async w$7 (unknown)\n at async iv (unknown)\n at unknown\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T18:09:00.452Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/lohonyaigyozo/.local/share/claude/versions/2.0.60 (expected in multi-process scenarios)\n at Eh0 (/$bunfs/root/claude:2714:1622)\n at jCA (/$bunfs/root/claude:2712:35598)\n at async w$7 (/$bunfs/root/claude:2712:37706)\n at async iv (/$bunfs/root/claude:2714:236)\n at async <anonymous> (/$bunfs/root/claude:2714:13006)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T18:15:24.855Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n at readFileSync (unknown)\n at readFileSync (/$bunfs/root/claude:12:370)\n at piB (/$bunfs/root/claude:4490:17669)\n at call (/$bunfs/root/claude:1404:912)\n at call (/$bunfs/root/claude:1400:5711)\n at eq7 (/$bunfs/root/claude:3120:16948)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T18:16:06.474Z"},{"error":"MaxFileReadTokenExceededError: File content (80586 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at liB (/$bunfs/root/claude:1395:10588)\n at async call (/$bunfs/root/claude:1404:972)\n at async <anonymous> (/$bunfs/root/claude:1616:1513)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T18:20:04.019Z"},{"error":"MaxFileReadTokenExceededError: File content (80586 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at liB (/$bunfs/root/claude:1395:10588)\n at async call (/$bunfs/root/claude:1404:972)\n at async <anonymous> (/$bunfs/root/claude:1616:1513)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T18:20:08.846Z"},{"error":"MaxFileReadTokenExceededError: File content (80586 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at liB (/$bunfs/root/claude:1395:10588)\n at async call (/$bunfs/root/claude:1404:972)\n at async <anonymous> (/$bunfs/root/claude:1616:1513)\n at processTicksAndRejections (native:7:39)","timestamp":"2025-12-06T18:20:13.528Z"},{"error":"MaxFileReadTokenExceededError: File content (80586 tokens) exceeds maximum allowed tokens (25000). Ple
Note: Error logs were truncated.
16 Comments
---
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Comment for GitHub Issue #13287
Experiencing Same Issue - Additional Evidence of IDE MCP Server Impact
I'm experiencing this exact issue on macOS 26.1.0 (Tahoe Developer Beta) with Claude Code v2.0.29, IDE MCP Server v2.0.60.
Timeline
Symptoms Matching This Issue
Additional Evidence: IDE MCP Server Message Routing Breakdown
I've done extensive debugging and found that the file locking issue causes a downstream effect on the IDE MCP server. When sessions are in this deadlocked state, the shared IDE MCP server starts routing JSONRPC responses to the wrong sessions:
From debug logs (
~/.claude/debug/*.txt):Session
a0ab19cc-e994-4273-a347-00da16d4a6b0(11:39 AM - BROKEN):Key finding: This session never made any IDE tool calls, yet received responses for message IDs 2 and 3. These responses came from a concurrent session (
18ac6c4c, 11:37 AM) that WAS calling IDE tools (closeAllDiffTabs,getDiagnostics).The response content proves it: "CLOSED_0_DIFF_TABS" matches the
closeAllDiffTabstool call from the earlier session.Pattern Analysis
Working sessions (11:37 AM):
Broken sessions (11:39 AM onwards):
Root Cause Theory
The file locking deadlock (as described in this issue) appears to cause:
This suggests the file locking issue has wider impact than just freezing sessions—it's breaking inter-process communication between Claude Code and the IDE MCP server.
Environment
Proposed Fix Impact
If the file locking issue is resolved (as proposed in this issue), it should also fix:
Happy to provide full debug logs if useful for debugging.
---
Additional context: Initially thought this was a configuration issue and spent hours debugging MCP config files, but timeline analysis proved the config changes happened 2+ hours before the first failure, ruling them out as the cause.
+1 to this, opened a thread on reddit discussing this issue
https://www.reddit.com/r/ClaudeCode/comments/1pgtllc/can_no_longer_run_cc_in_parallel_in_vscode/
+1 this is a bit of a workflow killer
+1 started happening today for me too today with version
2.0.61. Happening with VSCode on Ubuntu 24.04.Fixed!
An update to version 62 of Claude Code has solved all this
Wasn't solved for me on ver 62, also it happens on single instance too
edit: on mac
have the same problem on mac os on v62
Same issue on Ubuntu:
Version: 2.0.62
Model: Default Opus 4.5
IDE: Connected to VS Code extension version 2.0.62 (server version: 2.0.60)
When i open a second claude session the other one will just stop doing any work. you cant kill the current thing its thinking on with escape key.
Only 1 active claude cli session can be happening in vscode or the second one gets clipped by this bug.
Please make sure you update both the IDE extension and CC and restart the IDE fully.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Additional Report: 5+ Parallel Conversations Freeze
Environment:
Reproduction:
Cmd+Shift+R(reload window) temporarily brings them backCompounding Issue - Lost Messages:
When conversations freeze, any message I sent to the frozen thread is lost after reload. The message was typed and sent, but the frozen process never persisted it. This means:
This makes the workflow significantly more painful than just the freeze itself.
Impact:
This is a workflow killer for anyone doing parallel code review or multi-threaded investigation work. The combination of freezes + lost messages means constant context-switching overhead and lost work.
Would love to see this prioritized - happy to provide logs or additional details if helpful.
this is a money saving bug for Anthropic, I suspect we wont get a fix any time soon.
2 months later... I'm still facing this bug while opening 2 Claude Code instances in 2 different folders on macOS.
Edit:
Sorry but I can't say what version I'm using as
❯ claude --version
is frozen ;-)
Title: [BUG] Multiple VSCode instances crash simultaneously when .claude.json is atomically rewritten
Description:
When two VSCode instances are open with different projects, both Claude Code processes crash simultaneously with exit code 1.
Root cause from logs:
One instance atomically writes .claude.json (rename from temp file), which kills all Claude Code processes across both VSCode windows:
2026-02-26T10:31:47.940Z [DEBUG] Renaming C:\Users\Alex\.claude.json.tmp.103136.1772101907938 to C:\Users\Alex\.claude.json
2026-02-26T10:31:47.941Z [DEBUG] File C:\Users\Alex\.claude.json written atomically
Within 1 second, all 4 channels die:
15:31:48.786 [error] Error from Claude (on channel o3k8bmlxb7): Error: Claude Code process exited with code 1
15:31:48.809 [error] Error from Claude (on channel kxipb90s20c): Error: Claude Code process exited with code 1
15:31:48.826 [error] Error from Claude (on channel 6tfl91yr4wu): Error: Claude Code process exited with code 1
15:31:48.836 [error] Error from Claude (on channel 9epk6inyqb): Error: Claude Code process exited with code 1
Environment:
Windows 10 Pro 10.0.19045
VSCode (latest)
Claude Code extension (latest)
Two separate VSCode windows, each with a different project
Related: #13287 (same root cause on macOS)
Additional evidence: recurring startup death clusters on macOS (v2.1.92 + v2.1.104)
Same pattern as OP, with better forensics. Documenting in case useful for root-cause work.
Environment: macOS 15.4 (Tahoe), CC v2.1.104, Ghostty + Terminal.app, ~35 sessions/day, 3 concurrent sessions typical.
Observations:
reason=otherstartup death clusters. Apr 12: 5 sessions died in 3 minutes. Apr 5: 9 sessions in 3 minutes (CC v2.1.92). Cross-version recurrence rules out a single-version regression.Cannot acquire lock for 2.1.104 - held by PID 900. But: same lock error appears in sessions that survive 20s and 130s on the same day. The lock is not sufficient to cause the crash.T+1.1s(ripgrep test PASSED), then 314ms later the session enters shutdown. Nothing logged in between. No fatal error, no signal, no exception. All MCP servers disconnect simultaneously (downstream symptom, not cause).UserPromptSubmitin the debug log. No transcript file created. Terminal parent was still alive (verified via forensics hook).Debug logs available (3 sessions: 1 crash + 2 survivors with same lock warning) if useful for the team's investigation.
Local workaround: Smart launcher that detects concurrent sessions and uses
--strict-mcp-configwith a minimal MCP config for secondary sessions, reducing startup surface.