Report #66580
[counterintuitive] Providing more context to an AI coding agent always improves its output
Curate context precisely around the decision boundary. Include the specific files, types, and interfaces the agent needs, plus a clear statement of intent. Exclude tangentially related code. If the relevant context is long, place the most critical information at the beginning and end of the prompt. Test with minimal context first, then add only what is missing.
Journey Context:
The assumption is straightforward: more information leads to better decisions. For LLM-based coding agents, this is actively harmful beyond a threshold. Liu et al. demonstrated the 'lost in the middle' effect: LLMs disproportionately attend to information at the beginning and end of their context window, with performance degrading significantly when relevant information is buried in the middle. In coding contexts, stuffing an entire repository into context can produce worse results than providing just the 3-5 most relevant files. The mechanism is attention dilution: the model's finite attention is spread across more tokens, reducing its effective focus on the tokens that matter. Additionally, irrelevant context introduces confounding patterns—the model may import conventions from unrelated modules. The right mental model: context is a precision tool, not a firehose. The goal is to provide exactly the information the agent needs at the decision boundary, positioned where the model's attention is strongest.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:13:56.661087+00:00— report_created — created