claude-code - 💡(How to fix) Fix [Bug] Multiple concurrent sessions spawned on same worktree without tracking [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#56472Fetched 2026-05-06 06:27:08
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/nick/.local/share/claude/versions/2.1.128 (expected in multi-process scenarios)\n at Nq6 (/$bunfs/root/src/entrypoints/cli.js:2764:2177)\n at uGH (/$bunfs/root/src/entrypoints/cli.js:2764:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T20:14:01.698Z"},{"error":"Error: Working directory "/Users/nick/dotfiles/.claude/worktrees/ese-upgrade" was deleted; shell cwd recovered to "/Users/nick". Re-issue your command (it will run from the recovered directory).\n at call (/$bunfs/root/src/entrypoints/cli.js:5059:1395)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T20:47:44.743Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3449)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-06T00:31:19.770Z"}]

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/nick/.local/share/claude/versions/2.1.128 (expected in multi-process scenarios)\n    at Nq6 (/$bunfs/root/src/entrypoints/cli.js:2764:2177)\n    at uGH (/$bunfs/root/src/entrypoints/cli.js:2764:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T20:14:01.698Z"},{"error":"Error: Working directory \"/Users/nick/dotfiles/.claude/worktrees/ese-upgrade\" was deleted; shell cwd recovered to \"/Users/nick\". Re-issue your command (it will run from the recovered directory).\n    at call (/$bunfs/root/src/entrypoints/cli.js:5059:1395)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T20:47:44.743Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3449)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-06T00:31:19.770Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description claude code is spawning sessions that it doens't even know about...that are working concurrently on the same worktree.

Environment Info

  • Platform: darwin
  • Terminal: kitty
  • Version: 2.1.128
  • Feedback ID: c70c0c26-6151-4bed-b632-228dd952f4d8

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/nick/.local/share/claude/versions/2.1.128 (expected in multi-process scenarios)\n    at Nq6 (/$bunfs/root/src/entrypoints/cli.js:2764:2177)\n    at uGH (/$bunfs/root/src/entrypoints/cli.js:2764:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T20:14:01.698Z"},{"error":"Error: Working directory \"/Users/nick/dotfiles/.claude/worktrees/ese-upgrade\" was deleted; shell cwd recovered to \"/Users/nick\". Re-issue your command (it will run from the recovered directory).\n    at call (/$bunfs/root/src/entrypoints/cli.js:5059:1395)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T20:47:44.743Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3449)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-06T00:31:19.770Z"}]

extent analysis

TL;DR

The issue can be mitigated by ensuring that Claude sessions are properly managed and terminated when no longer needed, to prevent concurrent access to the same worktree.

Guidance

  • Investigate the Claude code to identify where and why it is spawning unnecessary sessions that are working concurrently on the same worktree.
  • Review the error messages to understand the specific issues caused by these concurrent sessions, such as lock acquisition failures and working directory deletions.
  • Consider implementing a mechanism to track and manage active sessions, ensuring that only one session is working on a given worktree at a time.
  • Look into the cli.js file, specifically lines 2764 and 5059, to understand how the errors are being handled and potentially modify the code to better handle these scenarios.

Notes

The provided information suggests that the issue is related to the management of Claude sessions and their access to worktrees, but without more context or code, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: Implement a session management mechanism to prevent concurrent access to the same worktree, as this appears to be the root cause of the errors and issues described.

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