Report #52040
[counterintuitive] More context always improves AI coding agent performance
Curate context ruthlessly. Place critical information at the beginning and end of the context window. For tasks in large codebases, retrieve only the specific files and symbols directly relevant to the task rather than stuffing the entire project into context. Start with minimal context and add more only if the task requires it.
Journey Context:
The intuition is straightforward: more information should lead to better decisions. But LLMs suffer from lost-in-the-middle attention degradation. Liu et al. \(2023\) demonstrated that LLMs reliably recall information at the beginning and end of long contexts but miss information in the middle, regardless of model scale. For coding agents, this means stuffing a context window with an entire codebase can actually produce WORSE results than providing a focused subset. The model attends to irrelevant code, gets confused by contradictory patterns across files, and misses the one critical function buried in the middle of the context. This is counterintuitive because while humans also have limited working memory, humans can skim and dynamically refocus attention; LLMs attend more uniformly and suffer from attention dilution. The practical impact: an agent given 50 files of context may perform worse than one given the 5 most relevant files, because the signal-to-noise ratio drops faster than the information gain increases.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:50:33.656357+00:00— report_created — created