What do you do when Claude Code runs out of quota? First, figure out which gate you hit. Pro and Max both have two limits, a "5-hour window" and a "weekly limit," and the Claude web app, desktop app, and Claude Code all share the same quota. The "20x" in Max 20x refers, per the official wording, to each 5-hour window being 20 times Pro's, not to the weekly total being 20 times larger. If you run out of the 5-hour window, just wait for the reset. If you run out of the weekly limit and don't want to stop working, switch Claude Code to an API Key. It bills by usage and isn't subject to the subscription's 5-hour and weekly limits.
Takeaway
| Situation | What to do |
|---|---|
| 5-hour window used up | Wait for the window to reset, or stretch what you have with /compact, a fresh session, or a switch to Sonnet 5.5 |
| Weekly limit used up | Wait for the fixed weekly reset time, or switch Claude Code to an API Key and keep working |
| Want to know how much is left | On a subscription account, check /usage and Settings > Usage on the website; with an API Key, /usage shows only the current session's usage |
From the Anthropic Help Center: "Paid plans have two types of usage limits: a session limit that resets every five hours, and weekly limits that reset once every week." Source: How do usage and length limits work?
"20x" refers to the 5-hour window. The original text: "Max 20x includes 20 times the Pro plan's per-session usage allowance." "Max plans also have a weekly usage limit that applies across all models." Source: What is the Max plan?
Claude and Claude Code share quota. The original text: "Both Pro and Max plans have a five-hour session limit and a weekly limit. Max plans also have a separate weekly limit for Fable. These limits are shared across Claude and Claude Code, meaning all activity in both tools counts against the same limits." Source: Use Claude Code with your Pro or Max plan
How many times Pro is the Max 20x weekly limit, really?
The official docs only say the 5-hour window is 20x and don't publish a multiplier for the weekly limit. User measurements come in well below 20:
- According to user reports, the Max 20x weekly limit "works out to only about 9.7 times Pro's" in testing, and in their words, "the 5-hour window and the weekly limit are two separate gates" (@JkwuRmsl).
- According to user reports, "The \"20x\" doesn't mean you get 20 times more Claude for the whole week. It only means each 5 hour session is 20 times bigger than Pro's." The same user says the 20x weekly limit is only about double Max 5x (@buildwithhassan).
So before upgrading to Max 20x, think about which limit you usually hit: the 5-hour window or the weekly limit. If you mostly hit the 5-hour window, 20x is very useful. If you often hit the weekly limit, the extra headroom isn't as large as the name suggests.
How to check your remaining quota
| Method | What you can see |
|---|---|
| /usage | Usage for the current session; on a subscription account, it also shows plan quota usage |
| /status | Version, model, account, and connection info |
| Settings > Usage on the website | Time of the next reset |
From the Claude Code docs: /usage "Show session cost, plan usage limits, and activity stats. On a Pro, Max, Team, or Enterprise plan, includes a breakdown of what counts against your plan limits"; /status "Open the Settings interface on the Status tab, showing version, model, account, and connectivity." /cost and /stats are both aliases for /usage. Source: Claude Code Docs: Commands.
From the Help Center: "The weekly limit resets at a fixed time each week that is assigned to your account. Your reset day and time stay the same regardless of when you start using Claude or when your subscription begins … You can see your next reset time in Settings > Usage."
Hands-on: what /status and /usage show when you use an API Key
We ran both commands on Claude Code 2.1.308 in a clean, isolated HOME, using a global settings.json pointed at an AI Code With API Key.
At startup, the title bar shows API billing right after the model name:
Claude Code v2.1.308
Opus 5.5 · API Usage Billing
In interactive mode, we typed /status and the Status tab opened within 3 seconds (screenshot excerpt):
Version: 2.1.308
Auth token: ANTHROPIC_AUTH_TOKEN
Anthropic base URL: https://api.aicodewith.ai
Model: Default (claude-opus-5-5)
Setting sources: User settings
We asked one quick question, then typed /usage, and the Usage tab opened within 3 seconds (screenshot excerpt, dollar amount lines omitted):
Session
Total duration (API): 5s
Total duration (wall): 29s
Total code changes: 0 lines added, 0 lines removed
Usage by model:
claude-opus-5-5: 8 input, 138 output, 10.4k cache read, 2.6k cache write
Bottom line: when you go through an API Key, /usage only shows stats for the current session. The subscription's 5-hour window and weekly quota progress bars don't appear, and /status shows ANTHROPIC_AUTH_TOKEN and a custom URL, with no subscription account info.
Running these two commands with the non-interactive mode claude -p gives different results:
/status isn't available in this environment.
claude -p "/usage" returns in 0.4 seconds with session stats only (no requests had been sent yet, so everything is 0):
Total duration (API): 0s
Total duration (wall): 0s
Total code changes: 0 lines added, 0 lines removed
Usage: 0 input, 0 output, 0 cache read, 0 cache write
To check your quota in a script, use /usage. /status only works in interactive mode.
Why usage has been dropping fast lately
1. According to SemiAnalysis, some Max accounts are in an A/B test. SemiAnalysis posted on X on October 22: “We detected an A/B test going on that DECREASES your monthly API-value by ~20% while INCREASING your 5h usage limits by ~20%. This only affects SOME” (original SemiAnalysis post). Reportedly, they compared two Max 20x accounts, and one had a 5-hour window about 19% larger and a weekly quota about 20% smaller (Tech City Authority).
Anthropic has not confirmed the test. Reportedly, before SemiAnalysis posted, Anthropic's Boris Cherny replied to a user with “No changes on our end,” and Lydia Hallie of the Claude Code team also said “our limits haven't changed” (Tech City Authority). Both replies predate the SemiAnalysis post.
Who this hits hardest: the 5-hour window can reset several times a day, so heavy users hit the weekly quota first, and a 20% smaller weekly quota is a real loss. People who only occasionally hit the 5-hour window may actually find it roomier.
2. Resuming a long conversation that has sat idle is expensive. Users report that the Claude Code client showed a warning before resuming a long conversation (@pumpccc, Opus 5.5):
This conversation has been inactive for 3h 4m and is 358.4k tokens long. Resuming it will use about 7% of your 5-hour usage limit.
In other words, just continuing an old 350K-token conversation eats roughly 7% of the 5-hour window up front.
3. Quota is shared between the web app and Claude Code. The more you chat on the web during the day, the less Claude Code has available at night.
How to save quota
- Run /compact on long conversations. Per the docs, it summarizes the conversation to free up space. If a conversation is already long, compact first and then continue. For the idle auto-compaction toggle, see “What Is Claude Code Idle Compaction”.
- Start a fresh session for long ones that have gone idle. Don't resume an old conversation with hundreds of thousands of tokens. Use /clear to open a new session, write the key points into a handoff file, and pick up from there. For how to do it, see “How Do You Hand Off a Half-Finished Claude Code Task to Codex? Use handoff.md to Pass Context”.
- Use Sonnet 5.5 for everyday tasks. Switch with /model claude-sonnet-5-5, and switch back to Opus 5.5 for hard problems. For how to choose, see “Which Model to Use in Claude Code” and “Claude Sonnet 5.5 vs Opus 5.5”.
- Run fewer parallel sub-agents. Each sub-agent has its own context, so running many at once stacks up quota usage.
- Watch out for Fast Mode. For how to enable it and its limits, see “How to Use Claude Opus 5.5 Fast Mode”.
From the Help Center: “Your usage is affected by several factors, including the length and complexity of your conversations, the features you use, which Claude model you're chatting with, and the effort level you've selected.”
Out of quota? Switch to an API Key
Once your subscription quota runs out, the official options are to wait for the reset, enable usage credits, or switch to a Console account and use the API. You can also point Claude Code at an AI Code With API Key: it's pay-as-you-go and isn't bound by the subscription's 5-hour window or weekly quota.
From the Help Center: “Switch to a Claude Console account and purchase API usage credits for intensive coding sprints.” “Wait until your usage limits reset.” Source: Use Claude Code with your Pro or Max plan
Step 1: Create an API Key
Step 2: Write the global settings.json
Open ~/.claude/settings.json and fill in the following under env (ANTHROPIC_BASE_URL without /v1):
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.aicodewith.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-你的Key"
}
}
Restart Claude Code. If the title bar shows “API Usage Billing” and the Auth token line in /status is ANTHROPIC_AUTH_TOKEN, you're running on the Key. For field descriptions and common issues, see “How Do You Connect Claude Code to a Third-Party API? A Guide to Base URL, API Key, and Model Configuration”.
To switch back to the subscription, delete those two lines from settings.json, then run claude login in your terminal and sign in with your Pro or Max account.
FAQ
When does the weekly quota reset?
At a fixed time each week. That time is assigned to your account and has nothing to do with when you started using it or when you subscribed. You can see the next reset time under Settings > Usage on the website.
When does Claude's 5-hour limit start counting?
The official docs say the 5-hour window “resets every five hours.” Once you use it up, just wait for the reset. During that time both the Claude web app and Claude Code are restricted, since they share the quota.
Can I use a subscription and an API Key at the same time?
Claude Code uses only one at a time. If settings.json has ANTHROPIC_AUTH_TOKEN and a URL configured, it uses the Key. Remove them and run claude login to sign in to a subscription account, and it uses the subscription. You can use the subscription during the day and switch to the Key when it runs out.
Can the same Key be used in Codex?
Yes. Just set the URL and Key in ~/.codex/config.toml. See “Codex config.toml Configuration Guide”. For Codex's own quota rules, see “How Codex Charges and Why Its Quota Drops So Fast”.
Sources
- Claude Help Center: How do usage and length limits work?
- Claude Help Center: What is the Max plan?
- Claude Help Center: Use Claude Code with your Pro or Max plan
- Claude Code Docs: Commands
- Original SemiAnalysis post
- Tech City Authority: Anthropic is reportedly A/B testing Claude Max usage limits
- @JkwuRmsl, @buildwithhassan, @pumpccc
