[BUG] Auto-compact countdown disappears before reaching 0%, actual context usage shows plenty of headroom

Resolved 💬 2 comments Opened Jan 14, 2026 by carrotRakko Closed Feb 27, 2026

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:

  1. Continue to 0% and trigger auto-compact, OR
  2. Not appear in the first place if there is still significant headroom

Steps to Reproduce

  1. Start a Claude Code session and work until context usage builds up
  2. Observe the TUI for "Context left until auto-compact: X%" indicator
  3. When the countdown appears (e.g., 13%), run /context
  4. Note the discrepancy: /context shows ~30-33% free space
  5. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗