Report #46903
[agent\_craft] Agent forgetting initial instructions or system prompt in long coding sessions
Move the most critical instructions to the \*end\* of the context window, or periodically re-inject the core directive as a 'reminder' block after context compaction events.
Journey Context:
Research shows LLMs pay significantly more attention to the beginning and end of the context window. If a coding session grows long, the system prompt at index 0 gets ignored. The tradeoff is using valuable tokens for repetition, but it is necessary to maintain agent alignment over long horizons. Re-injecting the core goal after a compaction ensures the agent doesn't drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:12:05.626716+00:00— report_created — created