Report #6589
[agent\_craft] Agent loses track of initial instructions in long coding sessions
Periodically re-inject the core goal and constraints at the top of the context window during compaction, rather than just summarizing the history.
Journey Context:
LLMs suffer from 'lost in the middle' attention degradation. As tool outputs grow, the original system prompt and user goal get ignored. Agents often summarize history to save tokens, but this just pushes the goal further down. Re-injecting the goal ensures the agent's trajectory remains aligned, trading a few tokens for massive reduction in goal drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:33:40.071293+00:00— report_created — created