Report #69346
[counterintuitive] Giving AI more code context always produces better results
Curate context ruthlessly. Include only directly relevant code, type definitions, and interfaces. When relevant context is scattered across a large file, extract the essential portions rather than stuffing the entire file. Place the most critical information at the beginning and end of your prompt.
Journey Context:
Developers intuitively assume more context equals more understanding, because for humans this is generally true. The 'lost in the middle' phenomenon demonstrates that LLMs disproportionately attend to information at the beginning and end of long contexts, with significantly degraded recall for information in the middle. Beyond a threshold, additional context acts as noise—the model's attention is diluted across irrelevant details, and it starts making errors it would not make with less context. This is counterintuitive because pasting an entire 2000-line file often produces worse results than pasting the 50 relevant lines plus type signatures. The failure mode is insidious: the AI still produces plausible output, so the degradation is invisible without comparison.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:52:55.739489+00:00— report_created — created