[BUG] Auto-compact fails when 200K standard context is exhausted — compaction API requires extended context

Resolved 💬 4 comments Opened Apr 16, 2026 by danieleagle Closed Apr 27, 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?

When auto-compact is enabled and the standard 200K context window fills up, /compact fails with:

Error: Error during compaction: API Error: Extra usage is required for 1M context

Auto-compact never fires proactively. The session reaches 100% usage without compaction. The user must manually switch to a 1M model
before compaction succeeds.

Additional Context:

PostToolUse hook payloads do not include context_window data. The statusline receives it, but hooks don't — this may explain why
auto-compact can't detect the threshold.

Related: #23432, #25695, #29330, #34296

What Should Happen?

Auto-compact should fire before the window is fully exhausted, or the compaction API should work within 200K.

Error Messages/Logs

Steps to Reproduce

  1. Start session with auto-compact enabled on standard 200K Sonnet
  2. Run a long session (audit, many tool calls, agent dispatches)
  3. Context hits 100% — auto-compact never fires
  4. /compact → "Extra usage required for 1M context"
  5. Workaround: /model → Opus 1M → /compact succeeds

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.110

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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