[Bug] Duplicate concurrent session on same remote-control connection causes race conditions in git operations
Bug Description
Title: A single remote-control connection unexpectedly spawns a second concurrent session, causing a race condition on the same git repo
Symptoms: The user opened only one Claude Code session, but a second session appeared — one the user did not start, connected to the same remote-control, with noticeably shorter content. Both sessions read/wrote and committed to the same git repo simultaneously, causing: git rev-parse HEAD jumping between values across consecutive calls; files/commits just created appearing and then disappearing; Read reporting existing files as empty; Bash/Grep returning contradictory line numbers for the same file. To the working agent this looked like hallucination, but it was actually a race condition from concurrent modification.
Impact: The agent repeatedly mistook state that had been overwritten (by the other session) for its own hallucinations, producing a large amount of wasted self-correction.
Suggestion: A single remote-control connection should guarantee only one active session, or concurrent sessions should be given mutual exclusion / a warning.
Environment Info
- Platform: win32
- Terminal: xterm-256color
- Version: 2.1.218
- Feedback ID: 275095e3-7196-4f16-9f34-4d6943a6245f
Errors
[]