Skip to content
Checked against Claude Code 2.1.286 · October 9, 2026

How to fork a Claude Code session

Use claude --fork-session with --resume or --continue to branch a saved conversation under a new session ID while leaving the original intact.

Short answer

Use claude --resume <id> --fork-session to load a saved Claude Code conversation under a new session ID. The original stays available, while new turns are written to the fork. Use claude --continue --fork-session only when the latest conversation in the current directory is definitely the source you want.

When to use it

A normal resume continues the same conversation. The fork flag is for experiments, alternate fixes, or a clean audit branch where you want the prior context but do not want new turns appended to the source session.

Use it safely

1. Choose the source explicitly

Open the resume picker or copy the session ID from your history. An explicit ID is safer than --continue when several conversations were active in the same repository.

claude --resume

2. Create the fork

Combine --fork-session with --resume. You can add an initial prompt so the branch starts with its intended alternative rather than an empty turn.

claude --resume <id> --fork-session "Try the migration without changing the public API."

3. Verify which branch you are in

Give the fork a descriptive name or note its new ID. The source and branch now share earlier context but diverge after the fork point, so future resumes must target the correct one.

claude --resume <new-id> --name migration-no-api-change

Important distinctions

  • --fork-session requires --resume or --continue; by itself there is no source conversation to branch.
  • A fork copies conversational context, not a snapshot of your Git working tree. Both sessions see the files as they exist when each command runs.
  • Use a Git branch or worktree as well when the code itself must diverge safely.

Where Crowsnest fits

Crowsnest exposes Claude transcript branching from the local conversation reader and keeps lineage to the source visible. The resulting session is still a native Claude Code conversation and can be resumed from the CLI.

Source and version

The exact text and flags on this page were checked against the installed Claude Code 2.1.286 binary on October 9, 2026. Version-specific behavior can change, so compare your own --help output before scripting around it. Official CLI documentation →

Reviewed from first-party CLI output and the released Crowsnest product source. No command on this page bypasses provider limits, billing, authentication, or native history rules.