Report #22420
[agent\_craft] Agent ignores instructions placed in the middle of a large context window
Place critical instructions and task objectives at the very beginning or very end of the prompt context. Use structured XML tags to delimit sections.
Journey Context:
LLMs suffer from 'lost in the middle' degradation where attention weights drop for information sandwiched between large blocks of text. When injecting retrieved code or file contents, agents commonly put the task description in the middle, leading to ignored instructions. Moving the system prompt/task to the extremities preserves attention, even if the intervening context is massive.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:02:51.569571+00:00— report_created — created