claude-code - 💡(How to fix) Fix Auto-compact ignores CLAUDE_AUTOCOMPACT_PCT_OVERRIDE on 1M-context Opus — no compaction at 52% (522k) with override=40 [v2.1.156]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Environment

  • Claude Code 2.1.156
  • Model: Opus 4.8, 1M context (claude-opus-4-8[1m])
  • WSL2 Ubuntu (same config also present on Windows)

Setting

  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=40 in settings.json env — verified present in config and live in the running process env.
  • Auto-compact is not disabled: no DISABLE_AUTO_COMPACT, no autoCompactEnabled:false, no project/local override.

Expected: auto-compact triggers at ~40% of the 1M window (~400k tokens).

Actual: /context reports 522k / 1M (52%) (Messages 468.6k) with no auto-compact triggered. The override appears not honored on the 1M window — the effective threshold seems to fall back to the built-in default near the top of the window.

Repro: set CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=40 on 1M Opus, run a long session, watch /context go past 40% without compaction.

Related: #54056 and #53199 (compacts too early on 1M) and #36381 (override not triggering at configured threshold). This is the inverse symptom (compacts too late / threshold ignored) but the same root: the override isn't applied on the 1M window.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Auto-compact ignores CLAUDE_AUTOCOMPACT_PCT_OVERRIDE on 1M-context Opus — no compaction at 52% (522k) with override=40 [v2.1.156]