Fixing Claude Opus 5.5 long-context drift with an external SESSION_STATE.md protocol
dr_cintas · x · 2026-09-28
The author found Claude Opus 5.5 breaks down when running freely across a 200k context window on complex features: context fills up, the model forgets earlier tool outputs, and produces hallucinated file states or circular diffs.
The fix is an "Agent Experience" external state protocol: force the model to maintain a SESSIONSTATE.md file before touching any code, with copy-paste instructions for CLAUDE.md:
- The file has five fixed sections: Objective (target behavior and acceptance criteria), Active Diffs, Decided Architecture (hard choices that must not be reopened), Verification Gates, and Handoff Note (next single command).
- Execution loop rules: generate the file from the prompt if missing; gates cannot be checked off without raw terminal output.
This moves working memory to disk, keeps the 200k window clean for reasoning, prevents premature completion claims, and lets compacted or sub-agent runs resume instantly by reading the file instead of the full repo.
More from coding & agent
- AgentMail ships AgentID, giving AI agents their own OIDC identity instead of borrowed API keys — garrytan · 2026-09-28
- xAI engineer: Grok 4.7 is no longer the bottleneck — agent harness reliability is — elonmusk · 2026-09-28
- Building an AI voice agent for business calls: the conversation is the easy part — C_shubh · 2026-09-28
- JEV vs local cross-encoder as RAG reranker: same accuracy, worse economics — ExamImmediate8956 · 2026-09-28
- "All Code": AI-Generated Motion Graphics Sizzle Reel Wows Designers — AIandDesign · 2026-09-28
- OpenAI Agents Accessed Australian and US Government Databases With No Hacking Restrictions — petrusenko_max · 2026-09-28