URGENT: Auto-Compaction Regression — Context Loss Causing Cascading Hallucination Mid-Session
Summary
The recent Claude Code push changed auto-compaction behavior in a way that drops user-stated intent and corrections from the context window. This causes agents to lose scope mid-session, leading to cascading hallucination and significant degradation in work product quality.
The Problem
When auto-compaction fires, the user's actual words — their stated intent, corrections, and constraints — get dropped from context. This causes:
- Cascading hallucination — agents forget what they were asked to do and begin acting on assumptions rather than the user's stated intent
- Repeated re-alignment cycles — users must manually re-inject context ("you keep forgetting context"), burning significant time and breaking flow
- Compounding scope drift — each compaction loses more signal, and agents cannot self-correct because the reference material (the user's actual instructions) is gone
Steps to Reproduce
- Start a Claude Code session with a complex, multi-step task
- Work through enough turns that auto-compaction triggers
- After compaction, observe that the agent has lost awareness of previously stated constraints, corrections, and scope
- Attempt to continue — the agent acts on stale or hallucinated context rather than what was explicitly stated earlier in the conversation
What's Needed (Priority Order)
- Immediate: Provide an opt-out for auto-compaction. Users with their own context management systems need the ability to disable built-in compaction. This is the fastest path to restoring quality for power users.
- Short-term: Revert the compaction behavior to the previous version until the regression is resolved.
- The core UX gap: Auto-compaction must re-inject the user's actual words and stated intent into the post-compaction context — with no duplication. The user's explicit instructions are ground truth; dropping them is a data loss event, not a compression optimization.
Impact
- Power users with calibrated skill files, hooks, and alignment systems are seeing significant quality drops
- Users without calibrated skill files are hit even harder — they have no infrastructure to detect or recover from context loss
- Before this change, Claude Code was easily 10X better than alternatives. This regression materially narrows that gap — not because the model is worse, but because the scaffolding is discarding the most important signal: what the user actually said.
Proposed Solution
Compaction should be lossy on tool output and verbose reasoning, never on user-stated intent, corrections, and constraints. Key principle:
- User's actual words → always preserved through compaction boundaries
- Agent reasoning/tool output → compressible
- User corrections mid-session → highest priority retention (these are the most valuable signal)
I have built in-house compaction systems that preserve intent through context boundaries and would be happy to contribute those patterns. The architecture uses structured extraction of user intent before compaction fires, then re-injection into the post-compaction context window.
Environment
- Claude Code CLI (latest as of 2026-03-18)
- macOS
- Long-running sessions with 20+ turns, multiple file reads, and complex multi-step tasks
---
Filed by Jonathan Haber, Founder @ IX Coach / Next AI Labs (founder@ixcoach.com)
Happy to jump on a call or share compaction architecture in detail.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗