[BUG] /resume renders an unselected session's transcript and injects synthetic messages into its .jsonl (v2.1.139, Windows PowerShell)
Description
When invoking /resume from a fresh terminal on Windows, with multiple existing sessions in the project, Claude Code renders the full transcript of a different (unselected) session into the terminal before yielding control to the actually-resumed session. The selected session's context is loaded correctly internally, but the displayed scrollback shows the wrong session's history.
Additionally, the unselected (displayed) session's .jsonl log gets two synthetic entries appended at the moment of /resume:
- a user message
"Continue from where you left off."withisMeta: true - an assistant message
"No response requested."withmodel: "<synthetic>"
Steps to reproduce
- Have multiple Claude Code sessions in the same project (different
.jsonlfiles in~/.claude/projects/<project>/). I had ~25 sessions, two of them with custom titles set via/rename: Session A ("Fork-C: ...") and Session B ("Fork-G: ..."). Both were last active the previous day in different terminals. - Open a fresh PowerShell terminal on Windows 11 (computer had just rebooted after a Windows update — no prior Claude Code state, no Windows Terminal scrollback persistence configured).
- Run
claude. - After the welcome banner, run
/resumeand select Session A.
Expected
- Welcome banner printed once.
- After
/resume, the visible terminal shows Session A's last few messages, an empty scrollback, or just a status indicator — whichever the design intends. - Only Session A's
.jsonllog file is modified.
Actual
- Welcome banner is printed twice in the scrollback (the second copy appears right before the unselected session's content).
- Session B's full transcript (~hundreds of messages from the previous day) is rendered into the terminal scrollback.
- The
/resumecommand issued by the user does not appear in the rendered scrollback at all — it is preceded/replaced by Session B's content. - Internally the resume IS correct: subsequent prompts confirm the agent is in Session A's context (memory, tasks, last conversation are all Session A's).
- Session B's
.jsonlgets two synthetic entries appended (timestamps within the same second, ~1 min after theclaudeinvocation):
{"type":"user","isMeta":true,"message":{"role":"user","content":[{"type":"text","text":"Continue from where you left off."}]},"timestamp":"2026-05-20T07:48:58.602Z","sessionId":"<session-B-id>","version":"2.1.139",...}
{"type":"assistant","message":{"model":"<synthetic>","role":"assistant","content":[{"type":"text","text":"No response requested."}],"stop_reason":"stop_sequence","stop_sequence":"",...},"timestamp":"2026-05-20T07:48:58.602Z","sessionId":"<session-B-id>","version":"2.1.139",...}
The 2 entries do not contain ordinary content; they look like a probe/wake-up that the harness uses internally, but they end up persisted in the log.
Environment
- Claude Code v2.1.139 (just updated from v2.1.138 — the
SessionStart:startuphook printed the update notice, which is also the first timev2.1.139ran on this machine) - Windows 11 Enterprise 10.0.26100
- PowerShell 5.1 (default Windows PowerShell, not pwsh 7)
- ~25 sessions in the project directory; Sessions A and B were the two most recently modified (yesterday).
- Computer just rebooted (Windows update). No persisted terminal scrollback feature in use.
Impact
- Confusion: the user sees a long transcript from one session and reasonably concludes they're in that session. Took several diagnostic exchanges and direct inspection of the
.jsonlfiles to confirm the internal state was actually the other session. - Log pollution: the unselected session's
.jsonlgets synthetic entries that did not originate from a real user interaction. Tools that mine these logs (analytics, transcript replay, session activity loggers) will see spurious content. The user's hooks that key offSessionEnd/ activity logs may produce noise too.
Hypothesis
The /resume flow appears to be probing or pre-loading other sessions in the project for preview/listing purposes, and that pre-load:
- Renders one of those sessions' transcripts into the terminal output (the visual bug).
- Writes a synthetic
Continue from where you left off.+No response requested.pair into that session's.jsonl(the data bug).
The fact that the welcome banner appears twice in the scrollback supports the idea that the UI is re-instantiating something between the initial claude invocation and the actual resume.
Note
I am happy to provide the full session log files privately if useful — they contain only software-engineering content but I'd rather not paste 20 MB of context into a public issue.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗