Branch a Conversation with --fork-session
Ever wanted to try a different approach mid-conversation without losing your current progress? The --fork-session flag creates a new session that starts from the same conversation history but gets its own independent ID.
claude --resume "auth-refactor" --fork-session
This loads the full transcript from "auth-refactor" into a brand new session. You can take the conversation in a completely different direction without touching the original. The original session stays exactly where you left it.
This is useful for exploring alternative approaches:
# Original session: you've been building auth with JWT
claude -n "auth-jwt" "Implement JWT-based authentication"
# Fork to try a session-based approach instead
claude --resume "auth-jwt" --fork-session -n "auth-sessions"
# Both sessions exist independently
claude --resume "auth-jwt" # Still has the JWT approach
claude --resume "auth-sessions" # Has the session-based approach
It also works with --continue for the most recent conversation:
# Fork your most recent session
claude --continue --fork-session
Think of it like git branch for conversations. The fork point preserves all the context Claude has built up (understanding of your codebase, decisions made, code already written), giving the new branch a head start.
Fork your conversations like you fork your branches. Explore freely, commit to the best approach.
Log in to leave a comment.
The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.
The language setting makes Claude respond in your preferred language by default, across every session and project.
The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.