Skip to content
LLM Tracker
Overview
ClaudeOpenAIGemini
Subscribe
LearnModelsReleasesTipsGuidesChangelogStatus
Explore LLM Tracker
All providers · Overview
ClaudeOpenAIGemini

Explore Claude

LearnModelsReleasesTipsGuidesChangelogStatus
Subscribe to the feed
Status JSONRSS feeds

Maintained by Jaden Razo · RaizHost

Not affiliated with Anthropic, OpenAI, or Google. Data sourced from each provider's public docs, status pages, npm, and GitHub.

Back to tips
Workflow1 min read·Apr 24

Fork a subagent instead of spawning fresh

/fork inherits the parent session's full context and prompt cache. When the task benefits from everything you've already explained, a fork beats a fresh subagent.

Claude Code 2.1.117 introduced forked subagents. Enable with CLAUDE_CODE_FORK_SUBAGENT=1, then /fork spawns a subagent that:

  1. Inherits the full parent conversation context.
  2. Shares the parent's prompt cache (no cache-miss cost on the first turn).
  3. Runs independently — its edits come back but its context doesn't pollute the parent.

Use it when: the subagent needs to know why you're doing what you're doing. E.g., you've spent 30 turns debugging a race condition, and now you want a subagent to write the fix without re-explaining the codebase.

Don't use it when: you want a clean context (use a fresh general-purpose agent). Or when the task is small enough that inheriting the whole parent is wasteful.

The prompt-cache part is not cosmetic. A fresh subagent on a long parent context pays the full input-token price on its first turn. A fork pays nothing new — the cache hit is ~90% cheaper and several times faster. For agent-heavy workflows, this compounds.

Check it's enabled with /fork at the prompt. If the command isn't available, the env var isn't set or the CLI is older than 2.1.117.

Sourced from content/tips/fork-subagent.md — open a PR to edit.