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

Status Closed — not planned
Reported on v2.1.156
Maintainer reply None cached
Activity 1 comment · opened May 29, 2026 · closed Jul 1, 2026

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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗