Report #7131
[agent\_craft] Critical import paths or file locations are ignored when placed in the middle of a long file list or context window
Apply 'U-shaped' context placement: place the most critical file paths, imports, and target locations at the very beginning \(position 0-10%\) or very end \(position 90-100%\) of the prompt; never bury them in the middle of a directory tree listing
Journey Context:
Research shows LLMs suffer from 'Lost in the Middle' attention degradation, where information in the middle of long contexts is effectively ignored. For coding agents, this means a file path buried in a directory listing of 50 files will be hallucinated or ignored. The fix leverages the strong retrieval at the beginning \(primacy\) and end \(recency\) of context. Tradeoff: requires reordering logic but prevents critical file omission errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:50:41.360017+00:00— report_created — created