[Bug] Session fork instead of interleave when resuming from multiple terminal windows
Bug Description
Title: Resuming the same session from a second terminal window silently forks it, instead of interleaving as documented
Environment:
- Claude Code version: 2.1.218
- macOS version: 26.5.2 (Build 25F84)
Summary:
A single Claude Code CLI session ended up split into two separate, unlinked sessions with identical auto-generated titles, sharing identical early history but diverging afterward.
Sequence of events:
1. Long-running session in one Terminal window, working through a script-debugging task.
2. Ran /exit, then separately restarted the Mac (for an unrelated file-permissions issue).
3. Resumed the session afterward via claude --continue/claude --resume.
4. At some point a Terminal window with the session still open was minimized (or the Mac was put to sleep) and forgotten about — not force-quit, just left running in the background/out of sight.
5. A new Terminal window was opened and claude --resume was used to pick what looked like the same session from the picker.
Result:
Two entries now appear in the claude --resume picker with the identical auto-generated name. Neither window shows the other's messages since the fork point — the two sessions are fully diverged, not interleaved.
Expected behavior (per Claude Code's own documentation):
The docs state that resuming the same session in two terminals should cause messages from both to interleave into a single shared transcript, not fork into two separate, diverging session files. What actually happened contradicts that documented behavior.
Also missing: there is no built-in way to merge the two diverged sessions back into one afterward (e.g. deduplicating the shared history and combining the diverged tails). A merge/reconciliation option would be a useful addition alongside a fix for the underlying fork.
Reproduction: Not attempted/confirmed reliably reproducible at this stage — reporting based on a single real-world occurrence. Suspected trigger: minimizing (or letting the Mac sleep while) a terminal with an active session open, then resuming that same session from a
freshly opened window.
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.218
- Feedback ID: 3782d9f8-ac72-4b10-939f-172d200560a0
Errors
[]