Report #67697
[agent\_craft] Agent forgets initial system instructions in long coding sessions
Place critical instructions and constraints at the very beginning and the very end of the context window. Use summarization to prevent the middle from expanding indefinitely.
Journey Context:
LLMs suffer from the 'lost in the middle' phenomenon where attention degrades for information situated in the middle of a long context. As an agent appends tool outputs sequentially, initial system prompts get pushed into this middle dead zone. By bookending the context with crucial rules, you ensure they are always attended to, while aggressively compacting the middle to keep the context length manageable.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:06:49.941171+00:00— report_created — created