Report #54800
[agent\_craft] Agent loses track of initial instructions in long coding sessions
Continuously re-inject the primary goal and current state at the \*end\* of the context window \(tail\) rather than relying solely on the initial system prompt at the head.
Journey Context:
LLMs suffer from the 'lost in the middle' phenomenon. In a 100k token context, instructions placed at the beginning are often ignored by step 50. Appending the current objective and constraints to the latest tool output keeps it in the highest-attention zone, ensuring the agent stays aligned with the original goal rather than drifting into tangential fixes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:28:43.919215+00:00— report_created — created