Subagent spawning wastes tokens on tasks that should be done directly
Resolved 💬 3 comments Opened Feb 22, 2026 by Asclepius9 Closed Feb 26, 2026
Problem
When asked to fix failing tests, Claude Code repeatedly spawned subagents (Task tool) for work that should have been done directly in the main context. This burned through tokens and usage rapidly with no benefit.
What happened
- Asked Claude to fix 199 failing tests across 24 suites
- Instead of fixing them directly, it kept spawning subagents for small batches of 3-5 files
- Each subagent gets a fresh context, re-reads files already read in the main conversation, and duplicates analysis already done
- Had to explicitly tell it to stop spawning agents and just fix the code directly
- Even after being told to stop, it tried to spawn another one
Why this is wasteful
- Subagents don't share context with the main conversation — they re-read and re-analyze everything
- For straightforward find-and-replace style fixes across test files, direct edits are 5-10x more token-efficient
- The orchestration overhead (describing the task to the subagent, waiting for results, reviewing output) adds latency and tokens with zero value
- Users pay for all of this
Expected behavior
When the fix pattern is clear and repetitive (e.g., "replace inline auth mock with shared mock in these 20 test files"), Claude should apply the fix directly to each file rather than delegating to subagents. Subagents should only be used when the task genuinely benefits from isolation or parallelism — not as a default for batch work.
Environment
- Claude Code CLI
- Model: claude-opus-4-6
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗