v2.1.92 regression: autocompact threshold reduced to 400k on Opus 4.6 (1M context)

Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Apr 5, 2026 · closed Jul 11, 2026

Summary

Claude Code v2.1.92 reduces the autocompact window to ~400k tokens on Opus 4.6 (1M context), down from the full ~1M available in v2.1.91 and earlier. This is an undocumented regression — the v2.1.92 release notes contain no mention of autocompact threshold changes.

Evidence

v2.1.91 and earlier: /context shows 24k/1000k tokens — full 1M window available. Sessions routinely ran to 600k+ tokens without compaction. 32MB session transcripts with zero compaction events.

v2.1.92: /context shows 25.7k/400k tokens — autocompact window capped at 400k. Sessions trigger compaction at ~400k, wasting 60% of the context window. Confirmed on two separate machines (Ubuntu 22.04) with the same Claude Max subscription and Opus 4.6 model.

Rollback confirms: Downgrading to v2.1.91 on one machine immediately restored the full 1M window. Upgrading back to v2.1.92 re-introduced the 400k limit.

Visual comparison

v2.1.91 — full 1M context available

 ▐▛███▜▌   Claude Code v2.1.91
▝▜█████▛▘  Opus 4.6 (1M context) · Claude Max
  ▘▘ ▝▝    ~/Projects/cairn

❯ /context
  ⎿  Context Usage
     ⛁ ⛁ ⛁ ⛁ ⛀ ⛀ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   Opus 4.6 (1M context)
                                               claude-opus-4-6[1m]
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   23.8k/1m tokens (2%)

     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   Estimated usage by category
                                               ⛁ System prompt: 6.3k tokens (0.6%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 8.6k tokens (0.9%)
                                               ⛁ Memory files: 8.3k tokens (0.8%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Skills: 493 tokens (0.0%)
                                               ⛁ Messages: 8 tokens (0.0%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛶ Free space: 955.2k (95.5%)
                                               ⛝ Autocompact buffer: 21k tokens
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶                         (2.1%)

v2.1.92 — capped at 400k

 ▐▛███▜▌   Claude Code v2.1.92
▝▜█████▛▘  Opus 4.6 (1M context) · Claude Max
  ▘▘ ▝▝    ~/Projects/cairn

❯ /context
  ⎿  Context Usage
     ⛁ ⛀ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀ ⛶ ⛶   Opus 4.6 (1M context)
                           claude-opus-4-6[1m]
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   23.8k/400k tokens (6%)

     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   Estimated usage by category
                           ⛁ System prompt: 6.3k tokens (1.6%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 8.6k tokens (2.2%)
                           ⛁ Memory files: 8.3k tokens (2.1%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Skills: 493 tokens (0.1%)
                           ⛁ Messages: 8 tokens (0.0%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛶ Free space: 355.2k (88.8%)
                           ⛝ Autocompact buffer: 21k tokens (5.3%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶

     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶

     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶

     ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ ⛝ ⛝ ⛝ ⛝

     Auto-compact window: 400k tokens · /autocompact

Note: the bar shrinks from 20 columns to 10 columns, and the denominator drops from 1m to 400k.

Environment

  • Claude Code v2.1.92 (npm and native builds)
  • Model: Opus 4.6 (1M context) via Claude Max
  • Ubuntu 22.04 (tested on two machines)
  • No custom autocompact configuration

Impact

Users paying for 1M context are getting 400k. Long-form development sessions that previously worked without compaction now lose context mid-task.

Related

  • #34332 — Autocompact triggers too early on Opus 4.6 (1M context)
  • #31806 — CLAUDE_AUTOCOMPACT_PCT_OVERRIDE capped by Math.min
  • #24079, #19485 — Earlier premature autocompact reports

View original on GitHub ↗

11 Comments

qozle · 4 months ago

Traced this through the npm package source (diffing cli.js between v2.1.91 and v2.1.92).

The autocompact window calculation function gained a new code path in v2.1.92 that checks a GrowthBook experiment called tengu_amber_redwood. When a user is enrolled in the experiment, the window is overridden to whatever value the experiment specifies (400k in this case), taking precedence over the model default but not over the env var or settings overrides.

v2.1.91 flow:

  1. Check CLAUDE_CODE_AUTO_COMPACT_WINDOW env var → use if set
  2. Check user settings → use if set
  3. Fall through to model context window (1M for Opus 4.6)

v2.1.92 flow:

  1. Check CLAUDE_CODE_AUTO_COMPACT_WINDOW env var → use if set
  2. Check user settings → use if set
  3. New: check GrowthBook experiment tengu_amber_redwood → use if enrolled
  4. Fall through to model context window

There's already a post-compaction notification built into v2.1.92 that says:

compacted at 400k · override with CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000

Workaround: export CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 overrides the experiment and restores the full 1M window.

jimovonz · 4 months ago

Thank you. I can confirm that works. Seems an odd thing for Anthropic to randomly enforce when [1M] is a major advertising feature....

junaidtitan · 4 months ago

The 400K threshold regression is frustrating. Cozempic v1.6.11 works around it — the guard daemon proactively prunes at configurable thresholds (25%/55%/80%) so the session never reaches CC's autocompact trigger, regardless of what CC sets internally.

Auto-detects 1M context for Opus/Sonnet 4.5/4.6. 18 pruning strategies keep sessions lean. The guard runs automatically via SessionStart hook.

pip install cozempic && cozempic init

creatornader · 4 months ago

Adding another data point on macOS:

  • Claude Code v2.1.92, native arm64 build at ~/.local/share/claude/versions/2.1.92 (Mach-O 64-bit executable arm64)
  • Model: claude-opus-4-6[1m] (1M variant active in /model)

I have both of these set, verified present in the live claude process environment via ps eww -p <pid> | tr ' ' '\n' | grep CLAUDE_:

CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=80

Despite this, /context consistently reports Auto-compact window: 400k tokens and the bar fills against 400k, not 1M. The documented WINDOW=1000000 workaround from this thread does not restore 1M for me on v2.1.92. This appears to be a second failure mode beyond the experiment override @qozle traced — possibly the Math.min cap referenced in #31806, or a different code path on the native build.

Downgrading to v2.1.91 (kept locally as a sibling versioned binary) as a workaround. The downgrade did successfully restore the 1M autocompact window for me.

kratocz · 4 months ago

Confirming this regression persists three weeks later on the latest channel, now also affecting Opus 4.7 with the 1M context window — not just 4.6.

Environment

Claude Code v2.1.119 (running, latest channel, native install)
Commit: 6f6855483975
Platform: darwin-arm64
OS: macOS 26.4.1 (25E253)
Model: claude-opus-4-7[1m]
Plan: Claude Max

Channel state at time of report:
  latest: 2.1.119  (currently running, broken)
  stable: 2.1.112  (confirmed workaround — see below)

Symptom (identical to OP)

Opus 4.7 (1M context)
claude-opus-4-7[1m]
591.8k/400k tokens (148%)

Denominator is 400k, same as the OP's reproduction on Opus 4.6 in v2.1.92.

Note re. recent release notes

The official changelog states:

Fixed Opus 4.7 sessions showing inflated /context percentages and autocompacting too early — Claude Code was computing against a 200K context window instead of Opus 4.7's native 1M

That fix targeted the 200K → 1M code path. The 400K cap described in this issue is a different value and is clearly not covered by it. The same symptom now reproduces across two model generations (4.6 and 4.7) and over twenty-five releases (v2.1.92 through v2.1.119), strongly suggesting the threshold derivation for [1m] variants has multiple unfixed branches.

Workarounds tried

  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=90 — no effect (capped by Math.min, see #31806).
  • Switching to stable channel (v2.1.112) via /configAuto-update channel: stable → "Allow possible downgrade" → restored full 1M denominator. This is the only confirmed workaround.

Cross-platform / install-method note

This issue is currently labeled platform:linux, but the same symptom reproduces on macOS 26.4.1 (Apple Silicon) with the native installer, complementing the OP's Linux + npm/native testing. The bug appears to be in core threshold-derivation logic, not platform- or install-method-specific.

Related

  • #50204 — different symptom (UI percentage / actual token mismatch on Opus 4.7 [1m])
  • #50716 — Opus 4.7 capped at 200K in the VS Code extension
  • #31806 — CLAUDE_AUTOCOMPACT_PCT_OVERRIDE cannot raise threshold above default (~83%)
m13v · 4 months ago

i've watched this exact pattern play out three times now on the Max plan: silent server-side knob change, no release notes, and the only way to confirm is rolling back binaries on a second machine like you did. the autocompact threshold isn't the only one either. the rolling 5h window quota got tightened in late march, weekly limits showed up around the same time, and none of it landed in changelogs. the /context readout reads from a server-truth value, not anything baked into the binary, which is why 2.1.91 vs 2.1.92 makes it look client-side when really both versions just render whatever the server hands back. nice repro work though, two-machine A/B is the only way these get acknowledged.

manrovich · 4 months ago

Confirming CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 workaround still works on v2.1.119 / Opus 4.7 [1m] / Windows

Environment

  • Claude Code v2.1.119
  • OS: Windows 11
  • Model: claude-opus-4-7[1m]

Before (no autocompact-related env overrides set):
``
Opus 4.7 (1M context) · claude-opus-4-7[1m]
30.4k/400k tokens (8%)
Free space: 336.6k (84.2%)
Autocompact buffer: 33k tokens (8.3%)
`
No
Auto-compact window:` line shown.

After adding CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 to the env block of ~/.claude/settings.json and
restarting:
``
Opus 4.7 (1M context) · claude-opus-4-7[1m]
60.2k/1m tokens (6%)
Free space: 905.9k (90.6%)
Autocompact buffer: 33k tokens (3.3%)
Auto-compact window: 1m tokens
``

TJ-NomoAI · 4 months ago

@jimovonz and all --> the solution proposed by @qozle saved my bacon.

It 100% worked for me. I implemented this fix in about 5 minutes and I'm back. I've tested it with concurrent sessions on multiple worktrees going deep into context windows, I've seen a session let me get to 70% of the session context without autocompact, all since updating last night. I'll keep pushing the session limit, but the fix is just so new I haven't had a reason/session that needed to go much past about 700k / 1m. Thank you Qozle!

hiddenlayer1 · 3 months ago

Hi @jimovonz — adding a data point because I think this issue and #55504 / #47019 / #35677 / #34143 are all the same underlying defect, just observed at different "stuck threshold" values across CC versions.

Your v2.1.92 regression observed a 400K auto-compact trigger on Opus 4.6 with 1M context advertised. My v2.1.141 measurement on Opus 4.7 [1m] (Max plan, Windows 11) shows the trigger has regressed further to ~190K — and the math reveals why:

trigger = min(CLAUDE_CODE_AUTO_COMPACT_WINDOW_env, detected) × PCT_OVERRIDE
        = min(1_000_000, ~200_000) × 0.95
        = ~190_000

Verified live: my env is correctly WINDOW=1_000_000 and PCT=95. The trigger lands at ~190K because the detected value is ~200K, not 1M — i.e. the runtime is misreading the served window for the [1m] variant on Max.

If the same trigger formula applied at the time of your 400K report, then detected was ~420K (min(1M, 420K) × 0.95 = ~400K). Different detected value, same root mechanism: whatever computes detected is reading the served entitlement wrong, and the value it returns has drifted further from 1M with each successive version.

That's significant signal for Anthropic: this is not random regression noise, it's a progressively-worsening server-side entitlement misread.

Comprehensive 30-day evidence (607 compaction events, 99 of 114 multi-compaction sessions thrashing, worst session 29 compactions) is on the primary tracker #55504: https://github.com/anthropics/claude-code/issues/55504#issuecomment-4525687708. Raw 120KB JSONL available on request.

Parallel support@anthropic.com ticket filed framing this as Max-entitlement-not-delivered, since code.claude.com/docs/en/model-config#extended-context documents the 1M auto-upgrade.

Thank you for tracking the regression carefully — your specific version pin (v2.1.92 → 400K) is what makes the "progressively worse" pattern visible.

JConradoN · 2 months ago

+1

Ainda ocorrendo no v2.1.165. O threshold reduzido em Opus sessions com contexto maior continua causando compactações prematuras e comportamento inconsistente.

github-actions[bot] · 1 month ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.