035. A Claude resume keeps the session ID and the transcript file
- Date
- 2026-10-30
- Agents
- Claude Code
- Measured on
- real machine
Measured
2026-10-30, Claude Code 2.1.314 with --model haiku, on Linux (Debian 13,
x64), in a private tmux server with a throwaway HOME. The scenario
scenarios/claude/plan-and-resume.sh ran one session, stopped it with
/exit, and started claude --resume <sessionId> in a new process. It
listed the files below ~/.claude/sessions/ and ~/.claude/projects/ at
each step, and recorded every hook payload. One run.
Measured on: real machine.
What was measured
- After
/exit,SessionEndfired withreason: prompt_input_exit. The files<pid>.jsonand<pid>.<64 hex characters>.keyof the first process were gone. The transcript file stayed. - The new process had a new pid and wrote a new
<pid>.jsonand a new.keyfile. ItssessionIdwas the same ID as in the first process. SessionStartfired withsource: resumeand the samesession_id. Itstranscript_pathwas the same file as in the first process.- The new process appended to that transcript file. The file grew at the resume and again after the next prompt. No other transcript file appeared in the project folder.
- After the first prompt of the resumed session, the hooks were
UserPromptSubmit,Stop, and thenSubagentStopwith an emptyagent_type. The scenario did not start a subagent. The cause of thisSubagentStopis not known. - The resumed screen drew the old conversation, and the name of the
session (
create-note-txt) in the frame of the input box.
Mechanism
A session ID names one transcript file for the whole life of the session, also across processes. A reader that maps a pid to a session (fact 023) must read the pid file again for each new process. The session ID can stay the same while the pid changes.
Incident
None.
Screens
None.
Not measured
/resumeinside a running process, and--continue.- A resume while the first process still runs.
- A resume after a crash, with a pid file that stayed.
- Whether a resumed process uses the task folder of the resumed ID (fact 034). No Bash call ran after the resume.
- macOS and Windows.