Verified against Anthropic documentation on · Updated
Claude Code usage: limits, monitoring, and quota management
Claude Code usage depends on how you sign in. With a Pro, Max, Team, or seat-based Enterprise plan, it draws on the same rolling 5-hour session limit and weekly limit as Claude on the web and desktop. With an API key, you pay per token through the Anthropic Console instead. Run /usage in Claude Code to see where you stand.
What to know first
- Claude Code isn't included on the Free plan. On paid plans, your terminal sessions and your chats come out of one allowance, so a long day of coding leaves less for the browser.
- Signing in with an
ANTHROPIC_API_KEYtakes Claude Code off your plan limits. Every token is billed at API rates instead. /usageshows your plan limits./contextshows how full the current conversation is. They're different meters, and clearing the conversation doesn't give any allowance back.- Long conversations are the expensive part, because every request resends everything before it. In our test, the same task cost about 3.4 times as much after 205,000 tokens of earlier context, measured in API-equivalent dollars.
Subscription or API key: what meters your Claude Code usage
Claude Code works the same either way. What changes is what you pay, which limits apply, and whether your chats on claude.ai feel it.
| Comparison | Subscription login (/login) | API key (ANTHROPIC_API_KEY) |
|---|---|---|
| Who uses it | Pro, Max, Team, and seat-based Enterprise members | Anyone with an Anthropic Console account |
| What you pay | Your plan's monthly fee. No per-token charges inside the included allowance. | Standard API rates for input, output, cache writes, and cache reads. |
| Limits | A 5-hour session limit and a weekly limit, plus a model-specific Opus or Sonnet limit on some accounts. | API rate limits (tokens and requests per minute) and any Console spend limit. No 5-hour or weekly cap. |
| Shared with Claude.ai? | Yes. Terminal edits and web chats on Claude.ai drain the exact same pool. | No. Your chat allowance is untouched. |
| When you run out | Claude Code stops until the reset time, unless usage credits are on. | HTTP 429 rate limit with a retry-after header, or a stop at the Console spend limit. |
What /usage shows | 5-hour and weekly bars with reset times, a usage breakdown, and session tokens. | Session tokens and an estimated dollar cost. |
If both are set up, the API key wins once you approve it. The first time an interactive session finds ANTHROPIC_API_KEY in your environment, Claude Code asks whether to use it and remembers your answer; the “Use custom API key” toggle in /config changes it later. Run /status to see which credential a session is using, and unset ANTHROPIC_API_KEY before starting Claude Code to go back to your subscription.
Checking usage in the terminal: /usage, /cost, and /stats
Run /usage in any Claude Code session. /cost and /stats open the same screen, and it runs straight away even while Claude is in the middle of a response. On a Pro plan it looks roughly like this:
/usage output; the plan bars and the usage breakdown below them vary by Claude Code version and plan.The screen has up to four parts:
- Session. Tokens by model (input, output, cache reads, cache writes), time, lines changed, and a dollar figure Claude Code works out locally at API list prices. On a subscription that figure isn't a charge; it's what the same tokens would cost on the API.
- Plan usage. Your 5-hour session and weekly limits as percentages, with reset times. These are account-wide, so they include what you've used in Claude on the web and desktop.
- Usage breakdown (Pro, Max, Team, and Enterprise). Recent usage split across skills, subagents, plugins, and individual MCP servers; flags for behaviors such as long context or cache misses once one accounts for 10% of recent usage; and rows for your heaviest
/loopand scheduled tasks. Pressdorwto switch between the last 24 hours and the last 7 days. It's built from session history on this machine, so other devices and claude.ai aren't in it. - Usage credits, when they're on: this month's spend against your limit.
The breakdown is the closest Claude Code comes to telling you what's eating your allowance. If one MCP server or a scheduled loop has a large share, start there. Settings › Usage, the statusline, and the desktop app show the same limits elsewhere, and how to check your Claude usage compares all of them.
Plan usage, context, and session cost are different numbers
Claude Code puts three numbers in front of you, and they move for different reasons. It's easy to take one for another: to expect /clear to give allowance back, or to read the dollar figure in /usage as a bill.
| Number | Where you see it | What it measures | What resets it |
|---|---|---|---|
| Plan usage (%) | /usage, Settings › Usage, statusline rate_limits | How much of your account's 5-hour and weekly allowance you've used, across Claude Code, the web, and desktop. | The scheduled reset for each window. |
| Context (%) | /context, statusline context_window | How much of the model's context window the current conversation fills: 200,000 tokens by default, 1,000,000 on models with extended context. | /clear empties it. /compact shrinks it. |
| Session cost ($) | /usage, statusline cost | What this session's tokens would cost at API list prices. An estimate, not a bill. | /clear starts it at $0. |
Context and plan usage are separate meters, but they're linked. A full context window doesn't mean you're out of allowance; what it does is set the size of every request. Claude Code sends the whole conversation each time, so a conversation at 80% of a 200,000-token window carries about 160,000 tokens into every request, most of them read from the prompt cache. Keep context small and the plan meter climbs more slowly.
On an API key, the session cost is a fair guide to what you'll be billed, though the Anthropic Console's usage page is the authoritative figure.
Claude Code usage limits by plan
Every paid plan includes Claude Code. What changes is how big the allowance is and who it belongs to: you alone on Pro and Max, each member's seat on Team and seat-based Enterprise. The usage limits reference has every plan's figures and sources; this is the Claude Code view.
| Plan & Price | Claude Code | What limits it |
|---|---|---|
Free $0 | Not included | No Claude Code access. |
Pro $20/mo | Included | Baseline 5-hour session allowance, plus a weekly limit across all models. |
Max 5× $100/mo | Included | 5× Pro per 5-hour session, plus a weekly limit. |
Max 20× $200/mo | Included | 20× Pro per 5-hour session, plus a weekly limit. |
Team $25 or $125/seat/mo | Included per seat | Standard seats get 1.25× Pro per session, Premium seats 6.25×. Weekly limits apply per member and aren't pooled. |
Enterprise, seat-based Contract | Included per seat | A per-seat 5-hour and weekly allowance, shared with Claude chat. |
Enterprise, usage-based Platform fee + usage | Included | No included allowance. Usage is billed at API rates under the organization's spend limits. |
API key Pay as you go | Any Console account | No 5-hour or weekly limit. API rate limits (tokens and requests per minute) and Console spend limits apply. |
The session limit runs on a rolling five-hour window, and the 5-hour limit guide explains how that window works and why coding sessions reach it sooner than chat.
Keeping an eye on usage while you work
/usage answers the question when you ask it. These keep the answer in view, or keep a record of it.
The statusline
Claude Code can run a script of yours and show what it prints in a bar at the bottom of the terminal. You point the statusLine property in ~/.claude/settings.json at the script, and Claude Code passes it session JSON on standard input when the session starts, after each assistant message, after /compact, and on a few other events. It runs locally and uses no tokens.
The JSON carries your model, working directory (from which scripts derive git branch and repository state), context window percentage, and session cost. Plan limits arrive as rate_limits.five_hour and rate_limits.seven_day, each with used_percentage and an epoch resets_at, but only for Pro and Max subscribers, and only after the session's first API response. Team, Enterprise, and API-key sessions don't get them, and either window can be missing on its own.
The statusline guide has a tested Bash script with jq parsing, local reset times, and copyable prompts.
The desktop app
In the Code tab of the Claude desktop app, the usage ring next to the model picker shows the same session and weekly limits without typing a command.
Team, Enterprise, and Console dashboards
- Claude Code analytics at
claude.ai/analytics/claude-codeshows Team and Enterprise admins adoption: daily active users, sessions, and contribution metrics such as lines accepted. It doesn't show anyone's remaining allowance. - The spend report in org analytics shows estimated spend per user and model, but only for usage credits. Usage inside the seat allowance isn't metered in dollars.
- The Anthropic Console is the bill for API-key usage. Its Claude Code dashboard shows spend and accepted lines per member.
Log analyzers such as ccusage
Community tools like ccusage parse the JSONL session logs Claude Code keeps in your home directory and turn them into daily, weekly, and monthly token and cost reports, including prompt-cache use and 5-hour blocks. They're good for history. They only see sessions on that machine, and their costs are list-price estimates, not plan percentages.
Claude Usage tracker
If you want your remaining 5-hour and weekly allowance on screen without stopping to type a command, the free Claude Usage tracker keeps it in your macOS menu bar or on a private localhost dashboard, with optional notifications at 10%, 5%, and 0% remaining. It reuses your local Claude Code login and sends nothing to claudeusage.dev.
Why Claude Code drains limits faster (and how to slow it down)
A chat message is usually one request to the model. A Claude Code task is a loop: Claude reads a file, runs a command, reads the output, edits, runs the tests, and each step is another request. Every one of those requests carries the whole conversation so far, including every file and command output Claude has already read. On turn 10, Claude re-processes the files loaded during turns 1 through 9.
Prompt caching keeps that from being as bad as it sounds, because most of the repeated history is read from cache at a fraction of the fresh-input price. But cached isn't free. Anthropic's cost guide makes the same point: a short question late in an all-day session is still charged for the whole conversation behind it.
What we measured
We gave Claude Code 2.1.292 the same Next.js build task on Opus 5.5 at high effort, three times in fresh sessions and three times after about 205,000 tokens of documentation had been read into the conversation. The long context was served from cache, as intended. Those runs still cost $1.5157 at the median instead of $0.4456, about 3.4 times as much, because each of the task's 9 to 26 requests reread those 205,000 tokens. Two runs carrying about 209,000 tokens of unrelated Vim documentation cost much the same ($1.4341 median). The context didn't have to be useful to be expensive.
These are API-equivalent dollars at list price. The runs were billed to promotional credits, we didn't observe the 5-hour or weekly meters, and Anthropic doesn't publish how tokens map onto them, so 3.4× is a cost ratio, not a measure of your allowance. What carries over to your plan is the mechanism. Read the full study.
Other things that add up
- Subagents. Each subagent starts with its own context window and sends its own requests, which count against the same limits as your main conversation. By default up to 20 can run at once, nested up to three layers below the main conversation, and the
/usagebreakdown shows their share. They can also protect your main context: a subagent that runs the test suite keeps the output and hands back a summary. - Command output. Commands like
npm test,cargo build, or a largegit diffcan produce thousands of lines. Whatever Claude reads becomes part of the conversation and rides along with every later request. - Model choice. Opus costs more per token than Sonnet. In our test, the same task cost about 0.21 times as much on Sonnet 5.5 as on Opus 5.5, both at high effort, in API-equivalent dollars. Anthropic doesn't publish how model choice weighs on the 5-hour and weekly meters, though some accounts also have a separate Opus or Sonnet limit. The Opus 5.5 and Sonnet 5.5 pages cover each model's limits and effort settings.
- Coming back after a break. On a subscription the prompt cache lasts an hour, or five minutes once you're drawing on usage credits. The first message after a longer break reprocesses the whole conversation without the cache discount.
- Work that runs while you're idle. Scheduled tasks and
/loopjobs send your full context every time they fire, whether or not you're typing.
To see how fast your own allowance is going before you change anything, the burn rate calculator projects whether you'll hit the 5-hour or weekly limit before it resets.
How to use less
- Clear between unrelated tasks.
/clearstarts a new conversation with an empty context and costs nothing. Don't let a finished debugging session ride along into the next feature. If you might want it back,/renameit first and return with/resume. - Compact when you need to keep going.
/compactreplaces the conversation with a summary, and you can say what to keep (/compact focus on the API changes). It isn't free: Claude reads the whole conversation to summarize it, so compacting a very large context is itself a large request. - Look at what's loaded.
/contextshows what's filling the window and flags context-heavy tools and memory files. Turn off MCP servers you aren't using with/mcp, and keep CLAUDE.md short, since it loads at the start of every session. If Claude keeps opening large generated files, a permissions deny rule in.claude/settings.jsonkeeps its Read tool away from them. - Match the model to the job. Anthropic suggests Sonnet for most coding and Opus for complex architecture and multi-step reasoning. If you default to Sonnet, check its work: in our test, none of its five builds started the app or tried a browser check, while all 17 Opus builds did both.
- Lower the effort for simple tasks.
/effortcontrols how much reasoning Claude does. In our test, medium effort was cheaper at the median, but the runs overlapped too much to call it a reliable saving.
What to do when you hit a Claude Code limit
Claude Code tells you which limit stopped it and when it resets, with a message such as You've hit your session limit · resets 3:45pm. Work through these in order:
- Find out which limit you hitThe message, or
/usage, tells you whether it's the 5-hour session limit, the weekly limit, or a model-specific Opus or Sonnet limit. Session and weekly limits cover every model, so switching models won't help. A model-specific limit covers only that family: run/model, pick a model outside it, and keep working, though the next request rereads the conversation without a warm cache. A session limit clears within five hours; a weekly limit waits for your account's reset day. Both are covered in when Claude usage resets. - Let Claude Code wait for the resetOn a claude.ai subscription, Claude Code 2.1.234 and later can wait in an interactive session and continue the task after a usage limit resets. It starts waiting automatically when that setting is enabled and the reset is within 24 hours. If a weekly reset is farther away, run
/rate-limit-optionsand choose “Wait here, then continue automatically” to start waiting yourself. Keep the session open; press Esc to cancel. Automatic waiting is not available in API-key or non-interactive sessions. The options menu also offers usage credits and plan upgrades. - Check whether /limit-reset is availableIf a session limit stopped you, try typing
/limit-reset. It isn't in Anthropic's public command reference, it may not appear in the command menu, and nothing guarantees your account has a reset to use. When it works, your 5-hour session unblocks immediately. In every public report so far it has cleared only the 5-hour limit, and its output says your weekly limit still applies. The /limit-reset guide covers what's been observed. - Continue with usage creditsIf your plan allows it, run
/usage-credits. Pro and Max subscribers are taken to Settings › Usage; Team and Enterprise members with billing access are taken to organization usage settings; members without billing access can send a request to their admins from the CLI. Once credits are on, Claude Code keeps working past the included allowance at standard API rates while the plan window counts down to its reset. The command isn't available when you're signed in with an API key. The usage credits guide covers pricing and spend limits. - Switch to an Anthropic Console API keyExit Claude Code, set the key, and start it again. A session that's already running won't pick up a variable you export afterwards.
export ANTHROPIC_API_KEY="sk-ant-..." claudeApprove the key when Claude Code asks. From then on every token is billed to your Console balance at API rates, with no 5-hour or weekly cap. For scale, the median cost of one build task in our test ran from $0.0925 on Sonnet in a fresh session to $1.5157 on Opus with a long context. Unset the variable and restart to go back to your plan. - Upgrade if it keeps happeningIf you regularly run out of Pro limits during a normal working day, Max 5× or Max 20× raises your 5-hour session allowance by that multiple. Max has its own weekly limits too, but Anthropic doesn't publish them as the same multiples, so check the limits by plan before you decide.
The same situation in Claude on the web and desktop, including where to find your exact reset time, is covered in what to do when you hit a Claude usage limit.
Frequently asked questions
Does Claude Code share usage limits with Claude.ai?
Yes, if you sign in to Claude Code with a Pro, Max, Team, or seat-based Enterprise plan. Claude Code sessions and chats on the web and desktop then draw from the same 5-hour session limit and weekly limit, so heavy coding leaves less for chat. If you sign in with an API key (ANTHROPIC_API_KEY) instead, Claude Code usage is billed per token through the Anthropic Console and doesn't touch your plan limits.
Can I use Claude Code on the free Claude plan?
No. Claude Code isn't included on the Free plan. You need a paid plan (Pro, Max 5×, Max 20×, Team, or Enterprise) or an Anthropic Console account billed per token.
How do I check my remaining Claude Code usage?
Run /usage in Claude Code (/cost and /stats open the same screen). On a subscription it shows your 5-hour session and weekly limits as percentages with reset times, a breakdown of recent usage by skills, subagents, plugins, and MCP servers, and the current session's token counts. On an API key it shows the session's tokens and an estimated dollar cost.
Every way to check your usage →Keep limits in the statusline →
Does /clear or /compact reset my Claude Code usage limit?
No. Both work on the conversation's context window, not on your plan allowance. /clear starts a new conversation and resets the session token and cost totals in /usage to zero, but your 5-hour and weekly percentages stay where they are. What clearing does is make every later request smaller, so you use the allowance more slowly from then on.
Is the dollar cost in /usage charged to my subscription?
No. Claude Code works that figure out locally from token counts at API list prices. Anthropic says it isn't relevant for billing on Pro and Max, because subscription usage is included in the plan. It's what the same tokens would cost on the API, which makes it a rough guide to usage-credit or API-key spend. The Anthropic Console's usage page is the authoritative bill for API usage.
Why does Claude Code use up limits faster than chat?
A Claude Code task is many model requests, not one: reading files, running commands, reading their output, and editing. Each request carries the whole conversation so far. In our test, the same Opus 5.5 task cost about 3.4 times as much, in API-equivalent dollars, after 205,000 tokens of earlier context, even though that context was read from cache. Subagents, long command output, and heavier models add to it. Clearing between unrelated tasks helps most.