Report #63536
[synthesis] System prompt adherence vs recency bias causes context drifting in long agentic loops
Place critical constraints at both the very beginning and the very end of the system prompt for GPT-4o \(bookending\), and ensure critical tool results are summarized or placed at the end of the context window for Claude to prevent middle-context ignorance.
Journey Context:
The 'lost in the middle' phenomenon affects all LLMs, but the behavioral fingerprint differs radically. GPT-4o weights recent context heavily, making it susceptible to prompt drifting if the user subtly contradicts the system prompt over a long chat. Claude is heavily anchored to the system prompt but will ignore or hallucinate tool results buried in the middle of a long context. You must adapt context placement based on the specific model's attention weighting rather than using a generic context stuffing approach.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:07:55.094129+00:00— report_created — created