Bug Description
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=55 is set as an environment variable but auto-compaction does not trigger at 55% context usage. The main session regularly exceeds the configured threshold without compacting — observed at 67% in one session and over 80% in another before compaction finally occurred.
Environment
- Claude Code version: 2.1.79
- Model: Claude Opus 4.6 (Max plan)
- OS: macOS (Darwin 23.5.0)
- Shell: zsh
Steps to Reproduce
- Set
export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=55 in ~/.zshrc
- Verify the variable is loaded:
echo $CLAUDE_AUTOCOMPACT_PCT_OVERRIDE → 55
- Start a Claude Code session and use it until context exceeds 55%
- Observe that auto-compaction does not trigger at 55%
Expected Behavior
Auto-compaction should trigger when context window usage reaches ~55%, as configured by CLAUDE_AUTOCOMPACT_PCT_OVERRIDE.
Actual Behavior
- Context reached 67% (see screenshot) without triggering auto-compaction
- In another session, context reached over 80% before auto-compaction finally fired
- The env var appears to be ignored for the main session
Screenshot
Context at 67% with no auto-compaction triggered:
Additional Context
- The env var is confirmed set in the shell environment
CLAUDE_CODE_AUTO_COMPACT_WINDOW is not set (default)
- According to the docs,
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE should apply to both main conversations and subagents
- The HUD percentage comes from Claude Code's native
used_percentage field, so the reported percentage should match what the compaction engine sees
Bug Description
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=55is set as an environment variable but auto-compaction does not trigger at 55% context usage. The main session regularly exceeds the configured threshold without compacting — observed at 67% in one session and over 80% in another before compaction finally occurred.Environment
Steps to Reproduce
export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=55in~/.zshrcecho $CLAUDE_AUTOCOMPACT_PCT_OVERRIDE→55Expected Behavior
Auto-compaction should trigger when context window usage reaches ~55%, as configured by
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE.Actual Behavior
Screenshot
Context at 67% with no auto-compaction triggered:
Additional Context
CLAUDE_CODE_AUTO_COMPACT_WINDOWis not set (default)CLAUDE_AUTOCOMPACT_PCT_OVERRIDEshould apply to both main conversations and subagentsused_percentagefield, so the reported percentage should match what the compaction engine sees