claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] "API Error: Rate limit reached" repeatedly despite having significant quota remaining.

Open Tsunami-max opened this issue 8 months ago • 6 comments

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?

Bug Description

Claude Code is hitting "API Error: Rate limit reached" repeatedly despite having significant quota remaining. The usage dashboard confirms low utilization. This is happening on a Saturday morning (off-peak) with freshly renewed credits.

Environment

  • Plan: Max (with €150 extra usage limit, €57.22/€150 used)
  • Date/Time: Saturday, March 28, 2026, ~07:00 CET (06:00 UTC)
  • Session usage: 15% (resets in 3hr 3min)
  • Weekly usage: 8% (resets Fri 6:00 AM)
  • Sonnet usage: 0%
  • Claude Code command: claude --resume 372d208e-f3fb-4dfe-8eb6-588e7de841c0 --dangerously-skip-permissions
  • Token count at time of errors: ~609,855 tokens
  • Model: Opus 4.6

What Happened

  1. Asked Claude Code to trace case creation logic in a Python backend (trust-relay-workflow/backend/app/api/case_crud.py)
  2. Claude Code started reading files and running bash grep commands — nothing intensive, no parallel agents, no large generations
  3. After ~34 seconds of work, hit first API Error: Rate limit reached
  4. Every subsequent action (even just Read 160 lines or Read 100 lines) immediately triggers the same error
  5. Typing continue results in another rate limit error within seconds
  6. This cycle repeated 5+ times in a row — completely unable to work

What Should Happen

With 15% session usage and 8% weekly usage on a Max plan during off-peak weekend hours, basic file reading operations should not trigger rate limits.

Evidence

  • Dashboard screenshot showing 15% session / 8% weekly / 0% Sonnet: [attached]
  • Terminal screenshot showing repeated rate limit errors on simple read operations: [attached]

Additional Context

  • This is on a Saturday — outside Anthropic's stated peak-hour throttling window (weekdays 5AM–11AM PT)
  • Credits just renewed
  • Same workloads ran fine previously on this plan
  • Aware of the recent prompt caching bug that caused similar phantom usage drain — this looks like a recurrence
  • The mismatch between dashboard (15%) and actual enforcement (hard blocked) suggests the rate limiter and the usage meter are out of sync

Impact

Completely unable to work. Paying for Max plan and getting zero value. This is a production workflow blocker.

What Should Happen?

I should be able to work, critical projects are on hold!

Error Messages/Logs


Steps to Reproduce

just resumed my session, "continue" and had api rate limit almost instantly a few times

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.86

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Tsunami-max avatar Mar 28 '26 06:03 Tsunami-max

Had the same issue, I solved it by switching a model, ("/model" then I pressed enter) I switched to the recommended Sonnet model by typing "/Model" then enter, it let me pick the model, I pressed enter on Sonnet and Claude got back to working.

I then wrote "/Model" again and switched back to Opus 4.6 and it was working, no more the API error.

jjames-cell avatar Mar 28 '26 12:03 jjames-cell

Hello, I have exactely the same issue.

roomi-fields avatar Mar 30 '26 18:03 roomi-fields

My Claude says your issue shares the same pattern as #38239, #37917, #39465, #39938, #39948, #40079, #40085. But I'm not sure whether Anthropic has fixed these for you yet, as I haven't been able to update with new information for the past 4 days.

marlvinvu avatar Mar 31 '26 17:03 marlvinvu

A user in #40584 may have found the root cause for your rate limit issue. Two findings:

  1. The "Rate limit reached" error is generated CLIENT-SIDE by Claude Code, not by the Anthropic API. Evidence: model: "", input_tokens: 0, output_tokens: 0 — no request was ever sent to the API. The client-side rate limiter counts the entire context size against the token budget, so large/long sessions get permanently blocked even when the API is fully available.
  2. The client-side rate limiter MULTIPLIES estimated context tokens by the number of concurrent requests. So 3 subagents × 400K context = 1.2M tokens counted against budget — even though the context is cached and shared. This means as your session grows, fewer concurrent agents can run before hitting the false limit.

See #40584 for the full analysis with log evidence from two independent occurrences.

marlvinvu avatar Apr 02 '26 08:04 marlvinvu

the dashboard's 15% session / 8% weekly tracks the rolling quota. the 429 rate_limit_error is the per-minute ITPM throttle, separate bucket. opus 4.6 with ~609k tokens of context ships hundreds of k of input through ITPM on every tool round-trip, so even at 8% weekly you can saturate the per-minute window in under 30 seconds. the anthropic-ratelimit-* response headers expose both counters, but the in-app meter only graphs the rolling quota, which is why the numbers read out of sync. it's not a bug in the meter, it's two different limits sharing one error string.

m13v avatar May 02 '26 15:05 m13v

News on this ?

richibrics avatar May 20 '26 15:05 richibrics