claude-code - 💡(How to fix) Fix Rate limit blocks even /logout and basic commands despite 0% usage shown [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49196Fetched 2026-04-17 08:48:10
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Timeline (top)
labeled ×5

Error Message

API Error: Rate limit reached

Code Example

API Error: Rate limit reached
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Every command inside Claude Code immediately returns "API Error: Rate limit reached", including non-inference commands like /logout, /status, and config. The Usage tab shows 0% consumption. The rate limit fires before any actual work is done.

What Should Happen?

Non-inference commands like logout should never be blocked by rate limits. A 0% usage reading should mean no rate limiting is active.

Error Messages/Logs

API Error: Rate limit reached

Steps to Reproduce

  1. Open Claude Code in terminal (claude)
  2. Type any command: /logout, /status, or config
  3. Immediately receive "API Error: Rate limit reached"
  4. Check /status → Usage tab → shows 0%

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

2.1.59

Claude Code Version

2.1.59

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • ANTHROPIC_API_KEY not set
  • Two subscriptions active on the account
  • Previously had duplicate installations (npm residue + native), now cleaned up
  • Related issue: #41084

extent analysis

TL;DR

The issue can likely be resolved by setting the ANTHROPIC_API_KEY environment variable, as its absence may be causing the rate limit error.

Guidance

  • Verify that the ANTHROPIC_API_KEY is correctly set in the environment, as the issue mentions it is not set.
  • Check the Anthropic API documentation to ensure that the API key is required for non-inference commands.
  • Test setting the ANTHROPIC_API_KEY environment variable and then running the Claude Code commands to see if the rate limit error is resolved.
  • Review the related issue #41084 to see if it provides any additional context or solutions.

Example

No code snippet is provided as the issue does not require a code change, but rather an environment variable configuration.

Notes

The issue may be specific to the Anthropic API and Claude Code version 2.1.59, and may not be applicable to other versions or platforms.

Recommendation

Apply workaround: Set the ANTHROPIC_API_KEY environment variable, as it is likely required for the Anthropic API to function correctly, even for non-inference commands.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING