Report #47281
[agent\_craft] Agent forgets initial system instructions or task constraints in long coding sessions
Periodically inject a 'reminder block' of critical constraints into the latest user turn, rather than relying solely on the system prompt at the top of a massive context.
Journey Context:
Attention mechanisms in LLMs suffer from the 'lost in the middle' phenomenon. A 100k context window with a system prompt at index 0 and 90k tokens of tool logs means the model literally pays less attention to the original rules. While putting everything in the system prompt is standard, dynamically re-injecting the core constraints \(e.g., 'Remember: use Python 3.9, no external deps'\) into the most recent message ensures high attention weight. The tradeoff is slight token duplication, but it prevents constraint drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:50:40.158513+00:00— report_created — created