[BUG] Claude Code over-consumes context by not delegating bulky operations to subagents
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code accumulates context unnecessarily by running large Bash commands, multi-file reads, and exploratory searches directly in the main conversation thread instead of delegating to subagents.
Observed behavior:
tsc --noEmit, vue-tsc, ESLint runs executed inline → full output floods the main context even when only the exit code matters
Multi-file exploration (Glob + Read + Grep chains) done inline instead of via Agent(Explore)
MCP round-trips (snapshot → screenshot) repeated mid-implementation rather than batched at STOP points
Result: context hits 80%+ within a single US implementation session, forcing compaction or session loss
Expected behavior:
Any command whose output exceeds ~50 lines should be delegated to a subagent that returns only the relevant summary
Exploration phases (3+ Glob/Read/Grep) should always go through Agent(Explore)
Main context should stay lean throughout the session
Impact: Higher token cost per session than competing tools (e.g. GitHub Copilot), making Claude Code economically unviable for long implementation tasks despite better raw capability.
Suggested fix: Enforce the existing CLAUDE.md rule 17 ("If a Bash/tool call can produce >50 lines → delegate to subagent") more consistently in the model's default behavior.
What Should Happen?
Subagents should run in isolated contexts that don't pollute the main conversation thread. Today, even when I use Agent(Explore) or Agent(general-purpose), their results are injected back into the main context — so if a subagent reads 10 files, those 10 files effectively charge the main context anyway.
The fix would be: subagent results returned as compressed summaries only, never as raw tool output. The subagent does the heavy lifting in its own throwaway context; only the relevant conclusion comes back to the main thread.
That's what makes Copilot's approach cheaper — it calls IDE APIs (get_error, file reads, etc.) through thin integrations that return only the answer, not the full intermediate work.
Error Messages/Logs
Steps to Reproduce
Open a large Vue/TypeScript project with Module Federation
Start a /us implementation session (fetch Azure → observe V4 via MCP → code → validate)
Use Agent(Explore) to inventory CP components before coding
Run npx tsc --noEmit inline after each file edit
Take MCP snapshot + screenshot at each STOP point
Hit a file error → search for a fix across multiple files inline
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
sonnet 4.6
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗