← Claude Code Hub
Jun 20, 2026 · 4 min read ✦ Tip #109

/fork in Claude Code: copy your conversation into a background session and keep working

If you learned /fork as a subagent, your mental model is wrong. Since v2.1.212 it copies your conversation into a new background session, with its own row in claude agents, and the old subagent is /subtask. Here's how it differs from /branch.

/branch vs /fork in Claude Code: /branch moves you into a copy of the conversation that you drive; /fork copies the conversation into a new background session, with its own row in claude agents, while you keep going

TL;DR /branch moves you into a copy of the conversation (the original stays put, you return with /resume): it's git checkout -b for your chat. /fork [prompt] doesn't move you: it copies your whole conversation into a new background session, with its own row in claude agents, that works on its own while you keep going. Since v2.1.212; the subagent /fork used to launch is now /subtask.

Update, October 31, 2026: since v2.1.212 /fork no longer launches a subagent inside your session: it copies the conversation into a new background session, with its own row in claude agents. The old behavior now lives in /subtask.

If you learned /fork as "the subagent that inherits my context", your mental model is wrong. Since v2.1.212 there are three different mechanisms, and mixing them up is what makes people reach for the wrong one:

  • /branch: you switch into a copy yourself.
  • /fork: the copy goes off to another background session and you stay put.
  • /subtask: a subagent with your context hands a result back here.

/branch: you clone and switch in

/branch [name] creates a branch of the conversation at this point, switches you into it, and preserves the original (you return with /resume). It's for exploring a different direction without losing what you have. Want it as a fresh, independent session from outside? claude --continue --fork-session does exactly that, covered in branch your sessions with fork-session.

/fork: you send a copy to another session and keep going

/fork [prompt] doesn't move you. It copies the whole conversation into a new background session, which shows up as its own row in agent view (claude agents). The copy carries over the model, permission mode, effort level, and any "don't ask again" grants you gave during the session. From then on they're two independent conversations: nothing the copy does comes back into yours.

The typical use case: you're mid-implementation and, without stopping, you fire:

> /fork open a draft pull request with the work so far
  • With a prompt, the copy starts working on it right away.
  • Without one, it waits for its first instruction: select its row in claude agents and press Space, or jump in with claude attach <id>.
  • The confirmation is one line with the copy's state (session running), its row name, and its id for claude attach. Click the name to switch into the copy; this session moves to the background.
  • Its edits stay out of yours: Claude Code tells it to create its own worktree before touching code, unless it's set to edit in place.

/subtask: the old /fork

If what you wanted was the old /fork, it's now called /subtask <task>. It spawns a background subagent that inherits the whole conversation (same system prompt, tools, model, and history), works while you keep going, and when it's done only its final result comes back as a message in your conversation. It shows up in a panel below your prompt: Enter opens its transcript so you can send it messages, x stops or dismisses it.

A normal subagent starts fresh: it doesn't see your history, and Claude writes it a summary message (which is why they sometimes lose context). The /subtask one inherits everything, and because its system prompt and tools are identical to the parent's, its first request reuses the parent's cache (prompt caching). The /fork copy also keeps the original conversation's cache, since v2.1.257.

Reference

/branch [name] /fork [prompt] /subtask <task>
What it creates A branch of the conversation A new background session A background subagent
Do you switch? Yes, you move into the copy No, you stay in yours No, you stay in yours
Where you see it In your terminal Its row in claude agents A panel below the prompt
What comes back to your chat Nothing (it's you) Nothing, it's independent Its final result
The original Preserved (/resume) Untouched, you stay in it Untouched, you stay in it

Details worth knowing

  • Agent view turned off: with disableAgentView or CLAUDE_CODE_DISABLE_AGENT_VIEW, /subtask isn't available and /fork launches the old subagent.
  • Sessions that can't be copied: if you started with a replaced system prompt or a --tools allowlist, /fork says so instead of making a partial copy.
  • The copy's name: if your session has no title, the row is named after your prompt.
  • A /subtask fork can't spawn another fork (it can spawn other subagent types).

Official docs: Copy the session with /fork · Fork the current conversation · Commands

Requirements

  • Claude Code v2.1.212+ for /fork as a background session and for /subtask, with agent view on.

Found this useful? See more of wmedia.es in your Google results.

Add wmedia.es as a preferred source on Google
FREE GUIDE

You don't need Opus every time.

Model and effort are two settings, not one. 8 pages with the settings that actually move your bill, a three-question diagnostic for when something fails, and the price ladder.

  • 1. What "better" means capability, time and money
  • 2. Model who you send
  • 3. Effort how much rope you give
  • 4. Diagnostic three questions when something fails
  • 5. The bill where it comes from
Are you a professional Web developer?

It arrives by email · You join the Gravitas newsletter · Unsubscribe anytime

Stop overpaying in Claude Code
FREE GUIDE

You don't need Opus every time.

Are you a professional Web developer? · Unsubscribe anytime
Workshop for teams

Multiply your team's output without sacrificing quality: a 6 to 8 hour AI First workshop, online, on the Claude platform.

See the workshop

Using Opus for everything? See when you don't need it.