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

API Error: Rate limit reached

Open ppf opened this issue 9 months ago • 10 comments

Bug Description

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.45
  • Feedback ID: 69b46464-12e0-4bb8-9d1a-710144248c02

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/storm/.local/share/claude/versions/2.1.45 (expected in multi-process scenarios)\n    at azR (/$bunfs/root/claude:3442:2098)\n    at BjA (/$bunfs/root/claude:3442:1209)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:30.464Z"},{"error":"Error: LSP server plugin:php-lsp:intelephense failed to start: Executable not found in $PATH: \"intelephense\"\n    at start (/$bunfs/root/claude:2317:22314)\n    at async H (/$bunfs/root/claude:2317:24762)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: LSP server plugin:typescript-lsp:typescript failed to start: Executable not found in $PATH: \"typescript-language-server\"\n    at start (/$bunfs/root/claude:2317:22314)\n    at async H (/$bunfs/root/claude:2317:24762)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: LSP server plugin:pyright-lsp:pyright failed to start: Executable not found in $PATH: \"pyright-langserver\"\n    at start (/$bunfs/root/claude:2317:22314)\n    at async H (/$bunfs/root/claude:2317:24762)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: LSP server plugin:lua-lsp:lua failed to start: Executable not found in $PATH: \"lua-language-server\"\n    at start (/$bunfs/root/claude:2317:22314)\n    at async H (/$bunfs/root/claude:2317:24762)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: Executable not found in $PATH: \"intelephense\"\n    at spawn (unknown)\n    at spawn (node:child_process:667:35)\n    at spawn (node:child_process:14:39)\n    at start (/$bunfs/root/claude:2317:20844)\n    at H (/$bunfs/root/claude:2317:24762)\n    at _ (/$bunfs/root/claude:2317:32538)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: Executable not found in $PATH: \"typescript-language-server\"\n    at spawn (unknown)\n    at spawn (node:child_process:667:35)\n    at spawn (node:child_process:14:39)\n    at start (/$bunfs/root/claude:2317:20844)\n    at H (/$bunfs/root/claude:2317:24762)\n    at _ (/$bunfs/root/claude:2317:32538)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: Executable not found in $PATH: \"pyright-langserver\"\n    at spawn (unknown)\n    at spawn (node:child_process:667:35)\n    at spawn (node:child_process:14:39)\n    at start (/$bunfs/root/claude:2317:20844)\n    at H (/$bunfs/root/claude:2317:24762)\n    at _ (/$bunfs/root/claude:2317:32538)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: Executable not found in $PATH: \"lua-language-server\"\n    at spawn (unknown)\n    at spawn (node:child_process:667:35)\n    at spawn (node:child_process:14:39)\n    at start (/$bunfs/root/claude:2317:20844)\n    at H (/$bunfs/root/claude:2317:24762)\n    at _ (/$bunfs/root/claude:2317:32538)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: Failed to start LSP server plugin:php-lsp:intelephense: Executable not found in $PATH: \"intelephense\"\n    at <anonymous> (/$bunfs/root/claude:2317:32560)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: Failed to start LSP server plugin:typescript-lsp:typescript: Executable not found in $PATH: \"typescript-language-server\"\n    at <anonymous> (/$bunfs/root/claude:2317:32560)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: Failed to start LSP server plugin:pyright-lsp:pyright: Executable not found in $PATH: \"pyright-langserver\"\n    at <anonymous> (/$bunfs/root/claude:2317:32560)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: Failed to start LSP server plugin:lua-lsp:lua: Executable not found in $PATH: \"lua-language-server\"\n    at <anonymous> (/$bunfs/root/claude:2317:32560)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-02-18T05:14:32.999Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"Extra usage is required for long context requests.\"},\"request_id\":\"req_011CYExsNitfPvqgdFYrKXJa\"}\n    at generate (/$bunfs/root/claude:327:9006)\n    at makeRequest (/$bunfs/root/claude:366:5435)\n    at…

Note: Content was truncated.

Image

ppf avatar Feb 18 '26 05:02 ppf

Image

joeydangelo avatar Feb 19 '26 02:02 joeydangelo

Image Image

Anthropic recently distributed $50 in free credits alongside the Claude Opus 4.6 launch. I used mine and didn't notice when I hit the limit — that part is on me. But as you can see in the screenshots above, with extra usage enabled, spending went past 100% without any warning. After exceeding my $50 limit by $2.56, instead of stopping or notifying me, the system started throwing rate limit errors. This is a real UX issue: when you exceed your credit limit, the system should either automatically disable extra usage or at the very least warn the user before blocking requests. Silently going over the limit and then throwing cryptic API errors is a frustrating experience, especially when the fix isn't obvious. This may be intentional by design, or it may simply be an oversight — but either way, it's worth addressing. For anyone running into this issue: Go to console.anthropic.com → Billing → and disable "Allow extra usage". After that, you can either pay the overage and return to the terminal, or continue without paying by switching to Claude Code via an IDE extension such as VSCode. Either way, you'll be protected from unexpected charges and errors going forward.

(Apologies for the long comment — I'm adding this note not for attention, but to help others find this thread more easily. The goal is simply to make this solution discoverable for anyone searching "API Error: Rate limit reached" or "Extra usage is required for long context requests." through a search engine or an AI tool.)

morphaven avatar Feb 19 '26 09:02 morphaven

I'm seeing the same thing. I can chat, but not use the VS Code plugin or claude tool.

Image

It's been over 12 hours since my limit reset and /usage seems to think I'm ok, but any prompt just gets: API Error: Rate limit reached. I'm on Tahoe 26.3 on Apple silicon.

claude.ai shows my limit has reset and I can use it normally there.

Troubleshooting steps I've tried with no success:

  • Restarted VS Code
  • Full machine reboot
  • Signed out and back in to the Claude Code extension
  • Confirmed ANTHROPIC_API_KEY is not set in my environment, so Claude Code should be authenticating via my account login
  • Attempted to contact support via the in-Console "Get help" flow — clicking the option does nothing
  • Emailed [email protected] — received an auto-reply stating it's an unmonitored inbox

The discrepancy between claude.ai (limit reset) and Claude Code (limit not reset) suggests this is an account-level state issue rather than a client-side bug. Happy to provide any additional details if it helps diagnose.

AtomBoy avatar Feb 20 '26 17:02 AtomBoy

@AtomBoy @morphaven @ppf the way I was able to fix this was changing my model to one of the non 1M context models

joeydangelo avatar Feb 20 '26 17:02 joeydangelo

@spxangelo Thanks for the tip — switching to a non-1M context model does work around the issue, confirmed.

That said, I want to share some broader frustration. I've been an Anthropic supporter for a long time — even before Claude Code launched, I was subscribing through Cursor. Since Claude Code came out, I've been on the $200/month plan. But recent experiences like this one are making me seriously question that.

The issue isn't just this bug — it's a pattern. Silently exceeding credit limits with no warning, cryptic API errors instead of clear messaging, and premium features that quietly break for paying users. A perfect example: instead of expanding the context limit over time, they're actually shrinking it — for Sonnet, anything above 250k context now triggers extra usage charges, meaning you're paying separately for 1M context. That's absurd. If they had launched with 250k from the start, there would have been far less backlash. It took me a full day to figure this out — the 1M context model was silently accumulating extra usage charges through the API the entire time.

This is nearly the last straw for me — I'm seriously considering cancelling my Anthropic subscription. My trust in Anthropic has been eroding for the past 3 months. I'm actively looking at running open-source models locally, either with a few Nvidia DGX machines or a Mac Studio (Ultra).

US AI companies are heading down an increasingly bad path. China is going to dominate this space — and honestly, I hope they do. Let competition grow.

morphaven avatar Feb 20 '26 18:02 morphaven

I can switch to Haiku and get 'Prompt is too long' in response to 'How are you?' in a new chat.

AtomBoy avatar Feb 20 '26 20:02 AtomBoy

Root cause found & fixed — posting in case it helps others.

The issue was a large file referenced via @ syntax in CLAUDE.md. In my case it was a TLE satellite data file (Space-Track.all.3le.txt) several megabytes in size. Claude Code was silently attempting to load it into context at session start, exhausting the rate limit before a single message was sent. Removing the @ reference immediately resolved the problem.

This was very difficult to diagnose because:

  • claude.ai showed the rate limit as reset and worked normally there
  • The error appeared on session start with no messages sent
  • The problem followed the project across machines, which looked like an account or network issue
  • Standard fixes (restart, reboot, re-authenticate) had no effect

Suggested improvement: Rather than returning a generic API Error: Rate limit reached, Claude Code should detect when a @-referenced file is too large to include in context and surface a specific error like: "CLAUDE.md references a file that is too large to include in context: [filename]". This would save users significant troubleshooting time. There actually was a message bout the big file in the command line tool but I didn't connect that message to the API Limit message.

AtomBoy avatar Feb 20 '26 23:02 AtomBoy

changing my model to one of the non 1M context models

this fixed my issue today, thx. got that one on ubuntu 24

alloky avatar Feb 22 '26 15:02 alloky

Additional reproduction case: parallel Read tool calls → persistent session loop

Triggered by asking Claude to read 7 files (~2MB total) in parallel. The local reads succeeded, but returning all tool results to the API in a single request failed. Rather than recovering gracefully, the session entered a persistent retry loop — every subsequent input including "hi" returned the same error indefinitely. Only resolved by session restart (destroying all context).

This is distinct from the billing/credit cases above — no extra usage was enabled, and the error persisted through the session regardless of wait time. The root issue appears to be absent graceful degradation when a tool result batch exceeds API limits, combined with inaccurate error labeling that makes self-diagnosis impossible.

Detailed bug report with chat history log: 260313_Claude_Code_Bug_Report.md 260313_API_Limit_Error_Chat_History.txt

Supporting the broader ask: better error messaging that distinguishes rate limits, token/size limit failures, and session state failures.

jsantin129 avatar Mar 13 '26 06:03 jsantin129

This is fixed as of Claude Code 2.1.89, so we're closing this issue. If you disagree, let us know here and we can re-open it. Thanks for reporting!

bpasero-ant avatar Nov 29 '26 17:11 bpasero-ant