[BUG] Backgrounding a session creates a new session ID without the conversation transcript, despite docs saying history is preserved
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Interupting a tool use session and then sending it to the background, then resuming the session gives no conversation history. New self-referential session ID with a title-only stub; the full conversation stays behind under A with nothing linking the job to it.
Converting an interactive session to a background job (the & / /background flow, job state.json "template": "bg") creates the job under a new session ID and does not carry the conversation transcript. The /background command reference states "Conversation Preserved: The full conversation history is retained in the background session" — observed behavior contradicts this. Opening the job later shows an empty chat, which presents as data loss (the original transcript is actually intact under the old session ID, but nothing points to it).
What Should Happen?
Either the background job continues session A (same ID, same transcript — matching the docs), or resumeSessionId points at A so the job loads A's history.
Error Messages/Logs
Steps to Reproduce
- Interactive session
Aruns for hours in~/.claude/projects/<proj>/A.jsonl(~1 MB). - User interrupts a tool call, then sends the session to the background.
- A job is created with a fresh ID
B; itsstate.jsonhas"sessionId": B,"resumeSessionId": B(self-referential - it never points atA),"template": "bg", and"intent"set to the interrupt marker text fromA's tail. - The conversion does carry over: the
ai-title/agent-name(written into a ~300-byteB.jsonl), the permission mode, and the entire~/.claude/file-history/A/directory (hardlinked intofile-history/B/— same inodes, link count 2). - It does not carry the transcript.
B.jsonlstays a 300-byte stub containing only theai-title/agent-namelines. - When the user later opens job
B, the stub is orphaned (renamedB.orphaned-<epoch-ms>-<rand>.jsonl) and a fresh empty transcript starts. The chat renders empty.
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.220 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
Possibily related to #79757 , #58725
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗