CloudCodeTree LogoCloudCodeTree
AI NewsTutorialsAbout
CloudCodeTree Logo
CloudCodeTree
  • AI News
  • Tutorials
  • About
← Back to AI News
Fork a Running Session to Explore a Risky Approach Without Losing Your Place

Fork a Running Session to Explore a Risky Approach Without Losing Your Place

Chris Harper

2 min read

Sep 3, 2026 · 04:11 UTC

AI
Workflow
Claude Code
Best Practices

/fork copies your entire conversation — history, context, model settings — into a background session that runs independently while your original keeps going.

When you're deep in a Claude Code session and realize you want to try something that might not work — a big refactor, an architectural change, a destructive migration — there's a fork.

Run /fork [description] and Claude Code creates a new background session with an identical copy of your conversation: the same history, system prompt, tool definitions, and model settings. Your original session keeps going. The fork appears in claude agents with its own labeled row.

Why fork beats a clean subagent for exploratory work: a clean subagent starts fresh and needs briefing. A fork inherits everything the session already knows — the codebase context you've built up, the discussion about which approach to take, the files you've already read. For exploratory work on a complex codebase, that inheritance is the difference between a useful branch and a wasted re-briefing.

# Branch off the current session to try a risky migration approach
/fork "explore multi-tenant DB migration with separate schemas"

# Your original session keeps responding to your next prompt
# Check the fork's progress anytime
claude agents

Limit: the fork can't write back to the parent session's state. Its file changes land in your working tree like any other subagent's. If the approach works, you review and merge the branch. If it doesn't, you abandon the fork — your original session is untouched.

subagent_type: "fork" in a skill or agent definition does the same thing programmatically when you want inherited context for a specific delegated task rather than a clean-slate subagent.

Sources: Claude Code sub-agents — code.claude.com · Fork vs. subagent in Claude Code — DEV Community · Forked Subagents in Claude Code — mejba.me