Skip to content
Multi-agent orchestration

07.03 · Concept

Subagents and context isolation

Use a subagent to keep a noisy job out of the main context.

A subagent is a separate worker invocation for a bounded, noisy task, returning a compact result instead of dragging every intermediate step into the main context. It is useful for searches, log inspection, codebase exploration, and other tool-heavy work where isolation protects the main reasoning thread.

What this lesson answers

  • when should I use a subagent
  • how do subagents reduce context pollution
  • how to prompt a subagent safely

Notes

A subagent is a separate agent invocation used as a worker for a bounded task. Instead of letting the main agent read every file, inspect every log line, or explore every dead end, the main agent delegates that noisy job to a subagent and receives back a compact result. The important idea is not “more agents means smarter”; it is “separate scratch space protects the main reasoning thread.”

The mental model is like spawning a helper process with its own working directory and stdout contract. The helper can search, try things, collect evidence, and make mistakes without filling the parent…

Common questions

What is a subagent in agent orchestration?
A subagent is a separate agent run used to handle a specific delegated task. The main agent gives it inputs, constraints, and an expected output format, then receives a concise result. The point is not to make the system magically smarter, but to keep messy investigation out of the main context.
When should noisy work be delegated to a subagent?
Delegate when a task is likely to produce lots of intermediate detail that the main agent does not need to retain. Typical cases include reading many files, scanning logs, exploring a codebase, checking documents, or following uncertain paths. The main agent should only get the useful findings and supporting evidence.
Can a subagent result be trusted directly?
No. Context isolation reduces noise, but it does not make the subagent correct. Treat its response as a summarised artefact that may contain mistakes, omissions, or weak evidence. Important claims should be checked by the main agent or verified through tools before they influence a final decision.