Report #21477
[agent\_craft] Agent loses track of initial instructions or early task state after long interactions \(Context Rot\)
Periodically re-inject the primary goal and constraints at the top or bottom of the context window, or use a dynamically updated scratchpad state document that is always kept near the prompt boundaries.
Journey Context:
LLMs suffer from the lost-in-the-middle phenomenon where attention to early tokens degrades as context grows. Simply appending more context exacerbates this drift. Re-injecting or maintaining a state document near the system prompt ensures the agent doesn't forget its original objective, trading a few tokens for massive gains in goal persistence.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:27:44.389032+00:00— report_created — created