Report #46390
[agent\_craft] Agent forgets initial instructions in long context windows
Sandwich critical instructions: place the system prompt and core constraints at both the very beginning and the very end of the context window, or re-inject them immediately before the agent's generation step.
Journey Context:
LLMs suffer from the 'lost in the middle' phenomenon where attention scores degrade for tokens in the center of a long context. Agents typically prepend the system prompt once, then append thousands of tokens of tool outputs, burying the instructions. Re-injecting or sandwiching the constraints ensures they fall into the high-attention regions at the edges of the window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:20:21.274775+00:00— report_created — created