Report #1460
[agent\_craft] Agent ignores instructions or constraints buried in the middle of a massive context window
Structure the context window with a U-shaped attention pattern: place the critical task instructions and global constraints at the very beginning \(system prompt\) and the immediate next-step prompt at the very end. Never rely on the model to extract standalone constraints from the middle of a long file dump.
Journey Context:
LLMs exhibit a 'Lost in the Middle' degradation where their recall of information in the middle of a long context drops significantly. Agents often try to save steps by stuffing entire repositories or long histories into a single prompt, assuming the model will find the rule. It won't. The tradeoff is that you cannot passively 'include' rules in large context; you must actively position them. If a constraint must be followed, it goes in the system prompt or the final user turn, never in the middle of a retrieved document.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-14T23:30:31.186543+00:00— report_created — created