[BUG] Claude Code silently exits session (on rate limit?) instead of showing error/retrying (Windows)
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?
When hitting a rate limit during an active Claude Code session on Windows, the session closes silently without any error message or retry mechanism. The user is dropped back to the command prompt with no indication of what happened.
Expected behavior: Claude Code should display a message like "Rate limit reached, retrying in X seconds" and wait/retry automatically, rather than terminating the session.
This happened after working with a large context window (81% / 162K tokens, 2% until auto-compact) using Opus 4.6 on Claude Max. The session rate limit was hit, but instead of graceful handling, Claude Code just exited.
Notably, the weekly usage limits were far from exhausted (17% all models, 5% Sonnet), and even the session limit had already partially recovered to 61% by the time I checked — suggesting it was a temporary spike that should have been handled with a retry.
What Should Happen?
Claude Code should gracefully handle rate limits by:
- Displaying a clear error message (e.g. "Rate limit reached")
- Showing a countdown or retry timer
- Automatically retrying after the cooldown period
- NOT closing/exiting the session
Error Messages/Logs
Steps to Reproduce
- Open Claude Code on Windows (PowerShell or Git Bash)
- Use Opus 4.6 with Claude Max subscription
- Work in a session until context window is nearly full (~160K+ tokens)
- Hit the session rate limit — even though plan usage is well below the limit (weekly: 17% all models, 5% Sonnet-only; session: 61% at time of checking, already partially recovered)
- Observe: session exits silently instead of showing an error
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.49
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
- Claude Code v2.1.49
- Windows (PowerShell + Git Bash both affected)
- Model: Opus 4.6
- Auth: Claude Max subscription
- Native installation
<img width="1023" height="328" alt="Image" src="https://github.com/user-attachments/assets/6bb4049f-aa12-4b64-9d2a-2e920c362663" />
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗