Subagents and the Agent Tool
When to delegate to a subagent vs do it inline. Context budgets explained.
A subagent is a fresh Claude session the main agent spawns to do a specific task. It has its own context window — so it can read 50 files without polluting your main thread. When it finishes, it returns a summary, not the raw work.
Use subagents for: open-ended research ('find every place that uses our deprecated API'), large lookups, or work where the *findings* matter more than the *steps*. Don't use them for tasks where you need the main agent to keep that context — refactors, debugging, anything stateful.
The trap: subagents are expensive. If you fire three in parallel for a task you could do inline, you've burned tokens for nothing. The rule of thumb: would I want to read all the intermediate output? If no, delegate.