Answer: To fork a Claude Code SDK session, resume the original session ID with the fork option enabled (fork_session=True in Python or forkSession: true in TypeScript), which creates a new session with its own ID while leaving the original unchanged. You can then resume the original session separately to continue the original thread. Status: Confirmed Entry: tool/claude-code/agents-and-automation/fork-session Revision: 1 Digest: sha256:0f379b091cd023d9 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:57Z Last changed: 2026-11-13T03:02:57Z Last verified: 2026-11-20T12:17:15Z Next check: 2026-11-21T12:17:15Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Python fork option | fork_session=True | [1] | 2026-11-20 TypeScript fork option | forkSession: true | [1] | 2026-11-20 Resume option | resume=session_id | [1] | 2026-11-20 Fork behavior | The fork gets its own session ID; the original's ID and history stay unchanged. | [1] | 2026-11-20 Filesystem note | Forking branches the conversation history, not the filesystem. | [1] | 2026-11-20 Sources: [1] Anthropic. "Work with sessions". https://code.claude.com/docs/en/agent-sdk/sessions.md Role: primary. Accessed: 2026-11-20T12:17:15Z Quote: "fork_session=True," (Supports: Python fork option) Quote: "forkSession: true," (Supports: TypeScript fork option) Quote: "resume=session_id," (Supports: Resume option) Quote: "The fork gets its own session ID; the original's ID and history stay unchanged." (Supports: Fork behavior) Quote: "Forking branches the conversation history, not the filesystem." (Supports: Filesystem note) Published: 2026-11-20T02:52:44Z Snapshot SHA-256: 456f033eff0db40bef3d41724e8ee7260cd156256727d73859c4ee108c7e35d8 (captured 2026-11-13T03:02:57Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:02:57Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:17:15Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:17:15Z Last attempt: 2026-11-20T12:17:15Z Notes and limitations: Extracted automatically from a single official source (section "Fork to explore alternatives"). Related: https://latestn.com/tool/claude-code/agents-and-automation/free-text-input-responses How do I support free-text input for Claude Code clarifying question responses? https://latestn.com/tool/claude-code/agents-and-automation/goal-evaluation How does Claude Code evaluate whether a goal is met, and what happens when a turn fails? https://latestn.com/tool/claude-code/agents-and-automation/handle-clarifying-questions How do I present Claude Code's clarifying questions and return the user's answers to the SDK? https://latestn.com/tool/claude-code/agents-and-automation/enable-streaming-output How do I enable streaming output in the Claude Code Agent SDK? https://latestn.com/tool/claude-code/agents-and-automation/enforce-rules-with-hooks How do I enforce rules that can't have exceptions in Claude Code using hooks? https://latestn.com/tool/claude-code/agents-and-automation/filter-hook-events How do I filter which events a Claude Code mod hook handles? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:02:57Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/fork-session/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/agents-and-automation/fork-session POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/fork-session with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/fork-session?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I fork a Claude Code SDK session to explore alternative approaches? Revision 1, last verified 2026-11-20T12:17:15Z. https://latestn.com/tool/claude-code/agents-and-automation/fork-session (accessed 2026-11-21T10:01:02Z). @misc{LatestN_tool_claude_code_agents_and_automation_fork_session_r1, title = {How do I fork a Claude Code SDK session to explore alternative approaches?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/fork-session}}, note = {Revision 1; digest sha256:0f379b091cd023d9; last verified 2026-11-20T12:17:15Z; accessed 2026-11-21T10:01:02Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/agents-and-automation/fork-session