[BUG] API Error: Rate limit reached incorrect in CLI

Open 💬 20 comments Opened Feb 13, 2026 by lanorac

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?

Claude Code fails to compact at that point, giving the same error, API rate limit reached. I was able to recover by quitting the session, then resuming it and compacting immediately.
I have a new Max account, plenty of usage left. I have gotten this error twice with about 3% context left both times.

What Should Happen?

I don't know, it should auto-compact and continue working?

Error Messages/Logs

Steps to Reproduce

  1. Reach 3% context remaining until auto-compact
  2. have some heavy work going on

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.41 (Claude Code)

Platform

Other

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

<img width="466" height="507" alt="Image" src="https://github.com/user-attachments/assets/d8e71507-24db-4809-a5a5-00657124c730" />

View original on GitHub ↗

20 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/16644
  2. https://github.com/anthropics/claude-code/issues/25107
  3. https://github.com/anthropics/claude-code/issues/25348

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

pavelbe · 4 months ago

Thanks for tracking this. I can confirm a related reproducible Max plan case and opened a dedicated report: #26812. In my case (Claude Code 2.1.47, Windows 11 + WSL Ubuntu), CLI returns 'API Error: Rate limit reached' continuously for 5-6 hours while Usage shows Weekly All models at 91% (about 9% remaining) and Current session at 0%. Claude feedback reference: 836a1742-0f17-4018-bdfa-3924ac5e0156. Evidence screenshots are included in #26812.

JF10R · 4 months ago

Same issue here, at just 30-ish % of my weekly limit and far from the session limit, on Sonnet 4.6 with the default 200k context window.
Claude Code 2.1.47
This happened after I pasted in a JSON file that made the context window reach past its limit and now I lost the whole session.

noeminihoul · 4 months ago

Same here. Extra-usage has been used but current session 0%...

RNWTenor · 4 months ago

same issue

ardaydilek · 4 months ago

Same issue here. Switching the model fixed it, but it doesn’t seem logical that this happens.

Makosha · 4 months ago

Same

dmazan · 4 months ago

Same issue here. API Error: Rate limit reached with a single Claude Code instance working on a not that difficult coding task. Looking at the console, nothing even close to recent peaks. Exit, resume, compact and away it goes.

Seems really specific to some particular sequence, not a duplicate of some more general issue. There is no way the task being worked on, my one person in one instance with one prompt should hit any API rate limit.

andre-fu · 4 months ago

Also encountering this - I tried switching the model from Opus to Sonnet but still got this error?

<img width="447" height="392" alt="Image" src="https://github.com/user-attachments/assets/d396498f-6090-4876-8b85-14dee42d6a8d" />

Mar-quay286 · 4 months ago

Thank god more than one person encountered this.

LLjo · 4 months ago

same

2pai · 4 months ago

same

rsleziakdev · 4 months ago

Guys, try swapping off extra usage if you have it on (you can see it also when you go to /models).
Then, after swapping off, i changed my model to haiku (the only model that under /model didnt say Extra usage).

And it worked!
Then i swapped back to opus and all good.

VivianMeally · 4 months ago

same, switching models does not help for me.

<img width="512" height="265" alt="Image" src="https://github.com/user-attachments/assets/3627a527-71c9-47b9-ba03-0516c5ea3831" />

Im using Cloud Code CLI under MacOS

jonahharris · 4 months ago

same; cli on MacOS

<img width="498" height="354" alt="Image" src="https://github.com/user-attachments/assets/10620b5c-9c2d-4f02-ba4c-9cbae1d3ad8e" />

OdAlessio · 4 months ago

To fix the "Rate limit reached" bug, swap the model on startup:

  1. claude --model claude-sonnet-4-6
  2. /model claude-opus-4-6

This worked for me.

ghannamX · 4 months ago

I changed the model from sonnet to claude-opus-4-6 and it worked !

vjcharles · 4 months ago
I changed the model from sonnet to claude-opus-4-6 and it worked !

Thanks for the workaround. Does this reset the context?

nm-dcs · 3 months ago

thanks, worked as suggested, was able to compact my conversation and rescue the session by switching models

Kaspre · 3 months ago

Interesting. Things were working great with the Max 5x plan, but I started hitting session and weekly limits and upgraded to the Max 20x plan. Now I have better usage limits, but suddenly I'm hitting these "API Error: Rate limit reached" roadblocks extremely often, sometimes right after I've just sat down at the computer and only sent the second prompt of the session. It doesn't make any sense - does the 20x plan have lower RPM/ITPM/OTPM than the 5x plan?? I'm tempted to downgrade back to Max 5x; I'll have to take more breaks due to the usage limits, but at least the sessions were all working fine with no Rate limit errors. Has anyone had a similar experience? Did downgrading back to the Max 5x plan work for anyone?