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
- Set both env vars in
~/.claude/settings.jsonas shown above - Start a new Claude Code session
- Observe auto-compact firing despite settings
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗