Skip to content

Claude Code Costs: Track, Cap, and Reduce Token Spend

Core Concept LearningAugust 18, 202613 min readUpdated October 17, 2026

Claude Code is billed by tokens, and its token use is driven less by how much you type than by how much context it carries: every request sends the conversation so far, including the files Claude read and the output of every command it ran. That is why one person's costs can be several times another's for similar work, and why the most effective cost controls are habits, not settings.

This guide follows Anthropic's cost documentation. It starts with the only published benchmark numbers, then covers reading /usage, where spend is seen and capped for each way of accessing Claude Code, the rate limits Anthropic recommends by team size, why usage climbs in long sessions, and the changes that reduce it. For organisation-wide telemetry, see Claude Code Enterprise Setup; for how context fills up, see Claude Code Context Window.

Where Claude Code spend is seen, capped, and reported depends on how your organization accesses it
Where Claude Code spend is seen, capped, and reported depends on how your organization accesses it

What it costs, according to Anthropic

Anthropic publishes one set of averages, from enterprise deployments: around $13 per developer per active day and $150 to $250 per developer per month, with costs below $30 per active day for 90% of users. Those are averages across many organisations; per-developer cost varies widely with the model, codebase size, and habits such as running several sessions in parallel or automation.

The docs' advice for budgeting is to run a small pilot group first, measure a baseline with the tracking tools below, and only then extrapolate. A team that runs Claude Code in CI, uses agent teams, or leaves Opus as the default will sit well above the averages.

How you pay depends on how you sign in. On Pro and Max plans, usage is included in the subscription up to its limits; on Teams and Enterprise, each seat has an allowance shared with Claude chat and Cowork; on a Claude Console account or a cloud provider, every token is billed to the organisation.

Quick reference

  • Budget more for a coding seat than a chat seat: each Claude Code turn carries file contents, tool calls, and reasoning, so one debugging session can use more than a day of chat.
  • Background features such as conversation summaries for --resume use a small amount of tokens even when idle, typically under $0.04 per session.
  • For Enterprise budgeting, Anthropic's Claude Enterprise consumption guide gives per-user starting points across chat, Claude Code, and Cowork.

Remember this

Anthropic's averages are about $13 per active day per developer; measure your own baseline with a pilot before budgeting.

Track your own usage with /usage

The /usage command is the starting point. Its Session block shows token use for the current session by model, including cache reads and writes, and a cost estimate:

1Total cost:            $0.552Total duration (API):  6m 20s3Total duration (wall): 6h 33m 10s4Usage by model:5   claude-sonnet-4-6:  1.2k input, 5.3k output, 940.0k cache read, 50.0k cache write ($0.55)

Two things about that figure: it is computed locally at list price (unless your organisation set a modelPricing table in managed settings), so it is an estimate, not an invoice; and it resets at /clear. On Pro and Max plans, the session cost is not what you pay; subscribers should read the plan usage bars on the same screen.

Below it, a Prompt cache line shows how much of your input was served from cache, how many misses there were, and whether the cache is still warm. On paid plans, /usage also attributes recent usage to skills, subagents, plugins, and MCP servers, and flags behaviours such as long context or cache misses when they account for 10% or more. Press d or w to switch between 24 hours and 7 days.

For patterns rather than numbers, /insights analyses your recent sessions and writes an HTML report on what you work on, where friction happened, and how to work more effectively.

Quick reference

  • A status line script can show context and cost continuously, so you notice a session growing before it is expensive.
  • The token count beside the spinner is the current turn's output so far, not the session total.
  • For authoritative billing, use the Console usage page or your plan's usage settings, not the CLI estimate.

Remember this

/usage shows estimated cost, cache efficiency, and what is using your plan; treat its dollars as list-price estimates.

Seeing and capping spend for an organisation

On Teams and Enterprise, each member's usage draws from a seat allowance that resets on a rolling five-hour window and a weekly window. That allowance is the default ceiling. To let members go past it, turn on usage credits and set spend limits at the organisation, group, or member level in the claude.ai admin console.

On the Claude Console, the first Claude Code login creates a workspace named "Claude Code" for centralised tracking. Set a workspace spend limit on it, and a workspace rate limit so Claude Code cannot crowd out your production API traffic.

On cloud providers, spend lives in your cloud account and Anthropic's analytics do not see it. For per-user attribution, export OpenTelemetry from each machine, use a Claude apps gateway (which adds per-user spend caps), or route through an LLM gateway that tracks spend per key.

If your organisation pays contracted rates, set modelPricing in managed settings so /usage, the status line, and OpenTelemetry report your rates instead of list price. It changes the reported figures, not what is charged.

Where to see spend, cap it, and get per-user numbers, by setup
SetupSee spendCap spendPer-user reporting
Claude for Teams or EnterpriseSpend report in org analyticsSeat allowance; spend limits on usage creditsSpend report CSV; Enterprise Analytics API
Claude Console (API)Console usage pageWorkspace spend limitsConsole dashboard; Claude Code Analytics API
Bedrock, Google Cloud, FoundryYour cloud billing consoleYour cloud's budget controlsOpenTelemetry or an LLM gateway

Quick reference

  • OpenTelemetry export is the one option that works on every setup and streams per-user token and cost metrics in near real time.
  • "You've hit your session limit" or "weekly limit" is a seat window; switching models does not help. A spend-limit message means usage credits hit a cap you set.
  • Agent teams are off by default; if you enable them, keep teams small and use Sonnet for teammates.

Remember this

Seat allowances cap Teams and Enterprise, workspace limits cap the Console, and cloud budgets cap providers; OpenTelemetry reports on all three.

Rate limits by team size

For API organisations sizing their limits, Anthropic recommends the tokens-per-minute (TPM) and requests-per-minute (RPM) figures above. For example, 200 users at 20k TPM each is 4 million TPM in total.

The per-user figure falls as the team grows because fewer people use Claude Code at the same moment in a larger organisation. The limits apply at the organisation level, not per person, so one developer can use more than their share while others are idle. Plan for exceptions: a live training session where everyone starts at once needs a higher allocation than the table suggests.

Anthropic's recommended per-user rate limits for Console organisations
Team sizeTPM per userRPM per user
1-5 users200k-300k5-7
5-20 users100k-150k2.5-3.5
20-50 users50k-75k1.25-1.75
50-100 users25k-35k0.62-0.87
100-500 users15k-20k0.37-0.47
500+ users10k-15k0.25-0.35

Quick reference

  • Claude Code traffic in the Console's Claude Code workspace counts toward your organisation's overall API rate limits.
  • A 429 during a burst usually means the organisation limit, not a problem with one user's setup.
  • These are starting points to request from Anthropic, not limits Claude Code applies itself.

Remember this

Size API limits per user by team size, then add headroom for synchronised bursts such as training sessions.

Why usage climbs in a long session

The docs list the reasons a session that has been open for hours uses more than your activity suggests:

  • Long context. Claude Code sends the full conversation with every request, and each tool use adds another request carrying the results. Prompt caching makes the re-reads cheaper, but a one-line question in an all-day session still pays for the whole history.
  • Cache misses. After a break longer than the cache lifetime (an hour on a subscription, five minutes by default on an API key or cloud provider, and five minutes once you draw on usage credits), the next message reprocesses the full context.
  • Scheduled tasks and check-ins. /loop tasks, cross-session messages, and goal check-ins can start turns while the session is idle, each sending the full context.
  • More agents. Every subagent, workflow agent, and agent teammate sends its own requests on top of the main conversation. Agent teams in plan mode use roughly seven times the tokens of a standard session.
  • Compaction. /compact reads the conversation it summarises, so compacting a huge context is itself a large request. /clear costs nothing.

The most common causes of unexpectedly high spend on API plans, according to the docs, are long sessions that were never cleared and Opus left as the default model.

Why usage climbs: every request resends the conversation, so long context, cache misses, and extra agents multiply cost
Why usage climbs: every request resends the conversation, so long context, cache misses, and extra agents multiply cost

Quick reference

  • Ask for a fresh session for an unrelated task; /rename first so you can /resume the old one later.
  • Extended thinking tokens are billed as output tokens and can be tens of thousands per request on complex tasks.
  • A /usage breakdown that flags long context or cache misses tells you which of these is your cause.

Remember this

Context size times number of requests drives cost; long uncleared sessions and an expensive default model are the usual culprits.

Reduce token usage

The changes with the most effect, in rough order:

1. Clear between tasks with /clear, and use /compact Focus on the API changes when you need continuity but less history. Add compaction instructions to CLAUDE.md if certain details must survive. 2. Match the model to the job. Sonnet handles most coding; reserve Opus for hard architecture and multi-step reasoning. Give simple subagents model: haiku. 3. Lower effort for simple tasks with /effort, since thinking tokens are billed as output. 4. Keep standing context small. Keep CLAUDE.md under about 200 lines and move workflow-specific instructions into skills, which load only when used. Disable MCP servers you are not using, and prefer CLI tools such as gh where they exist. 5. Filter noisy output before Claude sees it. A PreToolUse hook can rewrite npm test to show only failures, turning tens of thousands of tokens of output into hundreds. 6. Avoid rework. Plan mode for complex changes, Esc as soon as Claude heads the wrong way, specific prompts instead of "improve this codebase", and a test or expected output so Claude can check itself.

A code intelligence plugin for typed languages also saves reads: one go-to-definition call replaces a grep plus several speculative file reads.

The highest-impact ways to reduce token usage, from Anthropic's cost guide
The highest-impact ways to reduce token usage, from Anthropic's cost guide

Quick reference

  • Delegate verbose operations (test runs, log analysis, doc fetching) to subagents so only summaries enter the main context, and give those subagents a cheaper model.
  • Run /context to see what is using space before deciding what to cut.
  • These habits also improve results, not just cost: a smaller, cleaner context makes Claude follow instructions better.

Remember this

Clear often, right-size the model and effort, keep CLAUDE.md lean, and filter verbose output; better results usually follow.

Hands-on: measure and cut one session's cost

1. Start a session and do a realistic task for 20 minutes. Run /usage and note the total, the cache line, and any flagged behaviours. 2. Run /context and list the three largest items in context. 3. Act on them: move a workflow section of CLAUDE.md into a skill, disable an unused MCP server, or add the test-output filtering hook from Anthropic's cost guide. 4. Run /clear, switch to Sonnet if you were on Opus, and repeat a similar task. Compare /usage. 5. Run /insights and read the friction points it reports.

Pass criterion: you can say which factor drove your first session's usage (context, cache misses, model, or subagents) and show the second session using less for similar work.

Quick reference

  • Compare like with like: similar task size and similar number of tool calls.
  • If cache reads dominate, the session is long; if cache writes or misses dominate, you are taking breaks past the cache lifetime.
  • Share the findings with your team; habits spread faster than settings.

Remember this

One measured before-and-after teaches more about cost than any table.

Key takeaway

Claude Code's cost follows its context: every request carries the conversation, files read, and tool output so far, so long sessions, cache misses after breaks, extra agents, and an expensive default model are what make it expensive. Anthropic's published averages are about $13 per developer per active day and $150 to $250 a month, with 90% of users under $30 a day, but your baseline comes from a pilot.

Track usage with /usage (estimates at list price unless you set modelPricing), cap it with seat allowances and usage-credit limits, Console workspace limits, or cloud budgets, and report per user with the analytics APIs or OpenTelemetry. Then reduce it with /clear, the right model and effort, a lean CLAUDE.md, and hooks that filter noise. For the hooks involved, see Claude Code Hooks.

Practice (40 min): run the five steps above and write down the one habit you will change.

Share:

References

  1. Claude Code docs: Manage costs effectively — checked Oct 17, 2026
  2. Claude Code docs: Monitoring usage with OpenTelemetry — checked Oct 17, 2026
  3. Claude Code docs: Prompt caching — checked Oct 17, 2026
SH

Shoaib Hossain

Lead Author & Systems Architect

Software engineer and distributed systems architect specializing in backend scalability, cloud-native infrastructure, databases, and AI engineering workflows. Author and maintainer of Core Concept Learning.

Human-Engineered & Fact-CheckedOriginal Visual DiagramsEditorial Standards →Send Feedback

Related Articles

Every request Claude Code sends to the model carries the whole session so far: the system prompt, your CLAUDE.md files, …

Read

When a few engineers use Claude Code, each person's ~/.claude/settings.json is enough. When a company rolls it out to hu…

Read

Many companies already run an LLM gateway, such as LiteLLM, a cloud API gateway, or an in-house proxy, between their dev…

Read

Keep learning

Follow a structured path or browse all courses to go deeper.