← Back to glossary
+Suggest a term
Concept·Agents & Automation·Added 16 days ago

Subagent forking

Also known as: agent forking, fork subagent, subagent fork

A pattern where a parent agent spawns a child agent (a fork) that inherits the full conversation history and prompt cache at the moment of spawning. The child runs independently, letting multiple lines of work proceed from the same shared starting point.

Subagent forking is a coordination pattern where a running agent creates a copy of itself — a forked subagent — that inherits the full conversation state and cached context at the moment of the fork. The child agent then proceeds independently, taking a separate action path without affecting the parent. It is conceptually similar to a fork() call in Unix systems programming (where a running process creates a copy of itself to handle a task in parallel), applied to AI agent sessions.

Anthropic shipped subagent forking as a default behavior in Claude Code in mid-2026. When a subagent is spawned with the fork type, it inherits the parent's full conversation and prompt cache, which has two practical benefits: the child agent starts with full context rather than a blank state, and the cache hit reduces the token cost of spinning up the child. Non-teammate agent spawns in interactive sessions now run in the background by default, meaning the parent can keep working while children run.

The pattern matters most in workflows where a task branches into several independent subtasks that all need the same background context. Without forking, you either send each child agent a long context string (expensive and slow) or accept that child agents start without context (fragile). Forking solves both problems, but it introduces its own complexity: you need a way to collect and reconcile results from multiple independently running agents, and the parent needs to track which forks completed what.

This definition is AI-generated and refreshed weekly. It may contain inaccuracies. Use your own judgment, especially for production decisions.
Related terms
SubagentsParallel agentsAgent stateAgent checkpointKV cache