liveBook · Manning

Subagent

As explained in Designing AI Agents

An agent assigned a bounded portion of a larger task or delegated plan.

A subagent is an agent assigned a bounded part of a larger task. A primary agent can delegate execution while retaining responsibility for the shared goal and final integration. This can provide fresh context or parallel work, but introduces coordination and debugging costs. section 2.4.3 section 8.5

In hierarchical delegation, the manager owns decomposition, dependencies, plan revision, acceptance, and the stop decision. Workers own local execution, declared writes, and evidence for their deliverables. Unlike fan-out/gather, where a coordinator merges comparable independent results, a hierarchy can manage dependent tasks and revise the plan as evidence changes. section 8.5

A delegation boundary needs a contract in both directions:

  • Send the task, relevant goal and constraints, interfaces, dependencies, tool and write boundaries, expected artifact, and acceptance checks. section 8.5.1
  • Return evidence and flag invalid assumptions, conflicts, missing dependencies, infeasible requests, or findings that change the plan. The manager reopens affected decisions; an independent reviewer or accountable human adjudicates challenges to the overall frame. section 8.5.1
  • Enforce tool permissions in the runtime, not just in the role prompt. Instructions describe responsibility; configured access bounds action. section 8.5.2
Figure 8.4 Hierarchical Delegation gives the manager ownership of the evolving plan and integration, while workers own bounded execution and return evidence or exceptions.

The diagram separates manager-owned planning and integration from worker-owned execution and reporting. section 8.5

Context isolation can keep noisy search, test, or log output out of the main conversation. In Claude Code, a subagent receives a fresh context rather than the parent’s conversation and accumulated tool results; project memory normally still loads, although the built-in Explore and Plan agents skip it. Isolation also means discoveries do not automatically reach the manager or sibling agents: the return path must carry what they need. section 3.1.3 section 8.5

Delegating a coding task

A lead agent can commission requirements research, then implementation, then verification. If a worker finds an invalid assumption, it reports the affected decision and evidence so the lead can revise the plan. In Claude Code, the main dialog can choose a subagent configuration and integrate its result; custom configurations can specify role instructions, a model, and tool access. section 8.5 section 8.5.1 section 8.5.2

Add subagents when a measured single-agent limitation outweighs delegation overhead. Check task success, latency, token cost, and debugging effort; for a hierarchy, also track blocked tasks, plan revisions, returned invalid assumptions, and integration rework. Debugging may require reconstructing message flow, state ownership, and the order of partial results. section 2.4.3 section 8.5

How Designing AI Agents covers it

How deep it goes
Specifies handoff fields, exception reporting, runtime boundaries, manager responsibilities, and operational metrics.
Examples
Illustrates dependent research, implementation, and verification tasks, and a bug fix that isolates search and test output.
What you can do after
Evaluate when delegation benefits outweigh coordination costs using task success, latency, token cost, and debugging effort.
How it connects
Connects context isolation, hierarchical delegation, fan-out/gather, and runtime tool permissions.

Also explained in

Compare how 7 books explain subagent →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Designing AI Agents. The section links point to the parts of the book it draws on.