Session crashed with "Usage credits required" error after auto-switching to 1M context mode
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:
- Open a project with a large folder structure (e.g. with node_modules)
- Let Claude Code scan the project directory
- Auto-switch to 1M context mode triggers a credits error
- 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
- Open Claude Code in a project directory that contains a large folder structure (e.g. with node_modules)
- Start a new session and begin working on tasks
- Claude Code automatically scans the project folder and switches to 1M large-context mode without warning
- A "Usage credits required" error is triggered
- The terminal becomes completely unresponsive — no commands can be entered
- 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_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗