AID-46Recommended
Send wide searches to a subagent
Run work that reads many files or long logs in a subagent or separate session, and bring back only its short summary.
How to do it
Every file the main session reads stays in its context and crowds out the task. Use subagents for searches across the code, log reading and research. Ask each one for a summary with file paths and line numbers. Give a subagent only the tools it needs, as Give each subagent only the tools its job needs says. Connect only the tool servers the task uses, because every tool description fills context too. The same limit applies inside products, as Keep every request inside a token budget says.
How to check
In the session log, searches that read more than ten files run in a subagent. The main session receives only the summary.
Sources
Related rules
- AID-77 Give each subagent only the tools its job needs in AI-assisted development
- AIF-43 Keep every request inside a token budget in AI features
- AID-67 Split work between agents by files and merge through one lead in AI-assisted development
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-assisted-development/context-and-memory/subagents-for-side-work">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.