Report #24848
[counterintuitive] Including more code and files in the prompt always improves agent accuracy
Curate context aggressively. Use map-reduce or targeted retrieval to include only directly relevant files, keeping the prompt under the model's effective context utilization limit.
Journey Context:
Agents often dump entire repositories or massive file trees into the context window to be safe. However, LLMs suffer from the needle in a haystack problem. Performance degrades significantly as irrelevant context increases, leading to instruction forgetting, higher API costs, and increased latency. Less, highly relevant context consistently outperforms massive, noisy context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:06:47.582285+00:00— report_created — created