How to Do Rate Limiting on Claude Code (and Avoid a 5-Hour Lockout)

In this article

Claude Code enforces usage-based rate limits tied to your subscription tier (Pro or Max). When you hit the limit, you're locked out for up to 5 hours, with no warning mid-task. The most reliable way to avoid this on macOS is Usagebar, which shows live usage in your menu bar and alerts you at 50%, 75%, and 90%. There's a free tier and a pay-what-you-want model, including free access for students.

  • Claude Code usage resets on a rolling 5-hour window, not at midnight
  • Pro plan users share limits across claude.ai and Claude Code combined
  • The /usage slash command gives an in-session snapshot but doesn't persist

What is rate limiting in Claude Code?

Rate limiting in Claude Code is Anthropic's mechanism for capping how many tokens or messages you can send within a given time window. Unlike a traditional API rate limiter measured in requests-per-minute, Claude Code's limits are usage-based: they accumulate across all your activity (prompts, context size, tool calls) and reset on a rolling 5-hour cycle.

According to Anthropic's usage limit best practices, limits vary by plan and are designed to ensure fair access across all users. When you exceed your limit, Claude Code pauses and displays a message telling you how long until the window resets.

This is especially painful if you're mid-PR, wrapping up a complex refactor, or running an agentic task that takes 20-30 minutes to complete. The lockout doesn't care about your deadline.

How to check your current rate limit status in Claude Code

There are three practical ways to check where you stand before you hit the wall:

  • The /usage slash command: Type /usage in any Claude Code session for a snapshot of your current usage within that session. It's fast but only shows in-session data, not your cumulative rolling window. See the full list of Claude Code slash commands for more built-in tools.
  • claude.ai/settings/usage: Your account's usage dashboard shows cumulative token use and resets. You'll need to leave your terminal and open a browser, which breaks your flow.
  • Usagebar: A macOS menu bar app that displays your Claude Code usage percentage in real time, without context switching. Sends notifications at 50%, 75%, and 90% thresholds so you can finish what you're doing before the lockout hits.

For a deeper walkthrough of the dashboard approach, see how to check your Claude Code usage limits.

How Claude Code rate limits work by plan

According to Anthropic's documentation on using Claude Code with Pro or Max, your plan determines your ceiling:

PlanUsage poolClaude Code accessShared with claude.ai?
ProStandardYesYes (combined limit)
Max (5x)5x ProYesYes
Max (20x)20x ProYesYes
API (pay-as-you-go)Spending-basedVia API keyNo

Pro plan users should be aware that web activity on claude.ai counts against the same pool as Claude Code. A heavy afternoon of chat sessions will eat into your evening coding session. See does Claude Code usage affect Pro limits for the full breakdown.

Practical strategies to manage rate limits in Claude Code

You can't disable rate limits, but you can work smarter around them. Here are the strategies that matter:

1. Reduce token consumption per task

Large context windows burn through your limit faster. Keep your working context lean: use /clear between unrelated tasks, avoid loading entire codebases when you only need a specific module, and be explicit in your prompts to reduce back-and-forth. The guide on how to reduce Claude Code token usage covers this in detail.

2. Monitor usage proactively (not reactively)

The worst time to discover your limit is mid-task. Check /usage before starting long agentic workflows, complex refactors, or anything you can't easily pause. If you're already above 70%, consider finishing minor tasks first, or wait for the window to reset.

For automated, ambient monitoring without leaving your terminal, Usagebar is the most efficient option on macOS. It reads your credentials securely via the macOS Keychain, never storing them in plaintext, and keeps the usage percentage visible in your menu bar at all times.

3. Know when your window resets

Claude Code uses a rolling 5-hour window, not a fixed daily reset. This means the reset time shifts based on when you started using it. Understanding when your Claude Code usage resets helps you plan intensive sessions, especially if you're working on a deadline.

4. Use the API key path for heavy workloads

If you're running large automated pipelines, batch processing, or building with Claude Code agent skills, an Anthropic API key with pay-as-you-go pricing removes the hard usage ceiling. You pay per token rather than hitting a wall. This is not a replacement for interactive development sessions, but it's the right tool for CI/CD or autonomous agents.

5. Stagger heavy sessions with claude.ai usage

If you're on Pro and use both the web UI and Claude Code, be deliberate about when you use each. Heavy claude.ai usage in the morning means less headroom for afternoon coding. Max plan users have a significantly larger pool, making this less of a concern.

What happens when you hit the rate limit in Claude Code

Claude Code displays a rate limit error and tells you the approximate time until your window resets. Your session state is preserved, but no new prompts will execute until the limit clears. If you were mid-agentic-task (a multi-step automated workflow), the task stops where it is.

This is the scenario Usagebar is specifically designed to prevent. The 90% alert gives you enough runway to wrap up, commit your changes, or at minimum save your state before the lockout. See what to do when you hit Claude Code's rate limit for recovery steps.

How Usagebar helps with Claude Code rate limiting on macOS

Usagebar is a lightweight macOS menu bar utility built specifically for Claude Code users who need persistent usage visibility without breaking their flow. Key features relevant to rate limit management:

  • Live usage percentage displayed in the macOS menu bar at all times
  • Smart notifications at 50%, 75%, and 90% usage, giving you progressively urgent warnings
  • Reset time display so you know exactly when your 5-hour window clears
  • macOS Keychain integration for secure credential storage (no plaintext config files)
  • Pay what you want pricing, with a free option and explicit free access for students

The goal is eliminating the context switch. Instead of tabbing out to claude.ai/settings/usage or running /usage mid-session, the information is always visible in the corner of your screen. When the 90% alert fires, you know to wrap up your current task before Claude Code goes quiet.

Get Usagebar: instant download, flexible pricing, and no rate limit surprises.

Key takeaways

  1. Claude Code rate limits use a rolling 5-hour window, not a daily reset
  2. Pro plan limits are shared between claude.ai and Claude Code
  3. Use /usage for quick in-session checks; claude.ai/settings/usage for full history
  4. Reduce context size and use /clear between tasks to stretch your limit further
  5. For heavy automated workloads, an API key with pay-as-you-go is the right path
  6. Usagebar gives you ambient, always-visible usage monitoring on macOS with proactive alerts at 50%, 75%, and 90%

Sources

Never Get Locked Out Mid-Task Again

Never hit your usage limits unexpectedly. Usagebar lives in your menu bar and shows your 5-hour and weekly limits at a glance.

Get Usagebar

$9 — one-time, lifetime updates