Regression: auto-compact no longer triggers at ~168K tokens with claude-sonnet-4-6

Open 💬 8 comments Opened Jun 7, 2026 by nicolettas-muggelbude

Bug Report

Auto-compact used to reliably trigger at ~168K tokens during sessions with claude-sonnet-4-6. Since a recent update (observed on v2.1.168), this no longer happens.

Current behavior

Instead of auto-compacting, the session hits the 1M context limit and throws:
"API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context"

This forces the user to restart Claude Code entirely.

Expected behavior

Auto-compact should trigger before the context limit is reached, as it previously did at ~168K tokens (roughly 80% of the 200K context window).

Root cause hypothesis

A recent update appears to have changed the default context window for claude-sonnet-4-6 from 200K to 1M tokens. This shifts the auto-compact threshold from ~168K to ~800K — but the 1M window requires paid usage credits, so the error occurs before auto-compact ever runs.

Steps to reproduce

  1. Start a long session with claude-sonnet-4-6 in the VSCode extension
  2. Let context grow past ~168K tokens
  3. Observe: no auto-compact, instead receive the usage credits error

Workaround

Manually run /compact before sessions get too long.

Claude Code version: 2.1.168
Platform: Windows 11, VSCode extension
Model: claude-sonnet-4-6

View original on GitHub ↗

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