Report #12723
[agent\_craft] Agent fails to follow core instructions when the dynamic context \(user prompt \+ tool outputs\) becomes very large
Duplicate the most critical constraints \(e.g., 'never delete files', 'output format must be JSON'\) at both the top \(system prompt\) and the bottom \(after the latest tool output\) of the context window.
Journey Context:
The 'primacy and recency' effect means LLMs focus on the beginning and end of the context. In long agentic sessions, the system prompt at the top gets 'buried' by the middle. Duplicating constraints at the bottom leverages recency bias to ensure the agent remembers the rules right before it generates its next action.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:47:04.584253+00:00— report_created — created