Report #92279
[counterintuitive] Providing maximum file context to LLMs for bug fixing or feature addition
Provide only directly relevant code and specific error messages; use targeted retrieval mechanisms rather than dumping entire files or repositories into the context window.
Journey Context:
The common intuition is that more context equals better answers, assuming the LLM acts like a perfect database. In reality, LLMs suffer from the 'lost in the middle' phenomenon: they attend strongly to the beginning and end of the prompt but ignore the middle. Overloading context with irrelevant boilerplate dilutes the attention mechanism, causing the model to hallucinate or miss the actual bug. Humans filter noise naturally; AI fails catastrophically when signal-to-noise ratio drops. Less, highly targeted context yields more accurate code generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:28:50.702338+00:00— report_created — created