Report #14860
[agent\_craft] Agent ignores critical instructions or file contents placed in the middle of a massive context window
Structure the context window using a 'sandwich' layout: put the primary task/instructions and the most critical current state at the very beginning and the very end of the prompt, using intermediate context \(like read-only reference files\) in the middle.
Journey Context:
Research shows LLMs suffer from the 'lost in the middle' phenomenon, where they reliably recall information at the start and end of the context, but ignore the middle. Agents that blindly append read-file outputs between the system prompt and the user prompt bury their actual instructions. By moving the immediate goal/action plan to the end of the prompt, the agent focuses on the right task.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:39:21.725750+00:00— report_created — created