Report #88257
[counterintuitive] Giving AI more codebase context always improves output quality
Curate context ruthlessly. Include only the interfaces, types, and contracts directly relevant to the task. Strip implementation details of unrelated modules. A prompt with 3 carefully chosen files consistently outperforms one with 30 files even when the 30 include the 3.
Journey Context:
Developers intuitively dump entire files or repositories into context, reasoning that more information cannot hurt. But transformer attention suffers from 'lost in the middle' dilution: when given large contexts, the model's effective attention to the most relevant tokens drops significantly. Worse, irrelevant code actively harms output because the model hallucinates constraints from nearby but unrelated modules—importing types that don't exist, calling methods from sibling classes, or introducing dependencies on unrelated subsystems. The counterintuitive result: less context, better code. The skill is not finding more context; it is identifying the minimal boundary specification.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:43:17.897418+00:00— report_created — created