[BUG] CLAUDE_AUTOCOMPACT_PCT_OVERRIDE not triggering at configured threshold (v2.1.156)
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
- Set
CLAUDE_AUTOCOMPACT_PCT_OVERRIDEto"60"in~/.claude/settings.jsonunder the"env"key:
{
"env": {
"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "60"
}
}
- Restart Claude Code
- Verify env var is loaded:
echo $CLAUDE_AUTOCOMPACT_PCT_OVERRIDE→60 - Use the session until context exceeds 60%
- 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
/compactto trigger compaction
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗