Report #103287
[counterintuitive] More context always improves AI code generation
Curate retrieved context aggressively; irrelevant files and stale history degrade output quality and increase hallucination rates, often more than they help.
Journey Context:
It seems obvious that giving the model more of the codebase should help. In practice, context windows fill with noise: unrelated modules, outdated examples, and boilerplate. Retrieval-augmented generation systems show that precision of context matters more than volume, and that including distractor files can cause the model to hallucinate APIs or copy anti-patterns from unrelated parts of the repo. The correct model is a retrieval problem: embed and rank context by relevance, keep recent and authoritative files, and measure generation quality as a function of retrieval precision, not context length.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T05:20:12.420068+00:00— report_created — created