AI Coding Agents Struggle with Context Management in Large Codebases

The Execution Bottleneck Isn't the Problem
Observations from real codebase usage show AI coding agents consistently spend significant time on discovery rather than execution. Each time an agent tackles a new task, it makes 15-20 tool calls for orientation activities including:
- Grepping for routes
- Reading middleware
- Checking types
By the time the agent starts writing code, it has already consumed a substantial portion of its context window on discovery work.
Evidence from Simplified Approaches
Vercel demonstrated this problem from the opposite direction by removing 80% of tools from their agent and giving it bash access instead. This approach resulted in 100% accuracy, suggesting execution capability isn't the limiting factor.
Similarly, Pi (the minimal coding agent) proves the same point with just 4 tools and a system prompt containing fewer than 1,000 tokens.
The Real Challenge: Context Management
If execution is effectively solved, the actual difficult problem becomes context management. Several factors contribute to this challenge:
- Large codebases don't fit within any current context window
- Long tasks accumulate tool outputs that push early reasoning out of the attention window
- Dynamic environments change between sessions
- The "Lost in the Middle" research shows models reason best at the start of their context window — exactly when agents are still searching
The author has published a more detailed analysis exploring these issues and their implications for AI coding agent development.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Infomaniak Transfers Majority Voting Rights to Foundation to Lock in Swiss Cloud Independence
Infomaniak secured its long-term independence by transferring majority voting rights to a Swiss public-interest foundation. No takeover possible without foundation approval.

Claude Platform on AWS Now GA: Native Anthropic Experience via IAM, CloudTrail, and AWS Billing
AWS announced GA of Claude Platform on AWS, giving developers direct access to Anthropic's native Claude experience through existing AWS accounts with IAM auth, AWS billing, and CloudTrail logging — but customer data is processed outside AWS security boundary.

OpenClaw 2026.6.6: OpenRouter Onboarding, Mobile Control, Stability Fixes
OpenClaw 2026.6.6 adds first-class OpenRouter onboarding, improved iPad/iPhone control surfaces, and numerous stability fixes in codex sandbox, MCP, browser, and channel replies.

MCP Works with Local Models Too — Server Ecosystem Maturing Fast
MCP isn't Claude-only. Local models with function calling work fine. Open Web UI now has basic MCP client. 13B+ models handle multi-step tools best.