The autocompact buffer percentage was hardcoded to 16.5%. Users who set CLAUDE_CODE_AUTO_COMPACT_WINDOW to a custom token count (e.g. 400000 on a 1M-context model) saw a miscalibrated context meter and incorrect warning thresholds in the context-monitor hook (which reads used_pct from the bridge file the statusline writes). Now reads CLAUDE_CODE_AUTO_COMPACT_WINDOW from the hook env and computes: buffer_pct = acw_tokens / total_tokens * 100 Defaults to 16.5% when the var is absent or zero, preserving existing behavior. Also applies the renameDecimalPhases zero-padding fix for clean CI. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
10 KiB
10 KiB