Auto-compact does not trigger after context exceeds 80%-100% (2.1.162)
Preflight Checklist
- [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
What's Wrong?
Auto-compaction does not appear to trigger automatically in Claude Code 2.1.162.
In my session, the context usage exceeded 120%, but no automatic compaction occurred. Historically, auto-compaction would typically trigger around 75–80% context usage (or near the configured threshold), helping prevent excessive context growth.
Expected behavior:
- Auto-compaction should trigger automatically when context usage approaches the configured threshold.
- Context usage should not significantly exceed the threshold without compaction occurring.
Actual behavior:
- Context usage reached approximately 120%.
- No automatic compaction was triggered.
- The session remained functional, but context continued to grow beyond the expected limit.
It's unclear whether this is:
- A regression in the auto-compaction mechanism.
- A change in the intended behavior that is not documented.
- An issue with the context usage indicator reporting percentages above 100%.
What Should Happen?
Auto-compaction should trigger automatically when the session reaches the configured context threshold (or the default threshold if none is configured).
When the threshold is reached:
- The session should be compacted automatically without requiring manual intervention.
- Context usage should drop after compaction.
- The user should not see context usage continue growing significantly beyond the configured limit.
If context percentages above 100% are expected by design, this behavior should be clearly documented and the context indicator should accurately reflect the state of auto-compaction.
Error Messages/Logs
Steps to Reproduce
- Start a new Claude Code session using version 2.1.162.
- Work in the session until the context usage exceeds the expected auto-compaction threshold.
- Continue working until the context indicator shows more than 100% usage (e.g., ~120%).
- Observe that automatic compaction does not occur.
- Verify that the session continues operating without reducing context size automatically.
Optional:
- Run
/contextand note the reported context usage. - Run
/compactmanually and verify that manual compaction still works.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.162
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
- Claude Code version: 2.1.162
- Context usage reached approximately 120% without automatic compaction.
- No manual changes were made to disable auto-compaction.
- Session remained functional despite exceeding 100% context usage.
- Manual
/compactcommand was available and worked as expected. - Historically, auto-compaction was observed to occur around 75–80% context usage, so the current behavior appears different from previous versions.
- It is unclear whether this is an intended change in context management, a regression in the auto-compaction mechanism, or an issue with the context usage indicator.
- Please clarify whether context usage values above 100% are expected and whether the displayed percentage is still the metric used to trigger automatic compaction.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗