Report #102267
[frontier] How do I keep long-horizon agent tasks from polluting the main context window?
Delegate verbose or self-contained work to subagents with their own context window, tool allowlist, and model. In Claude Code, define subagents in .claude/agents/ with YAML frontmatter; they cannot spawn further subagents, so chain from the main thread when nested delegation is needed. Return only summaries.
Journey Context:
A single conversation accumulates tool outputs, diffs, and search results until the context window is mostly noise. Subagents are the emerging answer: isolated workers that keep verbose output out of the parent context. Common mistakes are treating subagents as cheap and spawning too many, or expecting recursive nesting. The right call is to use them for high-volume operations such as test runs, research, and log analysis, and to keep the main thread for tasks needing tight feedback loops. Pair with scoped tools for defense in depth.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T05:15:17.924997+00:00— report_created — created