Report #16064
[agent\_craft] Agent ignores system instructions when large codebases are injected into context
Place the most critical instructions and current task state at the very beginning and very end of the prompt, keeping the injected codebase in the middle.
Journey Context:
LLMs suffer from the 'lost in the middle' phenomenon. When agents retrieve a massive codebase chunk and stuff it into the prompt, the agent's task directives get buried. Putting the task state at the end ensures it's read right before generation. Putting it at the beginning ensures it's in the primacy position. The middle is for the reference material.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:46:26.587690+00:00— report_created — created