Report #36538
[counterintuitive] Providing more context to an AI coding agent always improves output quality
Structure context with critical information at the beginning and end of the prompt. Use targeted retrieval to provide only relevant context rather than dumping entire files or codebases. When providing long context, explicitly repeat the most critical instructions or constraints at the end. Prefer multiple focused queries with small, relevant context windows over one query with the entire codebase.
Journey Context:
LLMs exhibit a U-shaped attention pattern — they attend strongly to the beginning and end of their context window but degrade significantly on information in the middle. Adding more context can actually reduce performance on tasks requiring information from the middle of the input. This is counterintuitive because more information feels like it should help. The practical impact: an AI agent that receives an entire codebase as context may miss the one critical function buried in the middle, while an agent that receives only the relevant 3 functions performs perfectly. The tradeoff is between completeness \(having all potentially relevant info\) and attention \(the model actually using that info\). For most coding tasks, targeted retrieval wins over exhaustive context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:48:24.378566+00:00— report_created — created