When to compact a Claude Code session with a 1M window, and where the unanswered messages come from
At what context size to set auto-compact in Claude Code (Opus 5.5, 1M window), and what is known about hung requests, where the message has to be sent a second time.
With no window set, Claude Code compacts sessions with a 1M window only at about 967K tokens c1. The author's compactions at ~500K are most likely idle compaction: Claude Code summarises a conversation above 200K before the one-hour cache expires, and the setting idleCompaction: false turns that off c2. This is a hypothesis; the compaction metadata in the transcripts does not tell this case apart.
There is no single right threshold; the sources differ. A measurement over 287 thousand calls points to a range of 200–600K: below ~200K frequent compactions eat working time, above ~600K no gain is visible c3. After a compaction the share of user corrections rises from 17.7% to 41.9% and stays there for at least 30 steps, so compacting too often does harm as well c4. A test of Opus 5.5 up to 928K showed no drop in information retrieval, but the published curves for multi-step tasks do fall, so its authors set 400K, with a defensible band of 300–500K c5. For the author's work (long, complex projects, building things) 400K is a reasonable setting.
Unanswered messages are a known, open problem on the connection side: the session hangs without using tokens, and Esc followed by sending again unblocks it at once c6. Since 11 November 2026 there is also a reported bug in which every request from a session above ~200K fails with ECONNRESET c7. The reporter works around it with an auto-compact window of 150K, which does not rescue sessions that are already too large c8. The author has had CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS=30000 set since 10 November, and manual resends have been clearly fewer since then, but the causal link has not been checked.
Claims
In our words
In the source's words
With no window set, Claude Code compacts sessions with a 1M window at about 967K tokens.
With no window set, Claude Code auto compacts at the model's context limit: about 967K tokens on 1M-context models and 200K on 200K models.
its-tahir.com · T4
Idle compaction summarises a conversation above 200K before the one-hour cache expires, and idleCompaction: false turns it off.
that's idle compaction, not a lower threshold: it summarises a 200K+ token conversation before its one-hour cache expires, and `"idleCompaction": false` turns it off.
its-tahir.com · T4
A measurement of agent calls: below ~200K compactions eat working time, above ~600K no gain is visible.
Below about 200k the post-compaction fog starts eating your working time. Above about 600k you are paying a large premium for a benefit I could not find in any of these measurements
langwatch.ai · T2
After a compaction the share of user corrections rises from 17.7% to 41.9%.
In the five steps after a compaction, **41.9% of my messages contain a correction against a steady-state baseline of 17.7%**
langwatch.ai · T2
The Opus 5.5 test ended with the auto-compact window set to 400K, with a band of 300–500K.
We set the auto-compact window to 400,000 tokens: 40% of the window, with a defensible band from 300K to 500K
dashecorp.com · T2
A hung session uses no tokens, and Esc followed by sending again unblocks it at once.
the spinner keeps spinning, no tokens are consumed, and no progress is made. Pressing Escape and re-prompting immediately unsticks it
github.com · T4
Since 11 November 2026 requests from sessions above ~200K tokens fail with ECONNRESET.
Starting around 22:50 UTC on 2026-11-11, every request from a session with more than ~200K tokens of context fails with:
github.com · T4
The ECONNRESET workaround is an auto-compact window of 150K; it does not rescue sessions that are already too large.
keeps new sessions under the failing size. It doesn't help sessions that are already too large; those have to be abandoned
github.com · T4