# Claude Code spending limit: how to cap what it costs, on an API key, a plan or a team

*Set a Claude Code spending limit: --max-budget-usd for one run, Console workspace limits, usage-credit limits on Pro and Max, team caps, and a daily cap.*

Dmitriy Solodukha, checked 2026-11-27 · https://caprock.dev/guides/claude-code-spending-limit/

It depends on how you pay. On an API key, set a monthly spend limit on
the workspace in the Claude Console; for one headless run,
`claude -p --max-budget-usd 5 "…"` stops at an estimated $5. On Pro and Max
the plan's 5-hour and weekly limits are the cap, and if you turned on usage
credits, their monthly limit is set in Settings → Usage. Team and
Enterprise owners set limits for the organization, a seat tier or a member.

**In short**
- **One run:** `--max-budget-usd`, print mode only; spend can pass it.
- **API key:** a monthly limit per workspace, in the Console's spend limits.
- **Pro and Max:** the plan's limits stop you; usage credits stop at the
  monthly limit you set, or never if you chose unlimited.
- **What Caprock adds:** a daily cap across the sessions it started, which
  pauses them instead of killing them, free.

## Which limit applies to you

*Spend limits for Claude Code by how you pay, from Anthropic's docs and help center, read 27 November 2026.*

| How you pay | The cap | Where you set it |
| --- | --- | --- |
| One headless run | `--max-budget-usd`, estimated dollars | the command line |
| API key | a monthly limit per workspace | Console → Settings → Spend limits |
| API, the Claude Code workspace | a monthly limit per user | Console → Settings → Spend limits |
| Pro or Max | the 5-hour and weekly limits; usage credits' monthly limit | claude.ai Settings → Usage |
| Team, seat-based Enterprise | a monthly usage-credit limit for the org, a seat tier or a member | Organization settings → Usage |
| Bedrock, Vertex or Foundry through the Claude apps gateway | daily, weekly or monthly per developer | the gateway's admin API |
| Bedrock, Vertex or Foundry directly | your cloud's budgets | your cloud console |

## Cap one run: --max-budget-usd

`--max-budget-usd` stops a `claude -p` run once its estimated API spend
reaches the amount:

1. claude -p --max-budget-usd 5.00 "fix the failing test in src/api": `undefined`

- **Print mode only.** An interactive session has no such flag.
- **An estimate, not the bill.** The cap is checked against Claude Code's
  own estimate, and Anthropic's docs say spend can pass it: leave headroom.
- **Subagents count.** At the cap, starting a subagent fails with
  `Budget limit reached` and running background subagents stop.
- **A resumed run starts at zero.** With `--continue` or `--resume`,
  earlier runs' totals do not count.

`--max-turns` caps the number of turns the same way, also in print mode
only.

## On an API key: workspace spend limits

In the Claude Console, each workspace can have a monthly spend limit
(Settings → Spend limits → Workspace limits), and an email alert at an amount
you choose if Anthropic bills you directly. The organization's own limits
always apply on top.

- **The Claude Code workspace.** Claude Code creates one when people sign in
  with the Console, and it is the only workspace with per-user monthly
  limits: each developer gets a key there.
- **The Default Workspace** can have a limit too, but Anthropic's page says it
  might not count or stop some usage, including Claude Code signed in on
  the Default Workspace. Put Claude Code in its own workspace.

## On Pro and Max: plan limits and usage credits

A paid plan has no dollar cap to set, because the plan's 5-hour and weekly
limits are the cap: at either one Claude Code stops until it resets (a reply
in progress may finish). Switching `/model` does not reset them.

**Usage credits** let you keep working past the limit and bill it:

- **Turn them on** in Settings → Usage; `/usage-credits` opens the page from
  Claude Code.
- **Set the cap** with *Adjust limit*, a monthly spend limit, or *Set to
  unlimited*. Once you reach it, usage credits stop until the next billing
  period or until you adjust the limit.
- **Turn them off** at any time, and the plan's limits are the cap again.

How the windows work and when they reset:
[Claude Code usage limits](https://caprock.dev/guides/claude-code-usage-limits/).

## Team and Enterprise

The seat's allowance is the default ceiling. Owners and Primary Owners set
monthly usage-credit limits in Organization settings → Usage: for the whole
organization, per seat tier (Standard or Premium, on seat-based Enterprise)
or per member where available. A member's limit replaces a group's; the
organization's still applies. The limit is checked before each request, so
a member can go slightly over. Usage-based Enterprise plans do not use usage
credits, so these limits do not apply there. The team view of the same
question, with allocation and reporting:
[FinOps for coding agents](https://caprock.dev/guides/finops-for-coding-agents/).

## Through a gateway on Bedrock, Vertex or Foundry

The Claude apps gateway, which you host, caps each developer per day, week
or month, for a user, an identity-provider group or the organization (a
per-seat default, not a shared pool). Over the cap, requests get
`429 billing_error` until it resets at the UTC boundary or an admin raises
it. Claude Code warns at 75% and 95% and shows a *Spend limit* bar in
`/usage`.

## See what you have spent: /usage

`/usage` (`/cost` and `/stats` are aliases) shows the session's estimated
cost at list price, its durations and usage by model; on a plan, the usage
bars and a usage-credits row. It is one session on one machine: for a day,
a week or a repository you need a tool that reads every session — the
options are compared in
[Claude Code usage monitors](https://caprock.dev/guides/claude-code-usage-monitors/).

## What none of them cap: a day on your machine

Each limit above has a scope that leaves a gap. The Console's is monthly,
the plan's is counted in usage, not dollars, and `--max-budget-usd` covers
one run. Only the gateway caps a day, and only if you run one in your cloud.
A laptop running several sessions all afternoon has no daily ceiling of its
own.

## What Caprock adds: a daily cap on the machine

Caprock, a free, open-source desktop app for macOS, Windows and Linux,
prices every Claude Code, Codex and OpenCode turn at list price as it is
written, per day and per repository. Its daily spend cap is a free
setting:

- **Checked after every priced turn,** not on a timer.
- **Pauses, never kills.** At the cap it pauses the sessions Caprock started;
  resuming them continues where they were. Sessions you started in your own
  terminal are never touched.
- **Once a day,** and it fails open: if spend cannot be read, nothing is
  paused.
- **A suggested figure:** twice your median day, offered as a click, never
  filled in for you.

Caprock can also pause the Claude Code sessions it started at a share of the
5-hour or weekly window you choose (50% to 99%) and resume them after the
reset, and alerts you at 90%. Every figure is an estimate at list
price, not your bill. How the cap behaved on a month of one developer's
sessions: [Cap the loop, not the work](https://caprock.dev/guides/finops-for-coding-agents/#cap-the-loop-not-the-work).

## Which to use

- **`--max-budget-usd`** — scripts and CI runs of `claude -p`.
- **Workspace limits** — anyone on an API key; per-user limits for a team on
  the API.
- **Usage-credit limits** — Pro, Max, Team and Enterprise once credits are on.
- **Caprock's daily cap** — several sessions a day on your own machine, and a
  ceiling you want per day rather than per month.

## Sources

- [Claude Code docs — CLI reference: --max-budget-usd, --max-turns, read 27 November 2026](https://code.claude.com/docs/en/cli-reference)
- [Claude Code docs — Manage costs effectively: workspace limits, usage credits, /usage, read 27 November 2026](https://code.claude.com/docs/en/costs)
- [Claude Platform docs — Workspaces: workspace spend limits, the Claude Code workspace, read 27 November 2026](https://platform.claude.com/docs/en/manage-claude/workspaces)
- [Claude Code docs — Claude apps gateway spend limits, read 27 November 2026](https://code.claude.com/docs/en/claude-apps-gateway-spend-limits)
- [Claude Help Center — Manage usage credits for paid Claude plans, read 27 November 2026](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans)
- [Claude Help Center — Using Claude Code with your Pro or Max plan, read 27 November 2026](https://support.claude.com/en/articles/11145838-using-claude-code-with-your-pro-or-max-plan)
- [Claude Help Center — Manage usage credits for Team and seat-based Enterprise plans, read 27 November 2026](https://support.claude.com/en/articles/12005970-manage-usage-credits-for-team-and-seat-based-enterprise-plans)
- [Claude Code docs — Commands: /usage, /cost, /usage-credits, read 27 November 2026](https://code.claude.com/docs/en/commands)
- [Caprock CHANGELOG — 0.39.0 daily spend cap, 0.52.3 sessions Caprock started only](https://github.com/dspv/caprock/blob/master/CHANGELOG.md)
- [Caprock contracts — the daily cap's rules (.ai/03-contracts.md)](https://github.com/dspv/caprock/blob/master/.ai/03-contracts.md)
