In Claude Code, when should you hand a side task to a forked subagent with `/subtask` rather than a fresh subagent?
answer
- briefing cost against independence
- inherits history, prompt, tools, model
- reads the parent's prompt cache
- /subtask since 2.1.212, /fork before
- fresh eyes need a fresh agent
basics
~20 sUse a fork (/subtask, v2.1.212+) when the side task needs what the conversation already knows: it inherits history, prompt, tools and model and reuses the parent's cache. Use a fresh subagent for other tools, another model or an unbiased view.
solid answer
~40 sA **fork** is a subagent that inherits the whole conversation so far, with the same system prompt, tools and model, so you can hand it a side task without re-explaining anything. Its tool calls still stay out of your window and only its final result comes back. Because its prefix matches the parent's, its first request reads the parent's **prompt cache**, which makes it cheaper than a fresh subagent for context-heavy work. In v2.1.286 you start one with `/subtask <task>` (it was `/fork` on v2.1.161 through v2.1.211; `/fork` now copies the session into a separate background session). Pick a **fresh** subagent when the job needs different tool restrictions, a cheaper model, a clean slate for an independent review, or when the briefing is short anyway.
go deeper
Recall that a fork inherits the conversation while a normal subagent starts from a task message, and that /subtask starts a fork in current releases.
Explain what a fork shares with the main session (history, prompt, tools, model, cache) and why only its result still returns.
Choose between them on briefing cost, tool and model constraints, cache reuse and independence of judgement, and know the /fork rename history so instructions written for older releases do not mislead the team.
Frame the tradeoff as shared context against shared bias: forks are cheap and fast for continuation work, fresh agents buy independent verification. Decide which review and exploration steps need which.
## Two kinds of subagent Every subagent in Claude Code works in its own context window and returns only its final message. They differ in what they start with. - A **fresh (non-fork) subagent** starts from its definition: its own system prompt, its own tool list and model, CLAUDE.md, a git status snapshot and the **delegation message** Claude writes. It has none of your conversation. - A **fork** inherits **everything the main session has at the moment it spawns**: the full message history, the same system prompt, the same tools and the same model. It drops the *input* isolation subagents normally give, but keeps the *output* isolation: its own tool calls stay out of your conversation and only its result comes back. | | Fork | Fresh subagent | | --- | --- | --- | | Context | Full conversation history | Only the task message Claude writes | | System prompt and tools | Same as the main session, exact tool pool | From the definition, filtered for background runs | | Model | Same as the main session | From the definition's `model` field or other defaults | | Prompt cache | Reads the parent's cache | Builds a separate cache | | Output style | Applies | Does not apply | | Permission prompts | Surface in your terminal | Surface in the main session when it runs in the background | ## Starting a fork In v2.1.286 you start one yourself with **`/subtask`** followed by the task, for example `/subtask draft unit tests for the parser changes so far`. The command arrived in v2.1.212; on v2.1.161 through v2.1.211 the same thing was `/fork`. Today `/fork` does something else: it copies the whole conversation into a **separate background session** that you manage from agent view, which belongs to parallel sessions rather than in-session delegation. If agent view is turned off, `/subtask` is unavailable and `/fork` keeps the old forked-subagent behaviour. A fork runs in the background and appears in a panel below the prompt. `Enter` on its row opens its transcript so you can send it follow-ups, and `x` stops it. When it finishes, its result arrives as a message in your main conversation. Claude can also fork on its own by requesting the `fork` subagent type through the `Agent` tool, while **fork mode** is on. Fork mode is on by default in interactive sessions since v2.1.232 and off in `claude -p` and the Agent SDK; `CLAUDE_CODE_FORK_SUBAGENT=1` or `0` overrides that, and an `Agent(fork)` deny rule stops Claude from spawning forks while leaving `/subtask` to you. ## When a fork is the better tool 1. **The briefing would be long.** If a fresh subagent would need half the conversation restated to be useful, a fork already has it. 2. **You want to try several approaches from one starting point.** Each fork carries the same history. 3. **Cost matters for a context-heavy task.** A fork's first request reuses the parent's cached prefix; a fresh subagent's first request reads no cache from the parent, because its prefix differs. 4. **You want your own conventions honoured.** A fork keeps your output style and the exact tool pool. ## When a fresh subagent is the better tool - **Independence.** A reviewer that inherits the debate inherits its assumptions. For a second opinion on a design the main conversation argued itself into, brief a fresh subagent with the design, not the argument. - **Different constraints.** A fresh subagent can be read-only, limited to a few tools, or run on a cheaper model. A fork has the main session's tools and model and nothing else. - **Short, self-contained jobs.** "Find every caller of `refreshSession`" needs one sentence of briefing; carrying the whole history is waste. - **Nested work.** A fork cannot spawn further forks. - **Edits you want kept apart.** Both kinds can write files; when Claude spawns a fork through the `Agent` tool it can pass `isolation: "worktree"` so the fork's edits land in a separate git worktree instead of your checkout. ## Traps - Treating `/fork` and `/subtask` as synonyms. On current releases they are different commands with different results. - Assuming a fork's work lands in your history. Only its final result does, like any subagent. - Assuming a fork is isolated from your mistakes. It starts with every wrong assumption the conversation has made.
- A teammate on a recent release types `/fork investigate the flaky login test` expecting a subagent that reports back. What actually happens?On v2.1.212 and later, `/fork` copies the conversation into a new background session that lives in agent view, and its work does not report back into this conversation. The in-session forked subagent is now `/subtask`. Only when agent view is turned off does `/fork` keep the old behaviour of starting a forked subagent.
- How do you keep fork mode on but stop Claude from spawning forks by itself?Deny the `fork` subagent type with an `Agent(fork)` rule in `permissions.deny`. Claude can no longer request forks through the `Agent` tool, but you can still start one with `/subtask`, and Claude Code keeps running other spawned subagents in the background as fork mode prescribes. Setting `CLAUDE_CODE_FORK_SUBAGENT=0` instead turns fork mode off entirely.
A fresh subagent is a contractor briefed by a one-page memo: cheap to bring in for a clear job, and free of your team's blind spots. A fork is a colleague who sat through the whole meeting: no briefing needed, but they leave with the same assumptions everyone in the room made.
- /fork and /subtask are two names for the same command
- A fork starts fresh but gets a summary of the conversation
- A fork's tool calls are written into the main conversation
- Forks are always more expensive because they carry the whole history
- A fork can run on a cheaper model than the main session
Assumes Claude Code 2.1.286: /subtask needs 2.1.212+ (it was /fork on 2.1.161-2.1.211), and fork mode is on by default in interactive sessions since 2.1.232.