CloudCodeTree LogoCloudCodeTree
AI NewsTutorialsAbout
CloudCodeTree Logo
CloudCodeTree
  • AI News
  • Tutorials
  • About
← Back to AI News
One Dead End Shouldn't Ruin the Session: /fork Clones Your Claude Code Conversation Into a Parallel Experiment

One Dead End Shouldn't Ruin the Session: /fork Clones Your Claude Code Conversation Into a Parallel Experiment

Chris Harper

2 min read

Aug 4, 2026 · 04:08 UTC

AI
Workflow
Claude Code
Best Practices

/fork copies your full conversation history into a new background session so you can try an alternative approach without rewinding or losing the original.

When you're halfway through refactoring a module and hit a decision fork — "extract this into a service, or keep it as a helper?" — the old answer was to pick one and backtrack mentally if it failed. /fork removes that constraint.

/fork

Claude Code copies the full conversation history and current directory state into a new background session and returns its ID. The original session continues untouched. Switch between them with /resume <session-id>, or run both in separate terminals simultaneously.

Practical pattern — try two strategies in parallel:

# Terminal A (original session):
/fork
# Prints: Forked → session abc123

# Terminal A: implement the service extraction approach

# Terminal B:
claude --resume abc123
# Implement the helper function approach here

Compare the diffs at the end and keep whichever worked.

When /fork pays off most:

  • Before a risky refactor — fork, try it in the fork, merge back only if it worked
  • Architecture choices — stream and batch approaches running in parallel, pick the faster one
  • Code review iterations — fork before addressing comments; keep the original as a baseline

One gotcha: both sessions share the same working directory on disk. If they write to the same files concurrently, you'll get conflicts. Fix: run git checkout -b experiment-b in the fork before starting work, so each session writes to its own branch.

Sources: /fork Explained — ClaudeKit · Session Forking — BSWEN · Parallel Sessions — HeyClaude