Master Claude Chat, Cowork, Code

← Master Claude Chat, Cowork, Code14 okt · 53 min

19. Preventing Context Pollution with Subagents (Delegating Heavy Lifting)

19. Preventing Context Pollution with Subagents (Delegating Heavy Lifting)14 okt53 min

<p>In Episode 19 of <strong>Beyond Prompting</strong>, author Sho Shimoda explores how to manage complex, search-heavy engineering tasks without cluttering your main conversation window using <strong>Subagents</strong>. When an agent reads dozens of files, runs multiple searches, and pursues false leads, that intermediate noise dilutes the main conversation&#39;s working memory. In this episode, we break down:</p><ul><ul><li><strong>Solving Context Pollution:</strong> Why the primary benefit of delegation is keeping your main conversation&#39;s context clean by running heavy investigations in isolated, disposable subagent context windows that return only concise summaries.</li></ul><ul><li><strong>The Three Justifications for Subagents:</strong> Identifying when to delegate based on <strong>context economy</strong> (high byproduct-to-conclusion ratio), <strong>specialized roles</strong> (such as a read-only security or schema reviewer), and <strong>true task parallelism</strong>.</li></ul><ul><li><strong>Defining Subagents (.claude/agents/):</strong> Structuring custom subagents in Markdown with YAML frontmatter, restricting tool access (e.g. limiting to Read, Grep, and Glob), and why writing a clear description field is the entire invocation mechanism.</li></ul><ul><li><strong>What Crosses the Boundary:</strong> Understanding what a subagent inherits (system prompt, CLAUDE.md, git snapshot, brief) versus what stays isolated (conversation history and intermediate tool outputs), and using agent IDs to resume subagents via SendMessage.</li></ul><ul><li><strong>Forks, Depth, and Concurrency:</strong> Distinguishing standard subagents from forks (/subtask), navigating spawn depth limits (up to 3 layers), concurrency caps (up to 20 subagents), and knowing when <em>not</em> to delegate.</li></ul></ul><p><em>(Note for listeners: This episode covers Chapter 19 of Sho Shimoda&#39;s book </em><a href="https://www.amazon.com/dp/B0HJKBWKVQ" target="_blank" rel="noopener noreferer"><strong>RUNNING CLAUDE: The Operator’s Guide to Chat, Cowork and Claude Code</strong></a><em>, available on Amazon as the successor book to </em><strong>Master Claude: Chat, Cowork and Code</strong><em>).</em></p>