[BUG] Autocompact not triggering at appropriate threshold - reached 186% context - could no longer /compact

Resolved 💬 2 comments Opened Jun 3, 2026 by objectivitydrx Closed Jun 6, 2026

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?

Description:

  • Context window reached 371.9k/200k tokens (186% over limit)
  • Autocompact message still said "will trigger soon" at 186%
  • Should have triggered around 80-90% to prevent overshoot
  • Session became unusable due to late autocompact trigger
  • Model: claude-sonnet-4-6 on Pro plan

Reproduction:

  1. Start long Claude Code session with subagents
  2. Run /context periodically
  3. Observe autocompact doesn't trigger until well over 100%

What Should Happen?

Claude Code should trigger /compact well before 90%

Error Messages/Logs

❯ /compact                                                                                                                                       
  ⎿  Error: Error during compaction: 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

Run Claude code pro on linux.
Run out of context.
loose time waiting for a reset of Pro limits.

Claude Model

Other

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

 2.1.158 (Claude Code)

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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