CLAUDE_AUTOCOMPACT_PCT_OVERRIDE silently stopped taking effect after 2026-07-14 (v2.1.220)

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Jul 31, 2026

Summary

CLAUDE_AUTOCOMPACT_PCT_OVERRIDE stopped taking effect. It worked until 2026-07-14, then silently became a no-op. The variable is still present in the CLI binary's string table, autoCompactEnabled is true, and the variable is confirmed present in the running process's environment — but auto-compact no longer fires at the overridden threshold.

Environment

  • Claude Code 2.1.220 (native Windows binary, npm install)
  • Windows 11 Pro 26200
  • Model: claude-opus-5[1m] (1M context)
  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=33, set as a persistent user environment variable via setx (HKCU\Environment), not via settings.json (settings.json env is known not to work for this knob)
  • "autoCompactEnabled": true in ~/.claude/settings.json
  • No DISABLE_AUTO_COMPACT / DISABLE_COMPACT set anywhere; no hook invokes /compact

Confirmed inherited by the running CLI process:

$ env | grep AUTOCOMPACT
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=33

Evidence

I parsed every compactMetadata record out of ~/.claude/projects/*/*.jsonl (159 compaction events total: 48 trigger: "auto", 111 trigger: "manual").

While the override worked — auto-compactions fire at ~32.5% of the 1M window, exactly as configured:

2026-07-10T14:22  auto  344,052
2026-07-10T22:12  auto  325,687
2026-07-12T14:48  auto  323,840
2026-07-13T03:45  auto  325,359
2026-07-13T04:05  auto  325,844
2026-07-14T02:23  auto  324,546
2026-07-14T03:47  auto  323,801   <- last auto-compaction ever recorded

(For contrast, auto-compactions before the override was set fired at ~967k–1,007k, i.e. the default ~97% threshold.)

After 2026-07-14 — zero trigger: "auto" events in 17 days, across all projects, despite sessions running well past the 33% mark:

2026-07-28T16:22  manual  511,877   (51% of window — should have auto-compacted at ~330k)
2026-07-29T12:51  manual  383,700
2026-07-30T02:23  manual  367,200
2026-07-31T00:36  manual  338,741
2026-07-31T00:55  manual  450,047   (45% of window)

Every one of those is a /compact I typed by hand. Several exceed the configured 33% threshold by a wide margin with no auto-compaction in between.

Note this is specifically an override regression, not a claim that auto-compaction is broken outright: no session since 2026-07-14 reached the default ~95% trigger (max was 512k / 51%), so default-threshold behaviour is untested here.

Secondary observation

/context on 2.1.220 shows no auto-compact buffer row and no threshold marker — categories are System prompt / System tools / Custom agents / Memory files / Skills / Messages / Free space only. I don't know whether that row was intentionally removed from the display or whether its absence reflects auto-compact not being armed.

Expected

With CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=33 on a 1M-context model, auto-compaction fires at ~330k tokens.

Actual

No auto-compaction at any threshold; context grows unbounded until compacted by hand.

Reproduction

  1. setx CLAUDE_AUTOCOMPACT_PCT_OVERRIDE 33, restart the terminal
  2. Start a session on claude-opus-5[1m], confirm the variable is in the process environment
  3. Grow context past 330k tokens
  4. Observe: no auto-compaction; compactMetadata in the session .jsonl records only trigger: "manual" entries

View original on GitHub ↗