Auto-compact fires despite DISABLE_AUTO_COMPACT=1 and AUTOCOMPACT_PCT_OVERRIDE=95

Resolved 💬 5 comments Opened Apr 2, 2026 by jsk5599 Closed May 18, 2026

Bug

Auto-compact triggers on session start despite being explicitly disabled via two env vars in ~/.claude/settings.json.

Version

Claude Code v2.1.90, Opus 4.6 (1M context), macOS (Darwin 25.4.0)

Settings

{
  "env": {
    "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "95",
    "DISABLE_AUTO_COMPACT": "1"
  }
}

Observed behavior

Fresh session immediately shows:

* Cultivating… (1m 26s · ↓ 3.2k tokens)

Context drops to 6% after compaction. Neither DISABLE_AUTO_COMPACT nor CLAUDE_AUTOCOMPACT_PCT_OVERRIDE prevented it.

Expected behavior

Auto-compact should not fire when DISABLE_AUTO_COMPACT=1 is set. The 95% override threshold should also prevent early compaction.

Repro

  1. Set both env vars in ~/.claude/settings.json as shown above
  2. Start a new Claude Code session
  3. Observe auto-compact firing despite settings

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗