Session crashed with "Usage credits required" error after auto-switching to 1M context mode

Resolved 💬 2 comments Opened May 29, 2026 by learnspot-au Closed Jun 1, 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?

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_

View original on GitHub ↗

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