What
- Streaming partial-message frames can now carry a
resume_reasonfield explaining why the current turn is an automatic re-run of one interrupted by a worker restart:host_draining,checkpoint_restore,container_recreated, or a fallbackinterrupted_turn. This ties to theCLAUDE_CODE_RESUME_INTERRUPTED_TURN/CLAUDE_CODE_RESUME_REASONmechanism. - The SDK/headless turn-result schema gains the same optional
resume_reasonstring, plus an optionalresult_indexinteger, in both the streamed and final result message shapes. - When Claude Code auto-resumes an interrupted turn at session restart, the reconstructed prompt now includes a
resumeReasonand, when available, aresumedTurnUserMessageUuidpointing back to the original interrupted turn's user message.
Why This makes it clear, both in the UI/streaming output and in SDK results, why a turn was automatically re-run after an interruption (such as the worker host draining or a container being recreated), and links the resumed turn back to the original one it replaced.
Names in the bundleresume_reasonresult_index
Documented inclaude-code/agent-sdk/typescript
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added since
A small documentation edit on Agent SDK reference - TypeScript touched a line naming resume_reason after this was published.
* `resume_reason`: why Claude Code re-ran this turn after a restart interrupted it. Present on both arms. See [`resume_reason`](#resume_reason).agent-sdk/typescript see the edit
Confirmed since
Anthropic's documentation has since written up result_index, on Agent SDK reference - TypeScript.
result_index?: number;agent-sdk/typescript see the edit
Confirmed since
Anthropic's documentation has since written up resume_reason, on Agent SDK reference - TypeScript.
resume_reason?: string;agent-sdk/typescript see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up resume_reason, on Agent SDK reference - TypeScript.