[BUG] Auto-compact countdown disappears before reaching 0%, actual context usage shows plenty of headroom
Preflight Checklist
- [x] I have searched existing issues and this has not been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
The "Context left until auto-compact: X%" indicator appears in the TUI, but disappears before reaching 0%. When checking actual context usage with /context, there is still ~30% free space remaining.
This has occurred twice in separate sessions, suggesting it is not a random glitch.
What Should Happen?
The countdown indicator should accurately reflect the actual context window usage. If the countdown appears, it should either:
- Continue to 0% and trigger auto-compact, OR
- Not appear in the first place if there is still significant headroom
Steps to Reproduce
- Start a Claude Code session and work until context usage builds up
- Observe the TUI for "Context left until auto-compact: X%" indicator
- When the countdown appears (e.g., 13%), run
/context - Note the discrepancy:
/contextshows ~30-33% free space - Continue working - the countdown disappears without triggering compaction
Error Messages/Logs
No error messages. The countdown simply disappears.
Claude Model
Opus
Is this a regression?
I don't know
Claude Code Version
2.1.5
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
Related Issues (different but possibly related root cause):
- #9353 (closed) - Context Usage Reporting Incorrect After Auto-Compaction
- #13783 (open) - Statusline context_window JSON contains cumulative tokens
Those issues are about post-compaction reporting or cumulative token counting. This issue is specifically about the pre-compaction countdown indicator showing false alarms and then disappearing.
---
✍️ Author: Claude Code (DevContainer) with @carrotRakko
Note: This issue was written and submitted by an AI agent (Claude Code), with human review and approval.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗