claude-code - 💡(How to fix) Fix Session crashed with "Usage credits required" error after auto-switching to 1M context mode

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

project folder. This triggered a "Usage credits required" error that completely froze the terminal — I could not type 3. Auto-switch to 1M context mode triggers a credits error Expected behavior: Either warn the user before switching to 1M mode, or gracefully degrade without crashing the Claude Code should warn the user before automatically switching to 1M large-context mode, and should never lock the terminal or crash the session due to a credits error. The session and all in-progress work should remain intact even

Error Messages/Logs

  1. A "Usage credits required" error is triggered
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Description:

I was working on a project when Claude Code automatically switched to the 1M large-context mode while scanning the project folder. This triggered a "Usage credits required" error that completely froze the terminal — I could not type any commands or recover the session.

As a result, the entire session was lost and I had to restart from scratch, losing all in-progress work and conversation history.

This happened unexpectedly with no warning beforehand. As a Pro subscriber, I should not be losing work this way.

Steps to reproduce:

  1. Open a project with a large folder structure (e.g. with node_modules)
  2. Let Claude Code scan the project directory
  3. Auto-switch to 1M context mode triggers a credits error
  4. Terminal becomes completely unresponsive

Expected behavior: Either warn the user before switching to 1M mode, or gracefully degrade without crashing the session.

Impact: Complete session loss, hours of work affected.

What Should Happen?

Claude Code should warn the user before automatically switching to 1M large-context mode, and should never lock the terminal or crash the session due to a credits error. The session and all in-progress work should remain intact even if a context limit is reached.

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code in a project directory that contains a large folder structure (e.g. with node_modules)
  2. Start a new session and begin working on tasks
  3. Claude Code automatically scans the project folder and switches to 1M large-context mode without warning
  4. A "Usage credits required" error is triggered
  5. The terminal becomes completely unresponsive — no commands can be entered
  6. The entire session is lost and cannot be recovered

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.156

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

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…

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 Session crashed with "Usage credits required" error after auto-switching to 1M context mode