claude-code - 💡(How to fix) Fix Context hit 1M token limit with no auto-compaction and no recovery path

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

During a normal coding session, the conversation context grew to the 1M token limit without auto-compaction triggering. When the limit was hit, the error message was about requiring more credits to use 1M context — misleading, since the user never opted into extended context. Manual /compact was also unavailable or broken at that point, leaving the user stranded with no way to continue the session.

  • If the limit is hit, the error should offer a recovery path (e.g., "run /compact"), not a billing/credits message
  • Error message referenced credits/billing for 1M context, which is confusing and unhelpful
RAW_BUFFERClick to expand / collapse

Bug description

During a normal coding session, the conversation context grew to the 1M token limit without auto-compaction triggering. When the limit was hit, the error message was about requiring more credits to use 1M context — misleading, since the user never opted into extended context. Manual /compact was also unavailable or broken at that point, leaving the user stranded with no way to continue the session.

Expected behavior

  • Auto-compaction should trigger before hitting the 1M limit
  • If auto-compaction fails, /compact should still be available as a fallback
  • If the limit is hit, the error should offer a recovery path (e.g., "run /compact"), not a billing/credits message

Actual behavior

  • Context grew to 1M without auto-compaction firing
  • /compact was not usable when needed
  • Error message referenced credits/billing for 1M context, which is confusing and unhelpful
  • User was forced to start a new conversation, losing session context

Environment

  • Claude Code version: 2.1.158
  • OS: Linux (WSL2)
  • Model: claude-sonnet-4-6

Impact

High — basic session continuity broken, user loses all conversation context mid-task with no recovery option.

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

  • Auto-compaction should trigger before hitting the 1M limit
  • If auto-compaction fails, /compact should still be available as a fallback
  • If the limit is hit, the error should offer a recovery path (e.g., "run /compact"), not a billing/credits message

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 Context hit 1M token limit with no auto-compaction and no recovery path