Surface rate limit details in error messages

Resolved 💬 3 comments Opened Mar 16, 2026 by alex-gon Closed Mar 20, 2026

Feature Request

When hitting a rate limit, Claude Code currently displays only:

API Error: Rate limit reached

The Anthropic API returns detailed rate limit headers in the 429 response:

  • anthropic-ratelimit-requests-remaining
  • anthropic-ratelimit-input-tokens-remaining
  • anthropic-ratelimit-output-tokens-remaining
  • anthropic-ratelimit-input-tokens-limit / output-tokens-limit
  • retry-after

These tell you which limit was hit (RPM, input TPM, or output TPM) and when it resets.

Proposed Behavior

Surface these details in the error message. For example:

API Error: Rate limit reached (output tokens per minute exceeded)
Limit: 80,000 OTPM | Remaining: 0 | Retry in: 12s

Why This Matters

  • Debugging is guesswork today. Without knowing which limit was hit, users can't make informed decisions about how to adjust their usage.
  • Token-heavy operations (e.g., custom skills that generate large JSON output) can hit output TPM limits while input TPM and RPM have plenty of headroom. Knowing this would help users optimize the right thing.
  • Team plans share limits across an org. When multiple Claude Code instances are running, understanding which limit is saturated helps teams coordinate usage.

Additional Context

Discovered while running a custom skill that generates 16x16 pixel art as JSON (~2,500 output tokens per invocation). The skill consistently hit rate limits when running inline but worked fine in a context: fork subagent (lower input token overhead). Without the rate limit details, it took significant investigation to understand what was happening.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗