[BUG] CLAUDE_AUTOCOMPACT_PCT_OVERRIDE not triggering at configured threshold (v2.1.156)

Resolved 💬 2 comments Opened Jun 2, 2026 by LH-Hadoop Closed Jul 6, 2026

What's Wrong?

CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60 is set via ~/.claude/settings.json env section but auto-compaction does not trigger at 60% context usage. The main session reached 72% without triggering compaction. The env var is confirmed loaded (echo $CLAUDE_AUTOCOMPACT_PCT_OVERRIDE outputs 60).

This is a follow-up to #36381 (closed & locked). The issue was reported on v2.1.79 and is still present in v2.1.156.

What Should Happen?

Auto-compaction should trigger when context window usage reaches ~60%, as configured by CLAUDE_AUTOCOMPACT_PCT_OVERRIDE.

Steps to Reproduce

  1. Set CLAUDE_AUTOCOMPACT_PCT_OVERRIDE to "60" in ~/.claude/settings.json under the "env" key:
{
  "env": {
    "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "60"
  }
}
  1. Restart Claude Code
  2. Verify env var is loaded: echo $CLAUDE_AUTOCOMPACT_PCT_OVERRIDE60
  3. Use the session until context exceeds 60%
  4. Observe that auto-compaction does not trigger at 60%

No other compaction-related env vars are set (CLAUDE_CODE_AUTO_COMPACT_WINDOW, CLAUDE_CODE_MAX_CONTEXT_TOKENS, DISABLE_AUTO_COMPACT, DISABLE_COMPACT are all empty).

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

Additional Information

  • Claude Code Version: 2.1.156
  • Claude Model: Opus
  • Platform: Anthropic API
  • Operating System: Windows
  • Terminal/Shell: Windows Terminal / bash
  • Is this a regression?: I don't know
  • Workaround: manually run /compact to trigger compaction

View original on GitHub ↗

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