Skip to content

CLI returns "API Error: Rate limit reached" on every command including logout (native binary, Max plan) #27336

Closed

Description

@matthiasdebernardini

Bug Description

Claude Code CLI v2.1.49 (native binary install) immediately returns "API Error: Rate limit reached" on every command, including claude logout. The CLI is completely unusable.

Claude Code Desktop app works fine on the same machine and account.

Environment

  • Claude Code version: v2.1.49 (native binary install via curl -fsSL https://claude.ai/install.sh | sh)
  • Plan: Claude Max (Opus 4.6, 1M context)
  • OS: macOS 26.3 (Build 25D125)
  • Architecture: Apple Silicon (M1 Pro, arm64)
  • Shell: Zsh with oh-my-zsh

Steps to Reproduce

  1. Open terminal
  2. Run claude → "API Error: Rate limit reached"
  3. Run claude logout → "API Error: Rate limit reached"

Any command triggers the same error immediately.

Expected Behavior

  • claude should start an interactive session
  • claude logout should not make API calls that can be rate-limited

Actual Behavior

Every command, including logout, returns "API Error: Rate limit reached" before doing anything useful.

Troubleshooting Attempted

  • claude logout → same rate limit error
  • Checked ~/.claude/.credentials.json → file does not exist (auth is in macOS Keychain)
  • Checked for stale ANTHROPIC_API_KEY env var → none set
  • Desktop app works fine with the same account

Additional Context

  • No .credentials.json file in ~/.claude/ (expected for Keychain-based auth)
  • The error appears instantly, not after extended usage
  • This has persisted across sessions — it's not a temporary rate limit

Activity

  1. github-actions commented on Feb 21, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] Max plan: CLI stuck on 'API Error: Rate limit reached' with weekly usage at 91% #26812
    2. Session permanently stuck on 'Rate limit reached' after transient rate limit #26699
    3. [BUG] Max x20: CLI still shows Rate limit reached after weekly reset time passed #26821

    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

  2. Marviel commented on Feb 21, 2026

    @Marviel

    This just happened to me as well.

    === Claude Code ===
    2.1.50 (Claude Code)
    === OS ===
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 22.04.5 LTS
    Release:        22.04
    Codename:       jammy
    === Arch ===
    x86_64
    === Shell ===
    /bin/bash
    === Node ===
    v20.20.0
    === npm ===
    10.8.2
    === Install method ===
    /home/ubuntu/.local/bin/claude
    === API Key env ===
    (not set)
    

    EDIT:

    This was resolved for me — the issue was caused by selecting the sonnet 1M model, which isn't available on the Claude Max plan. Instead of returning a clear "model not available" error, the CLI returns "API Error: Rate limit reached," which is misleading. The fix was switching to a supported model. Leaving this open as the error message should be improved — a model availability error shouldn't surface as a rate limit error.

  3. ShakataGaNai commented on Feb 21, 2026

    @ShakataGaNai

    Same. But I'm on standard Opus.

  4. depoledna commented on Feb 22, 2026

    @depoledna

    Same issue here, im using Max plan and I was running opus in 1m context window until rate limited. 200k models work fine for me in CLI. I did not find anything when the rate limit is reset for this exact model as the dashboard does not show the Claude Code limits I assume...

  5. jizhi0v0 commented on Feb 25, 2026

    @jizhi0v0

    This just happened to me as well.我也刚经历过这种情况。

    === Claude Code ===
    2.1.50 (Claude Code)
    === OS ===
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 22.04.5 LTS
    Release:        22.04
    Codename:       jammy
    === Arch ===
    x86_64
    === Shell ===
    /bin/bash
    === Node ===
    v20.20.0
    === npm ===
    10.8.2
    === Install method ===
    /home/ubuntu/.local/bin/claude
    === API Key env ===
    (not set)
    

    EDIT:编辑:

    This was resolved for me — the issue was caused by selecting the sonnet 1M model, which isn't available on the Claude Max plan. Instead of returning a clear "model not available" error, the CLI returns "API Error: Rate limit reached," which is misleading. The fix was switching to a supported model. Leaving this open as the error message should be improved — a model availability error shouldn't surface as a rate limit error.这个问题后来解决了——问题是因为选择了Sonnet 1M型号,而Claude Max套餐没有这个型号。它没有返回明确的“型号不可用”错误,而是返回“API 错误:速率上限已达”,这具有误导性。解决办法是切换到支持的型号。保持开放状态,错误信息应当改进——模型可用性错误不应以速率限制错误的形式出现。

    This helped me; I chose the OPUS 1m plan, which wasn't supported by my MAX 5X plan.

  6. nromey commented on Mar 3, 2026

    @nromey

    I'm now receiving this error. I was working just fine throughout the day, I'm way under my limits and now get the error. Very odd indeed.

  7. MichalKantor commented on Mar 10, 2026

    @MichalKantor

    SOLVED
    I had same issue - only in CLI in cursor on mac.
    Solved by

    1. uninstalling claude: npm uninstall -g @anthropic-ai/claude-code
      but claude still works in terminal
    2. finally I had mess in installations (two installations since claude changed npm installation) : which -a claude
      It showed more installations so:
    3. Removed manually:
      rm -f ~/.local/bin/claude
      rm -rf ~/.local/share/claude
      rm -rf ~/.claude
      (eventually: bun uninstall -g @anthropic-ai/claude-code)
    4. New Installation :
      npm install -g @anthropic-ai/claude-code

    Problem was that claude used API based account on claude.com instead of my max plan on claude.ai
    Logging in and out didn't change anything, but finally reinstalling solved the problem.

    Regards,
    Michal

  8. ssolders commented on Mar 24, 2026

    @ssolders

    Was resolved for me with a /logout and then restarting claude cli. Only restart did not resolve it.
    This happened to me after I downgraded from max to pro

  9. ashwin-ant commented on Apr 19, 2026

    @ashwin-ant
    Collaborator

    This was fixed in v2.1.88 — Fixed misleading "Rate limit reached" message when the API returned an entitlement error (e.g. 1M context without Extra Usage) — now shows the actual error with actionable hints (/extra-usage or /model to switch). If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

  10. github-actions commented on Apr 26, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  11. locked as resolved and limited conversation to collaborators on Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions