Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Learn Claude Skills. Do Everything Better.
claudeskill-me.com
LATEST
Check Before Upgrading to Claude Code 2.1.299: Stricter MCP Allow Rules, Skill Names With Odd Characters Rejected, UserPromptSubmit Hooks Now Run First  ·  Claude Code Adds Idle Compaction: Conversations Over 200K Tokens Are Compacted After About 54 Idle Minutes — It Saves Cache Cost and May Drop Detail  ·  Fork Subagents Inherit the Whole Conversation Instead of Starting Blank — and Since v2.1.302 They Are On by Default in VS Code, Desktop and Headless Runs  ·  claude plugin eval Explained: Using the With/Without Delta (Δ) to Judge Whether a Skill Helps — and Why Δ Never Fails Your CI  ·  Claude Code Hooks Fail Open by Default: A Missing Script, a Timeout or Exit 1 Lets the Action Through — Using onFailure: "block" from v2.1.295  ·  Claude Haiku 5.5 Becomes Claude Code's Default Haiku: Input Drops to $0.10, but Crossing 100K Tokens Makes the Whole Request Five Times Pricier
advanced

Fork Subagents Inherit the Whole Conversation Instead of Starting Blank — and Since v2.1.302 They Are On by Default in VS Code, Desktop and Headless Runs

30-Second Version · For the impatient
A normal subagent sells isolation, while a fork gives it up on purpose to avoid re-explaining; they are two ends of one trade-off, not old and new versions.

Full Explanation +
01 · Why did this happen?

What is the difference between a fork and a normal subagent, in one sentence?

A fork inherits the whole conversation (same system prompt, tools, model and message history), while a normal subagent starts blank with only the task message, CLAUDE.md, git status and preloaded skills. What they share is that intermediate tool calls stay out of the main conversation and only the final result comes back.

02 · What is the mechanism?

I use claude -p in CI. Will my bill go up after upgrading?

The release notes do not quantify fork cost, so there is no firm answer. From v2.1.302, claude -p can use forks by default, Claude may choose one when delegating, and a fork carries the whole history. The DEV Community write-up says the effect can go either way and advises measuring a few runs. Compare token usage before and after the upgrade using the usage in --output-format json or OpenTelemetry, then decide whether to set CLAUDE_CODE_FORK_SUBAGENT=0.

03 · How does it affect me?

I set autoCompactWindow in a subagent's frontmatter and it seems to do nothing. Why?

Check in order: write a plain integer, since 200k is read as 200 and falls out of range; the range is 100000 to 1000000 and the value must be below the window the subagent would otherwise inherit; CLAUDE_CODE_AUTO_COMPACT_WINDOW, if set, overrides the field; and it has no effect when the whole session runs as the subagent via --agent or the agent setting. Finally, run claude --debug and search the log for invalid autoCompactWindow to see whether it was ignored.

04 · What should I do?

I'm not an engineer. How should I think about this?

Think of a subagent as an assistant you ask to do one task. A normal subagent gets a task sheet and starts from zero; a fork reads the whole conversation record up to now before starting. The latter needs no re-explaining, but it has a lot to read. This default changed in automated workflows, so if you watch costs, ask the engineers to compare usage once after the upgrade.

Full Content +

Most people picture a subagent as "a clean context to do one thing." Fork subagents deliberately do not work that way: the official docs describe a fork as a subagent that inherits the entire conversation so far instead of starting fresh, which drops the input isolation subagents otherwise provide in exchange for not having to re-explain the background. v2.1.302, released October 16, 2026, turned forks on by default in claude -p, the Agent SDK, the desktop app and VS Code, so this trade-off now happens automatically in more places.

How a normal subagent differs from a fork

Per the official subagent docs, a normal subagent starts with only its own system prompt, the task message, CLAUDE.md files, git status and any preloaded skills, and cannot see your conversation history. A fork sees the same system prompt, tools, model and message history as the main session, and it gets exactly the main conversation's tool pool, which means it skips the two filters that narrow tools for normal subagents. Output styles work the same way: the docs say they do not reach a normal subagent "except in a fork."

What they share is how output comes back: a fork's own tool calls stay out of your conversation and only its final result returns, so the main context stays clean.

When to use a fork

The docs' advice: use a fork when any other subagent would need too much background to be useful, or when you want to try several approaches in parallel from the same starting point. There are two ways to start one: have Claude request the fork subagent type through the Agent tool (when fork mode is on), or run /subtask <task> at any time, for example /subtask draft unit tests for the parser changes so far. /subtask needs v2.1.212 or later; from v2.1.161 through v2.1.211 the command was called /fork. With agent view turned off, /fork starts the forked subagent; otherwise /fork copies the whole session into a new background session.

To observe them, the panel below the prompt lists the main session and each fork: ↑/↓ move between rows, Enter opens a fork's transcript and lets you send follow-ups, x stops a running fork or dismisses its row, and Esc returns focus to the prompt. When a fork finishes, its result arrives as a message in the main conversation; successful rows disappear right away, and failed or stopped rows stay for 30 seconds.

What v2.1.302 changed by default

From the v2.1.302 notes: fork subagents (subagent_type: "fork") are now on by default in claude -p, the Agent SDK, the desktop app and VS Code, as they already are in the terminal; CLAUDE_CODE_FORK_SUBAGENT=0 turns them off, and claude mcp serve never offers them. The same release changed background behavior: the desktop app and VS Code now always run the main conversation's subagents in the background rather than letting Claude choose, and a subagent's own Agent calls in claude -p, the SDK, the desktop app and VS Code now run in the foreground by default.

One inconsistency to flag: the official subagent docs page I read still says fork mode is off in -p and the Agent SDK unless you turn it on. That is most likely the docs lagging behind v2.1.302, but I could not confirm it, so trust a test on your own version, and set CLAUDE_CODE_FORK_SUBAGENT explicitly if it matters.

Cost: the release notes do not quantify it

The release notes say nothing about how forks affect cost, and the docs page I read (cut off partway through the fork section) does not discuss prompt caching for forks. A DEV Community write-up says it can raise or lower headless spend and advises measuring a few runs before deciding. My inference, not documentation: a normal subagent saves tokens through isolation, while a fork brings the whole history in as input, and the longer the conversation, the larger that input, but it saves the cost of the orchestrator writing a brief and the subagent rediscovering the background. Which side wins depends on your conversation length and the kind of task.

A companion setting: autoCompactWindow for subagents

Since v2.1.296, a subagent's frontmatter and --agents definitions accept autoCompactWindow, which makes that subagent compact early, at a token count between 100000 and 1000000. The official docs' rules are easy to trip on:

---
name: log-reader
description: Reads long log files and reports the errors it finds
autoCompactWindow: 200000
---
  • Write a plain integer. 200k is read as 200, which is out of range, and the subagent behaves as if the field were absent. To check whether a value was ignored, run claude --debug and search the debug log for invalid autoCompactWindow.
  • If CLAUDE_CODE_AUTO_COMPACT_WINDOW is set to a positive integer, the subagent uses that variable's window and the field has no effect.
  • The value must be below the window the subagent would otherwise inherit, and the field has no effect when you run the whole session as the subagent with --agent or the agent setting.

How to choose

This is my recommendation, not official policy: use a normal subagent when the task is self-contained, you want isolation, or the background can be stated briefly; use a fork when it needs a lot of the existing discussion to be done right, or when you want to try several approaches from the same starting point; and in automation, after upgrading to v2.1.302, measure one round of token usage before deciding whether to set CLAUDE_CODE_FORK_SUBAGENT=0.

Sources: Create custom subagents - Claude Code Docs, Claude Code changelog - Claude Code Docs, Claude Code 2.1.293 to 2.1.302: Settings Worth Enabling Now - DEV Community
Diagram
普通子代理與 fork 子代理的起始內容對照普通子代理從空白開始只拿到任務單,fork 繼承整段對話;兩者的工具呼叫都不進主對話,v2.1.302 起 fork 在更多環境預設開啟Normal Subagent vs Fork: What Each One Starts WithNormal subagentstarts fresh, no conversation historygets: own system prompt, task message,CLAUDE.md, git status, preloaded skillstools narrowed by the usual filtersyou must brief itFork (subagent_type: fork)inherits the whole conversation so farsame system prompt, tools, model, historyexact tool pool of the main sessioninput isolation is dropped on purposeno re-explaining neededBoth: tool calls stay out of your context, only the final result comes backv2.1.302: fork on by default in claude -p, Agent SDK, desktop app, VS Code (as in the terminal)Turn off: CLAUDE_CODE_FORK_SUBAGENT=0 · Start on demand: /subtask TASKclaude mcp serve never offers forksClaude Skill Me · claudeskill-me.com
Feel free to share. Please credit the source.
Ask a Question
Please enter at least 10 characters
Related Articles
Subagents Aren't Smarter Mini-Claudes — They Solve Isolation, Not Capability
advanced · Aug 31
Enabled Auto Mode and Thought You Were Safe? Permission Modes and Sandbox Boundaries Are Two Different Layers — Conflating Them Is How Things Break
advanced · Sep 28
Does skill-creator's Eval System Actually Tell You Anything? Testing Its A/B Comparison and Description Optimizer
reviews · Oct 05
Claude Mods Aren't Just Another Plugin — They Can Draw Panes and Intercept Screen Rendering, Which External Extensions Simply Can't
skill-library · Oct 05
Related News