claude-code - 💡(How to fix) Fix [Bug] /compact fails with "Usage credits required for 1M context" even after /model set to Sonnet 4.6

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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

Root Cause

Root cause observed

Fix Action

Workaround

/clear — full context loss.

Code Example

/compact   → Error: Usage credits required for 1M context
/login     → Login successful
/compact   → Error: Usage credits required for 1M context
/model     → Set model to Sonnet 4.6
/compact   → Error: Usage credits required for 1M context

---

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
RAW_BUFFERClick to expand / collapse

Bug Description

/compact throws a 1M context error even when the session model is explicitly set to claude-sonnet-4-6. The compaction process internally requests a 1M context model regardless of the user-set session model.

Exact reproduction sequence

/compact   → Error: Usage credits required for 1M context
/login     → Login successful
/compact   → Error: Usage credits required for 1M context
/model     → Set model to Sonnet 4.6
/compact   → Error: Usage credits required for 1M context

Error

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

Root cause observed

Session transcript shows cache_read_input_tokens reached ~400K, exceeding the standard 200K window. The compaction process apparently tries to use a 1M context model to process this, but the account has service_tier: standard and no usage credits for 1M context. Switching model with /model has no effect because compaction ignores the session model setting.

Expected behavior

/compact should reduce context, not expand it. It should not internally require a 1M context model, or should fall back gracefully to chunked compaction on standard context.

Workaround

/clear — full context loss.

Environment

  • Claude Code version: 2.1.156
  • Session model: claude-sonnet-4-6 (standard context)
  • Trigger: Playwright MCP (large browser snapshots accumulate ~400K cached tokens)
  • OS: Linux
  • Plan: Pro (standard tier, no usage credits)

Related

  • #62063 (1M context triggered without user request)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

/compact should reduce context, not expand it. It should not internally require a 1M context model, or should fall back gracefully to chunked compaction on standard context.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] /compact fails with "Usage credits required for 1M context" even after /model set to Sonnet 4.6