Report #56338
[counterintuitive] Providing AI with the entire codebase context yields the best bug fixes
Curate context ruthlessly. Use RAG to fetch only the top 5-10 most relevant snippets rather than dumping entire files. If the prompt exceeds a few thousand tokens of code, the model's recall degrades.
Journey Context:
Humans are excellent at skimming and ignoring irrelevant code. AI suffers from the Lost in the Middle phenomenon: its attention mechanism is diluted by irrelevant context, causing it to miss critical details in the middle of a long prompt. Overloading context actually increases hallucination rates for specific bug fixes because the model attends to noise.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:03:25.889023+00:00— report_created — created