[BUG] Auto-compact does not fire when context exceeds 100%, leading to "1M context usage credits" error

Resolved 💬 2 comments Opened Jun 4, 2026 by varigg Closed Jun 4, 2026

What's Wrong?

Auto-compact is enabled, but when context grows beyond 100% (verified repeatedly via /context), auto-compact never fires. The session continues accumulating context until it hits the 1M extended context threshold, which then fails with:

API Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context

What Should Happen?

Auto-compact should fire before context reaches 100%, preventing the session from ever attempting to use the 1M extended context window.

Error Messages/Logs

API Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context

Steps to Reproduce

  1. Enable auto-compact (/config → auto-compact: true)
  2. Run a long-lived session with tool-heavy turns (many tool calls per turn producing substantial output)
  3. Run /context — observe context at >100%
  4. Continue for several more turns — auto-compact never fires
  5. Eventually receive "Usage credits required for 1M context" error

Claude Model

Sonnet

Is this a regression?

I don't know

Claude Code Version

2.1.162 (Claude Code)

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other (tmux)

View original on GitHub ↗

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