[BUG] Auto-compaction fires at 281K–845K tokens on 2.1.296 for claude-opus-5-5 (documented default ~967K)
Summary. Since the update to 2.1.296 on 2026-10-10, interactive sessions on claude-opus-5-5 auto-compact far below the documented default, at irregular points. No auto-compact window is configured, and the 2.1.296 changelog announces no change to the main conversation's compaction point.
Expected (Model configuration docs): "Models running with a native 1M window compact before the window fills, at about 967K tokens by default. These include … Opus 4.7 and later."
Actual. From the compact_boundary records in local transcripts; trigger is "auto" on every one:
| Version | Period (UTC) | Auto-compactions | preTokens |
|---|---|---|---|
| 2.1.294 and earlier | 2026-09-12 to 2026-10-10 09:35 | 47 | 966,331 to 980,835 |
| 2.1.296 | 2026-10-10 10:21 to 14:52 | 8 | 281,107 · 283,004 · 327,396 · 337,609 · 393,350 · 424,831 · 531,500 · 844,686 |
The trigger is not a fixed lower window. One 2.1.296 session compacted three times, at 283K, 532K and 425K. Another reached 373K without compacting. postTokens 19K to 42K; each compaction took 50 to 83 seconds.
Configuration checked:
- No
autoCompactWindowin any settings file, either top-level or undermodelSettings. - No managed settings.
CLAUDE_CODE_AUTO_COMPACT_WINDOW,CLAUDE_CODE_DISABLE_1M_CONTEXT,CLAUDE_CODE_MAX_CONTEXT_TOKENSandANTHROPIC_BASE_URLare unset.- No
--autocompactlaunch flag. - Permission mode: auto.
Impact. Each compaction drops working context and takes about a minute. At a third of the documented point, long sessions compact about three times as often.
Environment. Claude Code 2.1.296 · macOS (Darwin 27.0.0) · terminal · claude.ai login · model claude-opus-5-5.
3 Comments
/autocompacton the affected install confirms the window is at its default. The dialog shows:Closing it with Esc printed
Auto-compact window for Opus 5.5 unchanged: 1m tokens (default for this model).The dialog states that "the actual threshold is the minimum of this setting and your model's maximum context window", so the effective threshold should sit near 1M. The 8 auto-compactions on 2.1.296 fired at 281K to 845K.
This may be idle compaction, a shipped feature, rather than a regression. I hit the same pattern on 2.1.296 (7 auto compactions at 228K–755K, Windows 11). Every one of them has this text in the transcript next to the
compact_boundary:These compactions record
trigger: "auto", the same as a normal limit compaction, which is why they look like a lowered threshold when you go bypreTokensalone.As far as I can tell, it fires when the conversation is at least 200K tokens, the session has been idle for about 54 minutes (just before the 1-hour prompt cache expires), and auto-compact is on. That explains the irregular trigger points.
To turn it off, add this to
settings.json(user or project):The setting's description in the binary: "Set to false to stop Claude Code from compacting a long conversation while the session is idle. Setting it to true does not turn idle compaction on." Normal auto-compaction near the 1M limit is unaffected.
Worth checking whether your 8 compactions carry the same line. If they do, the docs and the
triggervalue could make this much clearer; #101070 asks for a separate"idle"trigger value.Thanks @kevinearljones, that looks right. Every compaction below ~967K in our transcripts since 2026-10-10 carries the line "Compacted while idle, before the prompt cache expired" and fired about 54 minutes after the last message. The ones without it still fire near 967K.
So this seems to be idle compaction, switched on around 2026-10-10 when we moved to 2.1.296, rather than a lower threshold. I could not find
idleCompactionin the docs or the changelog.Leaving this open in case Anthropic has any comment on the change.