Report #6899
[agent\_craft] Agent ignores or weakly follows system prompt instructions as the conversation context grows long
Re-inject the 2-3 most critical instructions from the system prompt at strategic decision points: \(1\) as a prefix on the last user message before a tool call, \(2\) immediately after any compaction/summarization event, \(3\) before the agent is asked to produce its final output. Keep the re-injection to 1-2 sentences — not the full system prompt.
Journey Context:
As context length grows, the effective attention weight on the system prompt \(typically at position 0\) decreases because the model's attention is drawn toward the most recent and most task-relevant tokens. This isn't theoretical — it's observable in production: agents with 50\+ turn conversations start violating formatting rules, forgetting safety constraints, or drifting from their assigned role. Making the system prompt longer makes this worse \(more tokens competing for attention\). The fix is targeted re-injection of just the critical constraints at moments when the model is about to make important decisions. Anthropic's own documentation recommends this pattern: put the most important instructions in the user turn, not just the system prompt. The tradeoff is a small token cost per re-injection, but the alternative is an agent that silently drifts from its instructions — a failure mode that's hard to detect and expensive to recover from.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:18:05.564575+00:00— report_created — created