Claude Code v2.1.212 shipped July 17, 2026 at 00:26 UTC with 48 changes. The headline: /fork now creates a true background session with its own row in the claude agents view -- not an in-session subagent. The in-session behavior is renamed /subtask. Two new 200-count session caps block runaway loops. Here is what changed and how to use it.
I have been running multi-agent workflows in Claude Code for months. Today's v2.1.212 release is the clearest API surface change since nested sub-agents landed in June. The /fork rename is not just cosmetic -- the command does something fundamentally different now, and builders who were using it for in-session delegation need to switch to /subtask starting today.
What shipped in Claude Code v2.1.212?
Claude Code v2.1.212 released at 00:26 UTC on July 17, 2026 with 48 changes. The four changes that matter for multi-agent builders: /fork now always creates a background session (in-session delegation moved to /subtask), a per-session WebSearch cap of 200 was added, a per-session subagent spawn cap of 200 was added, and MCP tool calls running longer than 2 minutes auto-move to background to keep sessions responsive.
The full release notes are at github.com/anthropics/claude-code/releases/tag/v2.1.212. To update: npm update -g @anthropic-ai/claude-code or update through your package manager.
Two smaller changes round out the release: a claude auto-mode reset subcommand that restores default auto-mode config, and a /resume picker in the agent view that recovers deleted sessions as new background sessions. A worktree symlink bug that could write files outside the repository was also fixed -- worth updating for that alone if you use worktree isolation in agent workflows.
What does /fork do now -- and what changed?
/fork copies your current conversation -- full history, system prompts, tools, and model -- into a new background session that gets its own row in the claude agents panel. You stay in your main session and keep working. The fork runs independently in the background and surfaces results when it finishes. If the session has no title, /fork names the copy after your prompt text so you can identify it in the agent list.
Before v2.1.212, /fork launched what Anthropic called a "fork subagent" -- an experimental in-session delegate that inherited context but ran as a child of the current session. That feature was gated behind the CLAUDE_CODE_FORK_SUBAGENT=1 environment variable. In v2.1.212, the behavior has been graduated and split: /fork is now always a background session, and the old in-session behavior got its own permanent name: /subtask.
The cache economics matter here. Because a fork copies the full conversation, its first API call reuses the parent prompt cache. For long sessions with large context, that means the fork starts cheaply -- no need to retransmit all the context at full price. According to Build This Now's fork mechanics guide, parallel child forks sharing a parent cache prefix can reduce input token costs by up to 90% for children 2-N. The second fork launched from the same parent session costs a fraction of what a fresh subagent with a manually written context prompt would cost.
One hard constraint: fork agents cannot themselves call /fork. Recursive forking is blocked. If you need deeper delegation inside a fork, use /subtask inside the fork session. Anthropic prevents exponential session proliferation this way.
What is /subtask? The renamed in-session delegation tool
/subtask is the new name for the old /fork behavior. It spawns an in-session subagent that handles a discrete task and returns results synchronously to the main session. /subtask agents get a fresh context window -- they receive only the delegation string you write, not your conversation history. That isolation is intentional: when you can fully describe a task in a prompt, fresh context is cheaper and faster than inheriting megabytes of history.
/subtask agents support nesting. Claude Code has allowed up to 5 levels of nested subagent chains since v2.1.172 shipped June 10, 2026 (source: GitHub releases). So an orchestrator can /subtask planners, planners can /subtask workers, workers can /subtask verifiers -- the tree goes 5 levels deep. /fork does not support this nesting. The tradeoff is context: every level of /subtask nesting writes its own context from scratch; every fork inherits everything but cannot go deeper.
If you had automation scripts using /fork for in-session delegation before v2.1.212, update them to /subtask. The mechanics are identical -- only the name changed.
When should you use /fork vs /subtask?
Use /fork when the task needs full context and you want it to run in the background while you keep working. Use /subtask when you have a well-scoped task you can completely describe in a delegation string and where fresh context is an asset rather than a liability. The practical heuristic: if you would have to write a long preamble to bring a new agent up to speed, fork. If you can describe the task in two sentences, subtask.
Here is how I use both in the same session:
- /fork: background work that needs full project knowledge. Example: while I am writing a new API endpoint, I fork a session to run a security audit across the existing codebase. The fork knows all the files I have read, all the context Claude has, all the decisions we have made. It runs in the background and I check on it in the agent view later.
- /subtask: discrete, describable tasks. Example: I extract a function and immediately /subtask to write tests for it. The delegation string: "Write pytest tests for this function: [paste function]. Cover edge cases for empty input, malformed data, and timeout. Return just the test file." Context isolation means the subtask does not get confused by everything else in the session.
The cost calculus: if you are running three parallel workers on the same codebase, three /forks will be cheaper than three /subtasks because the forks share a cache prefix. If you are running three unrelated isolated tasks, /subtask wins because there is no benefit to inheriting context you will not use.
Want the templates from this tutorial?
I share every workflow, prompt, and template inside the free AI Creator Hub on Skool. 500+ builders sharing what actually works.
Join Free on Skool
Why did Anthropic add the 200-count session caps?
Two new env vars in v2.1.212 set per-session limits on WebSearch calls and subagent spawns, both defaulting to 200. The variables are CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION and CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION. When either cap is hit, the session stops that class of tool call. Running /clear resets the subagent spawn budget without ending the session.
The reason: runaway loops are real and expensive. Multi-agent workflows with retry logic, search-until-found patterns, or recursion bugs can fire hundreds of WebSearch calls or spawn dozens of unintended subagents before a human notices. At API rates, 200+ unintended searches in a loop can be a meaningful cost hit. The caps give you a circuit breaker with a generous default -- 200 is more than any legitimate session I have run in practice -- while still catching the runaway cases.
Both caps apply session-wide. A /fork and its parent share the same session counters (since a fork is created within the same session context). If you hit a cap and need more room, /clear resets the subagent counter. For the WebSearch cap, you need to either /clear or adjust the env var.
How to tune the session caps for your workflow
Three new env vars from v2.1.212 give you per-session control over behaviors that previously had no ceiling. Set them in your shell profile or per-project .env for persistent configuration:
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION -- default 200. Raise this for research pipelines. I run a daily research agent that fires 18-20 searches; 200 gives plenty of room with no cap anxiety. Lower it if you want Claude to work locally without reaching for search.
CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION -- default 200. Raise for large orchestration workflows. The /clear trick is worth using here: if you run batched work in one session -- reviewing 50 files in groups of 10 -- you can /clear between batches to reset the counter without starting a new session. You lose conversation history with /clear, so only do this between natural work units.
CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS -- default 120000 (2 minutes). MCP tool calls that exceed this threshold automatically move to background so the session stays interactive. The tool call completes asynchronously and results surface when done. Set to 0 to disable auto-background entirely if you want synchronous behavior for all MCP calls regardless of duration.
For most solo workflows, the defaults are fine. For production orchestration pipelines -- the kind that fan out dozens of agents or run extended research sessions -- raise the spawn cap to 500+ and the WebSearch cap to match your actual search volume. Track your usage in /usage to calibrate.
The /resume session picker -- recovering deleted sessions
/resume now opens a picker of all past sessions in the agent view, including sessions you have deleted from the active list. You can select any session and resume it as a new background session. This sounds minor but it fills a real gap: if you dismissed a research session by accident or cleared an agent from the list before it finished, you can now recover it without starting over.
The recovered session picks up from where it left off, running as a background session with its own row in the claude agents view. This is the same background session infrastructure that /fork uses -- the session branching system built in v2.1.212 is doing double duty here, enabling both forward branching (/fork) and backward recovery (/resume).
FAQ
Does /fork count against my session's subagent spawn limit?
Yes. Every /fork increments the session's subagent spawn counter, which defaults to 200 via CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION. /subtask calls count the same way. Run /clear to reset the counter mid-session without ending the session. The reset lets you do batched work in long sessions without hitting the cap from accumulated delegation calls.
Can a fork agent itself use /fork?
No. Claude Code blocks recursive /fork calls in v2.1.212. A fork agent can use /subtask to spawn in-session subagents inside the fork session, and /subtask nesting supports up to 5 levels deep. But no fork can launch a second-level background fork. This prevents exponential session multiplication -- design orchestration trees with /subtask for depth, /fork for breadth from the top session only.
Is /subtask the same thing as the old /fork?
Yes, functionally identical. /subtask is the renamed version of the old experimental /fork in-session subagent behavior (which required CLAUDE_CODE_FORK_SUBAGENT=1 to enable). The mechanics are unchanged: fresh context window, delegation string as sole briefing, synchronous result return to the parent session. Switch all old /fork calls in your scripts to /subtask -- nothing else needs to change.
What happens when I hit the WebSearch session cap?
When your session reaches the CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION limit (default 200), Claude Code stops issuing WebSearch tool calls for that session. Unlike the subagent spawn cap, the WebSearch counter does not reset with /clear -- you need to either start a new session or raise the env var value and restart. For research-heavy workflows, set the cap higher in your shell config before hitting the limit.
Want the templates from this tutorial?
I share every workflow, prompt, and template inside the free AI Creator Hub on Skool. 500+ builders sharing what actually works.
Join Free on Skool