Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.
Claude Code charges by API token consumption. For subscription plan pricing (Pro, Max, Team, Enterprise), see claude.com/pricing. Per-developer costs vary widely based on model selection, codebase size, and usage patterns such as running multiple instances or automation.Across enterprise deployments, the average cost is around $13 per developer per active day and $150-250 per developer per month, with costs remaining below $30 per active day for 90% of users. To estimate spend for your own team, start with a small pilot group and use the tracking tools below to establish a baseline before wider rollout.This page covers Claude Code usage only: how to track your costs, manage costs for your organization, and reduce token usage. For usage limits in other Claude products, see the Claude Help Center.
The Session block in /usage shows API token usage and is intended for API users. Claude Max and Pro subscribers have usage included in their subscription, so the session cost figure isn’t relevant for billing purposes. Subscribers see plan usage bars, activity stats, and a usage breakdown on the same screen.
The Session block at the top of /usage shows detailed token usage statistics for your current session. Claude Code computes the dollar figure locally from token counts at list price, unless a modelPricing table is in effect. An administrator sets one in your organization’s managed settings so the figure uses your contracted rates, and while a table is in effect the Total cost line carries the note at your organization's configured rates. The figure is an estimate, so for authoritative billing see the Usage page in the Claude Console.
These totals reset when /clear starts a new session, so the next session’s total cost starts at $0. Before v2.1.211, they kept accumulating across /clear for the lifetime of the Claude Code process.For a response from the Claude API billed at the 1.1× data residency rate, Claude Code multiplies the list price of that response’s tokens by 1.1 in the session cost figure. The same total appears in the status line’s cost field, and the multiplied figure also counts toward --max-budget-usd.
After the main conversation’s first API response, Claude Code also adds a Prompt cache (main) line to the Session block, summarizing the session’s prompt cache use: the request count, the share of input tokens served from cache, cache misses, and whether the cache is warm right now. Requires Claude Code v2.1.251 or later.
Prompt cache (main): 14 requests · 91% of input tokens from cache · 2 misses (last 6m 10s ago, 310.2k tokens re-cached) · 1 expected rebuild (compaction or tool-result clearing) · warm (1h TTL, last activity 40s ago)
The misses, expected rebuilds, and warm or cold parts of the line mean the following:
Misses: requests that re-processed content the cache already held, with the time of the last miss and how many tokens those requests wrote back to the cache. Actions that invalidate the cache lists the usual causes. When Claude Code can identify a likely cause for the last miss, the line names it too, for example likely cause: tool definitions changed. The likely-cause text requires Claude Code v2.1.260 or later.
Expected rebuilds: when Claude Code has itself just rewritten the conversation, by compaction or by clearing old tool results from context, it counts the same kind of miss as an expected rebuild instead. This part appears only after at least one expected rebuild has happened.
Warm or cold: whether the cached prefix is still within its cache lifetime, with the TTL in effect. When the cache is cold, the line shows how long the session has been idle. When no response has reported cache tokens, the line ends with no prompt caching reported by the API instead.
The counts come from the cache token fields in the API’s responses, so the line works on every provider and gateway. It covers the main conversation only, not subagents. /clear resets it with the rest of the Session block.Status line scripts can read the same numbers from the prompt_cache object.
On a Pro, Max, Team, or Enterprise plan, /usage also shows a breakdown of what counts against your plan limits, with recommendations:
Attribution: recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total. An MCP server’s share counts only the requests that consumed one of its tool results. Before v2.1.222, after one call to an MCP server, Claude Code attributed every subsequent request to that server, overstating its share.
Recommendations: suggested changes, one per row. Each row starts with a share of your recent usage, at least 10%, as in 25% Trim ~/code/api/CLAUDE.md · 49k tokens per request.
How to read the share: it tells you how much of your usage the row applies to, not how much the change saves. One request can count toward several rows, so the shares can add up to more than 100%.
Loops: a row for each of the heaviest /loop or other session-scoped scheduled tasks that ran recently, ordered by total tokens, with a count of the rest. Requires Claude Code v2.1.242 or later.
What each row reports: how often the task fires, how many times it ran, its total and per-run tokens, and when it last ran
Stopped and re-created loops: Claude Code keys a row by the task’s prompt, so a loop you stop and re-create stays one row
Press d or w to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local session history on this machine, so usage from other devices or claude.ai is not included.In the VS Code extension, the attribution shares and recommendations appear in the Account & usage dialog with a Day and Week toggle, without the Loops rows.
When the /usage footer shows a hint such as f to fix 2 of 3, press f to have Claude Code act on the recommendations it can. The f shortcut requires Claude Code v2.1.305 or later.
After any turn in progress ends, Claude Code runs each /effort command shown in a row without run.
Claude then gets one prompt with a step for each of the other rows it can act on. The prompt asks Claude to show you each change before making it.
To see what pressing f does with each of your rows, find the row’s shape in the first column:
Row shape
Example row
When you press f
Ends in an /effort command with no run before it
40% Switch from max to high effort · /effort high
Claude Code runs the command
Ends in run and a command
30% Compact before you step away · run /compact
Nothing happens for this row. Run the command yourself at the Claude Code prompt
Ends in anything else
25% Trim ~/code/api/CLAUDE.md · 49k tokens per request
Claude gets a step in the prompt for some of these rows, and nothing happens for the rest. If Claude shows you no change for a row, follow that recommendation yourself
In f to fix 2 of 3, the first number counts the rows Claude Code acts on when you press f, and the second counts the rows shown. A hint with no of in it, such as f to fix both, means Claude Code acts on every row shown.While Remote Control is connected, the footer shows no f hint. If pressing f closes /usage with Nothing was sent. Turn off Remote Control to use fixes., Remote Control connected while /usage was open. To use f again, disconnect Remote Control, then run /usage at the Claude Code prompt and press f again.
/usage also shows a usage-credits row while usage credits are on. What the row shows depends on your plan:
Pro and Max: your spend for the current month, measured against your monthly spend limit when you have set one. When you haven’t set a limit, the row shows Unlimited and no spend figure.
Team and Enterprise: your own spend for the current month, measured against any limit your organization set that applies to you. A limit that covers the whole organization doesn’t appear in the row. When you have no limit of your own, the row shows your spend with no limit beside it. While usage credits are off for you, /usage shows no usage-credits row.
When you have a spend limit, the row appears as soon as usage credits are on and shows 0% until you first spend usage credits. Before v2.1.236, /usage showed the row only on Pro and Max plans, and a row with a spend limit stayed hidden until you had spent something.
When the request for your plan limits fails, most often because the usage endpoint is rate limited, /usage shows the last usage bars it loaded on this machine within the past 60 minutes, along with a Showing last-known usage note stating how long ago that data was fetched. Press r to retry; a successful retry replaces the last-known bars with fresh data. Without a snapshot from the past 60 minutes, /usage reports that the usage endpoint is rate limited and offers the same retry shortcut. Before v2.1.208, a rate-limited request in a session that hadn’t loaded usage yet always showed the error with no bars.A message such as rate limited until 3:14am in /usage means Claude Code can’t fetch your plan limits again until then, not that your work with Claude is limited. If you press r earlier, expect the same message. Press r after that time for fresh data.
While Claude works in the main conversation, the line beside the spinner can end with an elapsed time and a token count, as in Deciphering… (10m 27s · ↓ 5.5k tokens). It is a live, approximate count of the output the current turn has produced so far. The arrow beside the count points down while output arrives or tools run.
What it covers: output the turn generates, such as the text and tool calls Claude streams back, its thinking, and the output of subagents that run in the foreground
What it leaves out: what Claude Code sends to the model, so your prompt, the conversation history, and the rest of your context don’t move it
When it stays hidden: until output starts arriving, when the row is too narrow to fit it, and in screen reader mode
It won’t match the Usage by model output figures in the /usage Session block, which add up the whole session rather than one turn. It also differs from the token count verbose mode adds, because that count measures the size of your context rather than one turn’s output.
Run /insights for a report on how you work rather than how many tokens you’ve used. It analyzes your recent sessions on this machine and writes an HTML report covering what you work on, friction points such as misunderstood requests or buggy code, and suggestions for using Claude Code more effectively. A single run analyzes up to 200 sessions it hasn’t seen before and skips very short ones. When sessions are left out, the report header shows the analyzed count with the total in parentheses, for example 200 sessions (412 total).When auto mode is available to the session and your recent sessions mostly ran without it, the report can also include an estimate of how many permission prompts auto mode could have handled across those sessions.Claude Code writes the latest report to ~/.claude/usage-data/report.html and saves a timestamped copy of each run in the same directory, so earlier reports aren’t overwritten. Claude Code deletes reports on the same schedule as the rest of your session data: at startup, it removes files older than cleanupPeriodDays, 30 days by default.You can run /insights on any plan and with any provider. The analysis runs through the same provider and account as your regular sessions, and the tokens count against your plan or API usage. Sessions from other devices and claude.ai aren’t included.
Usage credits let you keep working past your plan’s usage limit. To manage them, run /usage-credits after signing in with your claude.ai subscription through /login; the command isn’t available with API key authentication. In self-serve Enterprise organizations, Enterprise trials, and Enterprise organizations billed through AWS Marketplace, the command requires Claude Code v2.1.248 or later; earlier versions reject it with Unknown command: /usage-credits. What it opens depends on your role:
Your role
What /usage-credits does
Pro or Max subscriber
Opens Settings > Usage on claude.ai in the browser. In its Usage credits section you can turn usage credits on or off and check your credit balance, this month’s spend, and your monthly spend limit
Asks you to confirm, then sends a request to your organization’s admins. Before v2.1.211, Claude Code sent the request without a confirmation step
For Team and Enterprise members without billing access, the confirmation appears only in interactive sessions: in non-interactive mode with the -p flag and from Remote Control, the command sends no request and tells you to run it in an interactive session instead.If you run /usage-credits again while your earlier request is waiting on an admin, Claude Code tells you a request has already been sent rather than sending a duplicate. After an admin dismisses your request, running the command again sends a new one. Before v2.1.222, a dismissed request also blocked new requests.On Pro and Max plans, when you reach your spend limit with usage credits still available, Claude Code prompts you to raise or remove the limit without leaving the CLI. If the server rejects the change, see Could not update your spend limit.
Which controls you have depends on how your organization accesses Claude Code: a Claude for Teams or Enterprise plan, the Claude Console, or a cloud provider. On Teams and Enterprise plans, usage draws from each member’s seat allowance. On the Console and on cloud providers, usage is billed per token to your organization. If your organization mixes sign-in methods, each developer is metered according to the one they authenticated with.The table maps each setup to where you see spend, where you cap it, and how you pull per-user numbers. On an individual Pro or Max plan you have no organization to manage, so track your own usage-credit spend, including fast mode, under Add usage credits to your subscription.
OpenTelemetry export works on every setup and is the only option that streams per-user token and cost metrics into your own observability stack in near real time.
By default, Claude Code computes every cost figure it shows developers at list price, so if your organization pays contracted rates, the figures in /usage, the status line, and OpenTelemetry don’t match your bill. To make them match, set the modelPricing managed setting to your rates. The setting changes what Claude Code reports, not what Anthropic charges. Requires Claude Code v2.1.242 or later.
1
Take the rates from your contract
Enter the per-million-token rates from your contract. Claude Code doesn’t fetch them from the Claude Console, so update the setting when the contract changes.
2
Write the setting
Set multiplier below 1 for a flat discount or above 1 for a markup, list each model’s four per-token rates under overrides, or do both. A markup requires Claude Code v2.1.271 or later. The modelPricing entry has the shape and a paste-ready example.
3
Deploy it through managed settings
Deliver it as managed settings: server-managed settings, an MDM policy, managed-settings.json, or a policy helper. Claude Code ignores the key in user, project, and local settings and in --settings.
To confirm the rates are in effect, run /usage in a session that has received the managed settings: the Session block’s Total cost line carries the note at your organization's configured rates. The figures are still estimates, not an invoice. The per-million-token prices in the /model picker stay at list price.
On Claude for Teams and Enterprise plans, each member’s Claude Code usage draws from a per-seat allowance that resets on a rolling five-hour window and a weekly window. The allowance is shared with Claude chat and Cowork, and its size depends on the member’s seat tier (Standard or Premium). Your controls live in the claude.ai admin console, not the Claude Console.
See spend: the spend report in org analytics shows estimated spend per user and per model, with CSV export, updated daily. The report covers usage-credit spend and appears once usage credits are turned on. Usage inside the seat allowance isn’t metered in dollars.
Cap spend: the seat allowance is the default ceiling. To let members continue past it, turn on usage credits and set spend limits at the organization, group, or individual member level.
Pull per-user numbers: on the Enterprise plan, the Enterprise Analytics API returns per-user usage and cost reports across Claude surfaces, including Claude Code. A Primary Owner creates a key with the read:analytics scope at claude.ai/analytics/api-keys. On the Teams plan, export the spend report CSV, which lists token usage and estimated spend per user and per model.
The Claude Enterprise consumption guide is the planning reference for admins. It explains how consumption differs across Claude chat, Claude Code, and Cowork, and gives per-user dollar starting points for budgeting. Budget more for a coding seat than a chat seat: each Claude Code turn carries file contents, tool calls, and multi-step reasoning, so one debugging session can consume more than a day of chat.
When you first authenticate Claude Code with your Claude Console account, a workspace called “Claude Code” is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage.For organizations with custom rate limits, Claude Code traffic in this workspace counts toward your organization’s overall API rate limits. You can set a workspace rate limit on this workspace’s Limits page in the Claude Console to cap Claude Code’s share and protect other production workloads.
When setting up Claude Code for teams, consider these Token Per Minute (TPM) and Request Per Minute (RPM) per-user recommendations based on your organization size:
Team size
TPM per user
RPM per user
1-5 users
200k-300k
5-7
5-20 users
100k-150k
2.5-3.5
20-50 users
50k-75k
1.25-1.75
50-100 users
25k-35k
0.62-0.87
100-500 users
15k-20k
0.37-0.47
500+ users
10k-15k
0.25-0.35
For example, if you have 200 users, you might request 20k TPM for each user, or 4 million total TPM (200*20,000 = 4 million).The TPM per user decreases as team size grows because fewer users tend to use Claude Code concurrently in larger organizations. These rate limits apply at the organization level, not per individual user, which means individual users can temporarily consume more than their calculated share when others aren’t actively using the service.
If you anticipate scenarios with unusually high concurrent usage (such as live training sessions with large groups), you may need higher TPM allocations per user.
On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code is billed per token to your cloud account, and spend controls live in your cloud provider’s billing console. Claude Code does not send metrics from your cloud back to Anthropic, so the analytics dashboards and the Claude Code Analytics API do not cover this usage.For per-user cost attribution, you have three options:
OpenTelemetry: export metrics from each developer’s machine to your own observability stack. This gives you per-user token counts, costs, and tool activity regardless of provider.
A Claude apps gateway: a self-hosted Claude apps gateway provides per-user usage attribution, OTLP metrics with token counts, and per-user spend limits on these providers.
An LLM gateway: route all Claude Code traffic through a proxy that tracks spend per key. Several large enterprises reported using LiteLLM, an open-source tool that tracks spend by key. This project is unaffiliated with Anthropic and has not been audited for security.
Developers usually bring limit questions to their admin, so it helps to know which ceiling they hit. These situations mean different things:
“You’ve hit your session limit” or “You’ve hit your weekly limit”: a seat-based usage window on a subscription plan, shared across all models, so the developer can’t restore access by switching models with /model. The message shows when the window resets. After the model-specific “You’ve hit your Opus limit” or “You’ve hit your Sonnet limit” message, switching to a model outside that family with /model does keep the developer working. See usage limit errors. What the developer can do in the meantime:
Run /usage-credits to request usage beyond the allowance, if you have usage credits turned on.
“You’ve hit your individual spend limit”, “org’s monthly spend limit”, or “team’s shared budget”: the developer’s request would be billed to usage credits, and those credits have reached a spend limit you set. To let the developer continue, go to Organization settings > Usage and increase the limit the message names. When the message also names a plan reset time, the developer can instead wait until then. See the error reference for each variant.
A spend limit message from a Claude apps gateway: the developer passed a spend cap you set on your self-hosted gateway, and the gateway blocks their requests until the period resets or you raise the cap. See gateway spend limits for caps, reset schedules, and the message the developer sees.
A context or auto-compact warning: not a usage limit. The conversation has grown close to the session’s auto-compact window, the threshold where Claude Code summarizes older history to free space. Point the developer at reduce token usage.
Unexpectedly high spend on an API or cloud-provider plan: usually traces back to long sessions that were never cleared or to Opus left as the default model. The highest-impact habits to share are clearing between unrelated tasks and matching the model to the job, both covered in reduce token usage.
Agent teams spawn multiple Claude Code instances, each with its own context window. Token usage scales with the number of active teammates and how long each one runs.To keep agent team costs manageable:
Use Sonnet for teammates. It balances capability and cost for coordination tasks.
Keep teams small. Each teammate runs its own context window, so token usage is roughly proportional to team size.
Keep spawn prompts focused. Teammates load CLAUDE.md, MCP servers, and skills automatically, but everything in the spawn prompt adds to their context from the start.
Shut down teammates when their work is done. Each active teammate continues consuming tokens until it exits or the session ends.
Agent teams are disabled by default. Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in your settings.json or environment to enable them. See enable agent teams.
Token costs scale with context size: the more context Claude processes, the more tokens you use. Claude Code automatically optimizes costs through prompt caching, which reduces costs for repeated content like system prompts, and auto-compaction, which summarizes conversation history when approaching context limits.The following strategies help you keep context small and reduce per-message costs.
Clear between tasks: Use /clear to start fresh when switching to unrelated work. Stale context wastes tokens on every subsequent message. Use /rename before clearing so you can find the session later, then /resume to return to it.
Add custom compaction instructions: /compact Focus on code samples and API usage tells Claude what to preserve during summarization.
You can also customize compaction behavior in your CLAUDE.md file at the root of your project:
# Compact instructionsWhen you are using compact, please focus on test output and code changes
Sonnet handles most coding tasks well and costs less than Opus. Reserve Opus for complex architectural decisions or multi-step reasoning. Use /model to switch models mid-session, or set a default in /config. A switch to Opus also applies to the subagents that inherit your session’s model. For simple subagent tasks, specify model: haiku in your subagent configuration.
MCP tool definitions are deferred by default, so only tool names and server instructions enter context until Claude uses a specific tool. Run /context to see what’s consuming space.
Prefer CLI tools when available: Tools like gh, aws, gcloud, and sentry-cli are still more context-efficient than MCP servers because they don’t add any per-tool listing. Claude can run CLI commands directly.
Disable unused servers: Run /mcp to see configured servers and disable any you’re not actively using.
Install code intelligence plugins for typed languages
Code intelligence plugins give Claude precise symbol navigation instead of text-based search, reducing unnecessary file reads when exploring unfamiliar code. A single “go to definition” call replaces what might otherwise be a grep followed by reading multiple candidate files. Installed language servers also report type errors automatically after edits, so Claude catches mistakes without running a compiler.
Custom hooks can preprocess data before Claude sees it. Instead of Claude reading a 10,000-line log file to find errors, a hook can grep for ERROR and return only matching lines, reducing context from tens of thousands of tokens to hundreds.A skill can give Claude domain knowledge so it doesn’t have to explore. For example, a “codebase-overview” skill could describe your project’s architecture, key directories, and naming conventions. When Claude invokes the skill, it gets this context immediately instead of spending tokens reading multiple files to understand the structure.For example, this PreToolUse hook filters test output to show only failures:
settings.json
filter-test-output.sh
Add this to your settings.json to run the hook before every Bash command:
The hook calls this script. Create the folder with mkdir -p ~/.claude/hooks, save the script below as ~/.claude/hooks/filter-test-output.sh, and make it executable with chmod +x ~/.claude/hooks/filter-test-output.sh. It checks if the command is a test runner and modifies it to show only failures:
#!/bin/bashinput=$(cat)cmd=$(echo "$input" | jq -r '.tool_input.command')# If running tests, filter to show only failurespattern='^(npm test|pytest|go test)( [^;&|<>`$#\\[:cntrl:]]*)?$'if [[ "$cmd" =~ $pattern ]]; then filtered_cmd="$cmd 2>&1 | grep -A 5 -E '(FAIL|ERROR|error:)' | head -100" echo "$input" | jq --arg filtered "$filtered_cmd" \ '{hookSpecificOutput: {hookEventName: "PreToolUse", updatedInput: (.tool_input + {command: $filtered})}}'else echo "{}"fi
To verify the setup, run /hooks and check that the hook appears under PreToolUse. You can also start Claude Code with claude --debug-file ./claude-debug.txt and ask Claude to run npm test. When the hook rewrites the command, that log file contains a modified tool input keys line listing command and the other Bash input fields.
Your CLAUDE.md file is loaded into context at session start. If it contains detailed instructions for specific workflows (like PR reviews or database migrations), those tokens are present even when you’re doing unrelated work. Skills load on-demand only when invoked, so moving specialized instructions into skills keeps your base context smaller. Aim to keep CLAUDE.md under 200 lines by including only essentials.
Extended thinking is enabled by default because it significantly improves performance on complex planning and reasoning tasks. Thinking tokens are billed as output tokens, and the default budget can be tens of thousands of tokens per request depending on the model.For simpler tasks where deep reasoning isn’t needed, you can reduce costs by lowering the effort level with /effort or in /model, or by disabling thinking in /config. You can’t turn off thinking on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, which always use extended thinking.On models with a fixed thinking budget, you can also lower the budget by setting the MAX_THINKING_TOKENSenvironment variable, for example MAX_THINKING_TOKENS=8000. Adaptive-reasoning models ignore nonzero budgets, so use effort levels there instead.
Running tests, fetching documentation, or processing log files can consume significant context. Delegate these to subagents so the verbose output stays in the subagent’s context while only a summary returns to your main conversation.The subagent’s own requests still draw on your usage. To spend less on them, choose a smaller model for a subagent or run every subagent on one model.
Agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode, because each teammate maintains its own context window and runs as a separate Claude instance. Keep team tasks small and self-contained to limit per-teammate token usage. See agent teams for details.
Vague requests like “improve this codebase” trigger broad scanning. Specific requests like “add input validation to the login function in auth.ts” let Claude work efficiently with minimal file reads.
For longer or more complex work, these habits help avoid wasted tokens from going down the wrong path:
Use plan mode for complex tasks: Press Shift+Tab to cycle to plan mode before implementation. Claude explores the codebase and proposes an approach for your approval, preventing expensive re-work when the initial direction is wrong.
Course-correct early: If Claude starts heading the wrong direction, press Escape to stop immediately. Use /rewind or double-tap Escape to restore conversation and code to a previous checkpoint.
Give verification targets: Include test cases, paste screenshots, or define expected output in your prompt. When Claude can verify its own work, it catches issues before you need to request fixes.
Test incrementally: Write one file, test it, then continue. This catches issues early.
Claude Code uses tokens for some background functionality even when idle:
Conversation summarization: Background jobs that summarize previous conversations for the claude --resume feature
Command processing: Some commands like /usage may generate requests to check status
These background processes consume a small amount of tokens (typically under $0.04 per session) even without active interaction.When prompt suggestions are on, Claude Code also sends a short request to the model your session is using after Claude responds, to suggest your next prompt. That request reuses the conversation’s prompt cache, so it is mostly cache reads plus a few output tokens. Claude Code skips it while your account is close to or at its usage limit. To stop these requests, turn prompt suggestions off.
A session that has been open for hours can use far more of your plan limits than your activity suggests, usually for one of these reasons:
Long context: Claude Code sends your full conversation with every request, and each time Claude uses tools it sends another request carrying that batch of tool results. With prompt caching, Claude Code re-reads that history at the cached token rate, so a one-line question in a session that has been open all day still draws usage for the whole conversation. See Manage context proactively for ways to keep your context small
Scheduled tasks: a session-scoped scheduled task fires on its interval even while the session is idle, sending your full context each time
Cross-session messages: Claude Code delivers a message from another of your sessions as a new turn when this session sits idle, sending your full context each time. To hold inbound messages instead of delivering them, set crossSessionInbound to hold
Goal check-ins: while background work keeps an active goal waiting, Claude Code asks Claude to check on that work even when the session sits idle, starting a new turn that sends your full context. Claude Code starts at most three idle check-ins per goal between your prompts. Before v2.1.246, idle check-ins were uncapped. To turn check-ins off, set CLAUDE_CODE_GOAL_CHECKIN_MINUTES to 0. Idle check-ins require Claude Code v2.1.236 or later
Subagents and workflows: every subagent, and every agent a dynamic workflow spawns, sends its own requests on top of the main conversation’s. The attribution breakdown shows the subagent share
Agent teammates: each active teammate keeps consuming tokens until it exits
Compaction: /compact reads the conversation it summarizes, so compacting a large context is itself a large request. When you want a fresh start instead of continuity, /clear costs nothing
On a Pro, Max, Team, or Enterprise plan, the /usage breakdown recommends a change for behaviors behind 10% or more of your recent usage, such as long context or cache misses.
Claude Code regularly receives updates that may change how features work, including cost reporting. Run claude --version to check your current version.For billing questions about your specific account, contact Anthropic support through the in-product messenger:
Subscription plans (Pro, Max, Team, Enterprise): sign in at claude.ai, click your initials in the lower left, and select Get help
Console (API) billing: sign in at platform.claude.com, click your initials, and select Get help
See How to get support for the full flow, including who can reach a human agent on each plan.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Claude Code Docs","description":"Official documentation for Claude Code, Anthropic's agentic coding tool available in the terminal, IDE, desktop app, and browser. Covers installation, configuration, skills, subagents, hooks, MCP, the Agent SDK, and reference material.","colors":{"primary":"#0E0E0E","light":"#D4A27F","dark":"#0E0E0E"},"logo":{"light":"https://mintcdn.com/claude-code/c5r9_6tjPMzFdDDT/logo/light.svg?fit=max\u0026auto=format\u0026n=c5r9_6tjPMzFdDDT\u0026q=85\u0026s=78fd01ff4f4340295a4f66e2ea54903c","dark":"https://mintcdn.com/claude-code/c5r9_6tjPMzFdDDT/logo/dark.svg?fit=max\u0026auto=format\u0026n=c5r9_6tjPMzFdDDT\u0026q=85\u0026s=1298a0c3b3a1da603b190d0de0e31712"},"favicon":"https://mintcdn.com/claude-code/T2WlxklWBkR5Y1mJ/favicon.ico?fit=max\u0026auto=format\u0026n=T2WlxklWBkR5Y1mJ\u0026q=85\u0026s=346a85952ae08d5ee90e3c34d4423930","appearance":{"default":"system"},"background":{"color":{"light":"#FDFDF7","dark":"#09090B"}},"navbar":{"links":[{"href":"https://platform.claude.com/","label":"Claude Developer Platform"}],"primary":{"type":"button","label":"Open Claude Code","href":"https://claude.ai/code"}},"footer":{"socials":{"x":"https://x.com/AnthropicAI","linkedin":"https://www.linkedin.com/company/anthropicresearch"},"links":[{"header":"Company","items":[{"label":"Anthropic","href":"https://www.anthropic.com/company"},{"label":"Careers","href":"https://www.anthropic.com/careers"},{"label":"Economic Futures","href":"https://www.anthropic.com/economic-futures"},{"label":"Research","href":"https://www.anthropic.com/research"},{"label":"News","href":"https://www.anthropic.com/news"},{"label":"Trust center","href":"https://trust.anthropic.com/"},{"label":"Transparency","href":"https://www.anthropic.com/transparency"}]},{"header":"Help and security","items":[{"label":"Availability","href":"https://www.anthropic.com/supported-countries"},{"label":"Status","href":"https://status.anthropic.com/"},{"label":"Support center","href":"https://support.claude.com/"}]},{"header":"Learn","items":[{"label":"Courses","href":"https://academy.claude.com/"},{"label":"MCP connectors","href":"https://claude.com/partners/mcp"},{"label":"Customer stories","href":"https://www.claude.com/customers"},{"label":"Engineering blog","href":"https://www.anthropic.com/engineering"},{"label":"Events","href":"https://www.anthropic.com/events"},{"label":"Powered by Claude","href":"https://claude.com/partners/powered-by-claude"},{"label":"Service partners","href":"https://claude.com/partners/services"},{"label":"Startups program","href":"https://claude.com/programs/startups"}]},{"header":"Terms and policies","items":[{"label":"Privacy choices","href":"https://www.anthropic.com/legal/privacy"},{"label":"Privacy policy","href":"https://www.anthropic.com/legal/privacy"},{"label":"Disclosure policy","href":"https://www.anthropic.com/responsible-disclosure-policy"},{"label":"Usage policy","href":"https://www.anthropic.com/legal/aup"},{"label":"Commercial terms","href":"https://www.anthropic.com/legal/commercial-terms"},{"label":"Consumer terms","href":"https://www.anthropic.com/legal/consumer-terms"}]}]},"seo":{"metatags":{"canonical":"https://code.claude.com/docs"}},"fonts":{"family":"Anthropic Sans"},"contextual":{"options":["copy","view","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"languages":[{"language":"en","href":"en/overview"},{"language":"fr","href":"fr/overview"},{"language":"de","href":"de/overview"},{"language":"it","href":"it/overview"},{"language":"jp","href":"ja/overview"},{"language":"es","href":"es/overview"},{"language":"ko","href":"ko/overview"},{"language":"zh-CN","href":"zh-CN/overview"},{"language":"zh-TW","href":"zh-TW/overview"},{"language":"ru","href":"ru/overview"},{"language":"id","href":"id/overview"},{"language":"pt-BR","href":"pt/overview"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"claude-code","hasAudioNarration":false,"actualSubdomain":"claude-code","customDomains":["code.claude.com"],"gitSource":{"type":"github","owner":"anthropics","repo":"claude-code-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae33bc0f2e535e50ffb007a","collectionId":"56816e32-f582-41bf-882f-8cedf5278bfb","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae33bc0f2e535e50ffb007a"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED","enabled":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED","enabled":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae343147704dba3b3b10700","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"en","tag":"Agent SDK","count":60},{"language":"en","tag":"Plugins","count":56},{"language":"de","tag":"Neuigkeiten","count":50},{"language":"en","tag":"What's New","count":50},{"language":"es","tag":"Novedades","count":50},{"language":"fr","tag":"Nouveautés","count":50},{"language":"it","tag":"Novità","count":50},{"language":"ko","tag":"새로운 기능","count":50},{"language":"pt-BR","tag":"Novidades","count":50},{"language":"ru","tag":"Что нового","count":50},{"language":"zh-TW","tag":"最新消息","count":50},{"language":"de","tag":"Erste Schritte","count":49},{"language":"es","tag":"Primeros pasos","count":49},{"language":"fr","tag":"Premiers pas","count":49},{"language":"id","tag":"Memulai","count":49},{"language":"it","tag":"Per iniziare","count":49},{"language":"jp","tag":"はじめに","count":49},{"language":"ko","tag":"시작하기","count":49},{"language":"pt-BR","tag":"Primeiros passos","count":49},{"language":"ru","tag":"Начало работы","count":49},{"language":"zh-TW","tag":"快速入門","count":49},{"language":"en","tag":"Getting started","count":48},{"language":"zh-CN","tag":"快速入门","count":46},{"language":"en","tag":"Overview","count":41},{"language":"de","tag":"Agent SDK","count":36},{"language":"en","tag":"Setup and access","count":36},{"language":"es","tag":"Agent SDK","count":36},{"language":"id","tag":"Agent SDK","count":36},{"language":"it","tag":"Agent SDK","count":36},{"language":"jp","tag":"Agent SDK","count":36},{"language":"pt-BR","tag":"Agent SDK","count":36},{"language":"ru","tag":"Agent SDK","count":36},{"language":"zh-CN","tag":"Agent SDK","count":36},{"language":"zh-TW","tag":"Agent SDK","count":36},{"language":"de","tag":"Administration","count":34},{"language":"en","tag":"Administration","count":34},{"language":"es","tag":"Administración","count":34},{"language":"fr","tag":"Administration","count":34},{"language":"id","tag":"Administrasi","count":34},{"language":"it","tag":"Amministrazione","count":34},{"language":"jp","tag":"管理","count":34},{"language":"ko","tag":"관리","count":34},{"language":"pt-BR","tag":"Administração","count":34},{"language":"ru","tag":"Администрирование","count":34},{"language":"zh-CN","tag":"管理","count":34},{"language":"zh-TW","tag":"管理","count":34},{"language":"de","tag":"Plugins","count":32},{"language":"es","tag":"Plugins","count":32},{"language":"fr","tag":"SDK Agent","count":32},{"language":"fr","tag":"Plugins","count":32},{"language":"id","tag":"Plugin","count":32},{"language":"it","tag":"Plugin","count":32},{"language":"jp","tag":"プラグイン","count":32},{"language":"ko","tag":"Agent SDK","count":32},{"language":"ko","tag":"플러그인","count":32},{"language":"pt-BR","tag":"Plugins","count":32},{"language":"ru","tag":"Плагины","count":32},{"language":"zh-CN","tag":"插件","count":32},{"language":"zh-TW","tag":"外掛","count":32},{"language":"en","tag":"Reference","count":28},{"language":"es","tag":"Configuración","count":28},{"language":"jp","tag":"設定","count":28},{"language":"zh-TW","tag":"設定","count":28},{"language":"de","tag":"Konfiguration","count":25},{"language":"en","tag":"Configuration","count":25},{"language":"fr","tag":"Configuration","count":25},{"language":"id","tag":"Konfigurasi","count":25},{"language":"id","tag":"Apa yang Baru","count":25},{"language":"id","tag":"Yang Baru","count":25},{"language":"it","tag":"Configurazione","count":25},{"language":"jp","tag":"新機能","count":25},{"language":"jp","tag":"最新情報","count":25},{"language":"ko","tag":"구성","count":25},{"language":"pt-BR","tag":"Configuração","count":25},{"language":"ru","tag":"Конфигурация","count":25},{"language":"zh-CN","tag":"配置","count":25},{"language":"zh-CN","tag":"新功能","count":25},{"language":"zh-CN","tag":"最新动态","count":25},{"language":"en","tag":"Settings","count":24},{"language":"de","tag":"Mit Claude Code entwickeln","count":22},{"language":"es","tag":"Crea con Claude Code","count":22},{"language":"fr","tag":"Développer avec Claude Code","count":22},{"language":"id","tag":"Membangun dengan Claude Code","count":22},{"language":"it","tag":"Crea con Claude Code","count":22},{"language":"jp","tag":"Claude Code で構築","count":22},{"language":"ko","tag":"Claude Code로 만들기","count":22},{"language":"pt-BR","tag":"Desenvolva com Claude Code","count":22},{"language":"ru","tag":"Разработка с Claude Code","count":22},{"language":"zh-CN","tag":"使用 Claude Code 构建","count":22},{"language":"zh-TW","tag":"使用 Claude Code 打造","count":22},{"language":"de","tag":"Referenz","count":20},{"language":"es","tag":"Referencia","count":20},{"language":"fr","tag":"Référence","count":20},{"language":"id","tag":"Referensi","count":20},{"language":"it","tag":"Riferimento","count":20},{"language":"jp","tag":"リファレンス","count":20},{"language":"ko","tag":"레퍼런스","count":20},{"language":"pt-BR","tag":"Referência","count":20},{"language":"ru","tag":"Справочник","count":20},{"language":"zh-CN","tag":"参考","count":20},{"language":"de","tag":"Plattformen und Integrationen","count":19},{"language":"es","tag":"Plataformas e integraciones","count":19},{"language":"fr","tag":"Plateformes et intégrations","count":19},{"language":"id","tag":"Platform dan integrasi","count":19},{"language":"it","tag":"Piattaforme e integrazioni","count":19},{"language":"jp","tag":"プラットフォームと連携","count":19},{"language":"ko","tag":"플랫폼 및 통합","count":19},{"language":"pt-BR","tag":"Plataformas e integrações","count":19},{"language":"ru","tag":"Платформы и интеграции","count":19},{"language":"zh-CN","tag":"平台与集成","count":19},{"language":"zh-TW","tag":"平台與整合","count":19},{"language":"de","tag":"Code-Review und Pull Requests","count":14},{"language":"es","tag":"Revisión de código y pull requests","count":14},{"language":"fr","tag":"Revue de code et pull requests","count":14},{"language":"it","tag":"Code review e pull request","count":14},{"language":"ko","tag":"코드 리뷰 및 풀 리퀘스트","count":14},{"language":"pt-BR","tag":"Revisão de código e pull requests","count":14},{"language":"ru","tag":"Код-ревью и pull request","count":14},{"language":"zh-TW","tag":"程式碼審查與 pull request","count":14},{"language":"zh-TW","tag":"部署","count":11}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-bash","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"chat-bucketing-batched","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"button.css","content":".btn{position:relative;display:inline-flex;gap:.5rem;align-items:center;justify-content:center;flex-shrink:0;min-width:5rem;height:2.25rem;padding:.5rem 1rem;white-space:nowrap;font-family:Styrene;font-weight:600;border-radius:.5rem}"},{"filePath":"style.css","content":"@font-face{font-family:\"Anthropic Sans\";src:url(https://assets.claude.ai/Fonts/AnthropicSans-Text-Regular-Static.otf) format(\"opentype\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Sans\";src:url(https://assets.claude.ai/Fonts/AnthropicSans-Text-RegularItalic-Static.otf) format(\"opentype\");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:\"Anthropic Sans\";src:url(https://assets.claude.ai/Fonts/AnthropicSans-Text-Medium-Static.otf) format(\"opentype\");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Sans\";src:url(https://assets.claude.ai/Fonts/AnthropicSans-Text-MediumItalic-Static.otf) format(\"opentype\");font-weight:500;font-style:italic;font-display:swap}@font-face{font-family:\"Anthropic Sans\";src:url(https://assets.claude.ai/Fonts/AnthropicSans-Text-Semibold-Static.otf) format(\"opentype\");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Sans\";src:url(https://assets.claude.ai/Fonts/AnthropicSans-Text-SemiboldItalic-Static.otf) format(\"opentype\");font-weight:600;font-style:italic;font-display:swap}@font-face{font-family:\"Anthropic Sans\";src:url(https://assets.claude.ai/Fonts/AnthropicSans-Text-Bold-Static.otf) format(\"opentype\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Sans\";src:url(https://assets.claude.ai/Fonts/AnthropicSans-Text-BoldItalic-Static.otf) format(\"opentype\");font-weight:700;font-style:italic;font-display:swap}@font-face{font-family:\"Anthropic Serif Display\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Display-Regular-Static.otf) format(\"opentype\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Serif Display\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Display-RegularItalic-Static.otf) format(\"opentype\");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:\"Anthropic Serif Display\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Display-Medium-Static.otf) format(\"opentype\");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Serif Display\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Display-Semibold-Static.otf) format(\"opentype\");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Serif Display\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Display-Bold-Static.otf) format(\"opentype\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Serif\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Text-Regular-Static.otf) format(\"opentype\");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Serif\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Text-RegularItalic-Static.otf) format(\"opentype\");font-weight:400;font-style:italic;font-display:swap}@font-face{font-family:\"Anthropic Serif\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Text-Medium-Static.otf) format(\"opentype\");font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Serif\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Text-MediumItalic-Static.otf) format(\"opentype\");font-weight:500;font-style:italic;font-display:swap}@font-face{font-family:\"Anthropic Serif\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Text-Semibold-Static.otf) format(\"opentype\");font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Serif\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Text-SemiboldItalic-Static.otf) format(\"opentype\");font-weight:600;font-style:italic;font-display:swap}@font-face{font-family:\"Anthropic Serif\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Text-Bold-Static.otf) format(\"opentype\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Anthropic Serif\";src:url(https://assets.claude.ai/Fonts/AnthropicSerif-Text-BoldItalic-Static.otf) format(\"opentype\");font-weight:700;font-style:italic;font-display:swap}:root{--always-white:0 0% 100%;--always-black:0 0% 0%;--constant-book-cloth:15 55% 80%;--constant-clay:15 60% 85%;--constant-kraft:25 40% 83%;--constant-manilla:40 20% 92%;--constant-slate-000:0 0% 100%;--constant-slate-050:48 33.3% 97.1%;--constant-slate-100:53 28.6% 94.5%;--constant-slate-150:48 25% 92.2%;--constant-slate-200:50 20.7% 88.6%;--constant-slate-250:51 16.5% 84.5%;--constant-slate-300:50 11.5% 79.6%;--constant-slate-350:50 9% 73.7%;--constant-slate-400:49 6.5% 66.9%;--constant-slate-450:48 4.8% 59.2%;--constant-slate-500:53 3.2% 51.4%;--constant-slate-550:51 3.1% 43.7%;--constant-slate-600:48 2.7% 35.9%;--constant-slate-650:48 3.4% 29.2%;--constant-slate-700:60 2.5% 23.3%;--constant-slate-750:60 2.1% 18.4%;--constant-slate-800:60 2.7% 14.5%;--constant-slate-850:30 3.3% 11.8%;--constant-slate-900:30 4% 9.8%;--constant-slate-950:60 2.6% 7.6%;--constant-slate-1000:60 3.4% 5.7%}:root:not(.dark){--accent-brand:15 63.1% 59.6%;--accent-main-000:15 55.6% 52.4%;--accent-main-100:15 55.6% 52.4%;--accent-main-200:15 63.1% 59.6%;--accent-main-900:0 0% 0%;--accent-pro-000:251 34.2% 33.3%;--accent-pro-100:251 40% 45.1%;--accent-pro-200:251 61% 72.2%;--accent-pro-900:253 33.3% 91.8%;--accent-secondary-000:210 73.7% 40.2%;--accent-secondary-100:210 70.9% 51.6%;--accent-secondary-200:210 70.9% 51.6%;--accent-secondary-900:211 72% 90%;--bg-000:0 0% 100%;--bg-100:48 33.3% 97.1%;--bg-200:53 28.6% 94.5%;--bg-300:48 25% 92.2%;--bg-400:50 20.7% 88.6%;--bg-500:50 20.7% 88.6%;--border-100:30 3.3% 11.8%;--border-200:30 3.3% 11.8%;--border-300:30 3.3% 11.8%;--border-400:30 3.3% 11.8%;--danger-000:0 61.4% 22.4%;--danger-100:0 58.6% 34.1%;--danger-200:0 58.6% 34.1%;--danger-900:0 50% 95%;--oncolor-100:0 0% 100%;--oncolor-200:60 6.7% 97.1%;--oncolor-300:60 6.7% 97.1%;--text-000:60 2.6% 7.6%;--text-100:60 2.6% 7.6%;--text-200:60 2.5% 23.3%;--text-300:60 2.5% 23.3%;--text-400:51 3.1% 43.7%;--text-500:51 3.1% 43.7%}:root.dark{--accent-brand:15 63.1% 59.6%;--accent-main-000:15 55.6% 52.4%;--accent-main-100:15 63.1% 59.6%;--accent-main-200:15 63.1% 59.6%;--accent-main-900:0 0% 0%;--accent-pro-000:251 84.6% 74.5%;--accent-pro-100:251 40.2% 54.1%;--accent-pro-200:251 40% 45.1%;--accent-pro-900:250 25.3% 19.4%;--accent-secondary-000:210 71.1% 62%;--accent-secondary-100:210 70.9% 51.6%;--accent-secondary-200:210 70.9% 51.6%;--accent-secondary-900:210 55.9% 24.6%;--bg-000:60 2.1% 18.4%;--bg-100:60 2.7% 14.5%;--bg-200:30 3.3% 11.8%;--bg-300:60 2.6% 7.6%;--bg-400:60 3.4% 5.7%;--bg-500:60 3.4% 5.7%;--border-100:51 16.5% 84.5%;--border-200:51 16.5% 84.5%;--border-300:51 16.5% 84.5%;--border-400:51 16.5% 84.5%;--danger-000:0 73.1% 66.5%;--danger-100:0 58.6% 34.1%;--danger-200:0 58.6% 34.1%;--danger-900:0 23% 15.6%;--oncolor-100:0 0% 100%;--oncolor-200:60 6.7% 97.1%;--oncolor-300:60 6.7% 97.1%;--text-000:48 33.3% 97.1%;--text-100:48 33.3% 97.1%;--text-200:50 9% 73.7%;--text-300:50 9% 73.7%;--text-400:48 4.8% 59.2%;--text-500:48 4.8% 59.2%}#home-header{font-family:\"Anthropic Sans\",system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;font-weight:400!important;font-size:50px;line-height:1.2;margin-bottom:1rem;color:--text-000;display:flex;align-items:baseline;justify-content:center;flex-wrap:nowrap}#localization-select-trigger>:has(img[src*=flags]),div[id^=localization-select-item]>:has(img[src*=flags]){display:none}@media (min-width:768px){#home-header{justify-content:center}}.build-with{font-family:\"Anthropic Sans\",system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;letter-spacing:-.02em}.claude-wordmark-wrapper{display:inline-flex;align-items:baseline;margin-left:10px}.claude-wordmark{height:40px;width:auto;position:relative}.dark #home-header,.dark .description-text{color:#fff}.description-text{color:#000}.dark .claude-wordmark{filter:invert(1)}:root{--bg-color:#f0efea}.dark{--bg-color:#2b2b2b}#category-select,#content-container,#table-of-contents,.dropdown-item,.eyebrow,body,input{font-family:\"Anthropic Sans\",system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif}.eyebrow{text-transform:uppercase;letter-spacing:.02rem}#content-container h1,#content-container h2,#content-container h3,#content-container h4,#content-container h5,#content-container h6{font-family:\"Anthropic Serif Display\",Georgia,\"Times New Roman\",Times,serif;font-weight:400;letter-spacing:0;word-spacing:.1em}#content-container p{font-size:1rem;line-height:1.65rem}.font-extrabold{font-weight:600!important}.wide-table{width:100%;overflow-x:auto}.wide-table table{width:175%;margin-bottom:0}#prompt-library-container{margin:4rem auto;max-width:48rem;padding-left:1.25rem;padding-right:1.25rem}.prompt-library-title{font-size:24px;text-align:center;font-weight:700;color:#1f2937}.dark .prompt-library-title{color:#e5e7eb}.prompt-library-description{margin-top:1rem;text-align:center}.main-content{margin-bottom:10rem;max-width:64rem;margin-left:auto;margin-right:auto;padding-left:1.25rem;padding-right:1.25rem}.prompt-controllers{display:flex;gap:.5rem}.prompt-search-container{position:relative;flex:1 1 0%}.prompt-search-icon-container{display:flex;position:absolute;top:0;bottom:0;left:0;align-items:center;padding-left:.75rem}.prompt-search-icon{margin-left:.25rem;margin-right:.75rem;flex:none;width:1rem;height:1rem;background-color:#6b7280;mask-image:url(https://mintlify.b-cdn.net/v6.5.1/solid/magnifying-glass.svg);mask-repeat:no-repeat;mask-position:center center}input.prompt-search-bar{display:block;height:2.5rem;padding-left:2.5rem;border-radius:.75rem;border-width:1px;background-color:#fff;width:100%;color:#111827;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.dark input.prompt-search-bar{color:#fff;background-color:rgb(var(--background-dark));border-color:#d1d5db1a}input.prompt-search-bar:focus{outline-color:rgb(var(--primary))}.dark input.prompt-search-bar:focus{outline-color:rgb(var(--primary-light))}.dark .dropdown-icon,.dark .prompt-search-icon{background-color:#ffffff80}#category-select{padding-left:1rem;padding-right:2.5rem;height:2.5rem;display:flex;align-items:center;border-radius:.75rem;border-width:1px;color:#111827;background-color:#fff;cursor:pointer;box-shadow:0 1px 2px 0 rgba(0,0,0,.05);white-space:nowrap}.dark #category-select{background-color:rgb(var(--background-dark));border-color:#d1d5db1a;color:#fff}#category-select:hover,.dropdown-item:hover{background-color:#f9fafb}.dark #category-select:hover,.dark .dropdown-item:hover{background-color:#ffffff0d}#category-select:focus{outline-color:rgb(var(--primary))}.dark #category-select:focus{outline-color:rgb(var(--primary-light))}#categories-dropdown{top:calc(100% + 4px);padding:.5rem;display:none;position:absolute;z-index:10;border-radius:.75rem;border-width:1px;width:100%;color:#111827;background-color:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.dark #categories-dropdown{background-color:rgb(var(--background-dark));border-color:#d1d5db1a;color:#fff}#categories-dropdown-clickout{position:fixed;top:0;right:0;bottom:0;left:0;z-index:0}.dropdown-icon-container{display:flex;position:absolute;top:0;bottom:0;right:0;align-items:center;padding-right:.25rem}.dropdown-icon{margin-left:.25rem;margin-right:.75rem;flex:none;width:.75rem;height:.75rem;background-color:#6b7280;mask-image:url(https://mintlify.b-cdn.net/v6.5.1/solid/caret-down.svg);mask-repeat:no-repeat;mask-position:center center}#prompts-container{grid-template-columns:repeat(1,minmax(0,1fr));gap:2rem;display:grid;margin-top:2.5rem}.dropdown-item{padding:.25rem .5rem;border-radius:.375rem;display:flex;align-items:center;cursor:pointer}.check-icon{mask-image:url(https://mintlify.b-cdn.net/v6.5.1/solid/check.svg);height:.875rem;width:1rem;background-color:rgb(var(--primary-light));mask-repeat:no-repeat;mask-position:center center}.prompt-card{margin:-.75rem;padding:.75rem;display:flex;border-radius:1rem}.prompt-card:hover{background-color:#03071208}.dark .prompt-card:hover{background-color:#ffffff08}.prompt-icon-container{display:flex;flex:none;align-items:center;justify-content:center;margin-right:1.5rem;border-radius:.75rem;height:4rem;width:4rem;background-color:#cb785c1a}.prompt-icon{height:1.5rem;width:1.5rem;background-color:rgb(var(--primary-light));mask-repeat:no-repeat;mask-position:center center}.prompt-title{color:rgb(31 41 55);font-weight:600}.dark .prompt-title{color:rgb(229 231 235)}.prompt-description{margin-top:.25rem}@media (min-width:640px){#category-select{width:16rem}}@media (min-width:1024px){#prompts-container{grid-template-columns:repeat(2,minmax(0,1fr))}}.home-cards-custom{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,auto);gap:1.5rem}.home-cards-custom .card{background:0 0;border:.5px solid hsl(var(--border-300));border-radius:12px;padding:.25rem}@media (max-width:1024px){.home-cards-custom{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(3,auto)}}@media (max-width:768px){.home-cards-custom{grid-template-columns:1fr;grid-template-rows:repeat(6,auto)}}.relative{position:relative}.flex-1{flex:1 1 0%}.mermaid{position:relative;background-color:#fdfdfb;background-image:linear-gradient(rgba(235,219,188,.25) 1px,transparent 1px),linear-gradient(90deg,rgba(235,219,188,.25) 1px,transparent 1px),linear-gradient(rgba(235,219,188,.1) 1px,transparent 1px),linear-gradient(90deg,rgba(235,219,188,.1) 1px,transparent 1px);background-size:20px 20px,20px 20px,4px 4px,4px 4px;background-position:-1px -1px,-1px -1px,-1px -1px,-1px -1px;padding:20px;border-radius:8px;border:1px solid rgba(235,219,188,.4);box-shadow:0 2px 4px rgba(64,64,62,.08)}.dark .mermaid{background-color:#1a1918;background-image:linear-gradient(rgba(212,162,127,.15) 1px,transparent 1px),linear-gradient(90deg,rgba(212,162,127,.15) 1px,transparent 1px),linear-gradient(rgba(212,162,127,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(212,162,127,.08) 1px,transparent 1px);border:1px solid rgba(102,102,99,.5);box-shadow:0 2px 4px rgba(0,0,0,.2)}.digest-meta{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem 1rem;padding:.75rem 1rem;margin:1.5rem 0 2.5rem;border:1px solid hsl(var(--border-300)/.15);background:hsl(var(--bg-200));font-variant-numeric:tabular-nums;font-size:.875rem;color:hsl(var(--text-400))}#content-container .digest-meta a{color:hsl(var(--accent-main-100));font-weight:500;text-decoration:none;border-bottom:none}#content-container .digest-meta a:hover{text-decoration:underline}.digest-feature{position:relative;margin:2.5rem 0;padding:1.875rem 1.875rem 1.625rem;background:radial-gradient(circle,hsl(var(--text-000)/.025) 1px,transparent 1px) 0 0/18px 18px,linear-gradient(180deg,hsl(var(--constant-manilla)/.55),hsl(var(--constant-manilla)/.38));border:1px solid hsl(var(--border-300)/.12);box-shadow:inset 0 1px 0 hsl(var(--text-000)/.04),0 1px 2px hsl(var(--always-black)/.04)}.digest-feature::before{content:\"\";position:absolute;inset:0 auto 0 0;width:4px;background:hsl(var(--accent-brand))}.dark .digest-feature{background:radial-gradient(circle,hsl(var(--text-000)/.02) 1px,transparent 1px) 0 0/18px 18px,linear-gradient(180deg,hsl(var(--bg-000)/.75),hsl(var(--bg-000)/.5));border-color:hsl(var(--border-300)/.1);box-shadow:inset 0 1px 0 hsl(var(--text-000)/.03),0 1px 2px hsl(var(--always-black)/.25)}.digest-feature>:first-child{margin-top:0}.digest-feature>:last-child{margin-bottom:0}.digest-feature-header{display:flex;align-items:center;flex-wrap:wrap;gap:.625rem;margin:0 0 .75rem}#content-container .digest-feature-title{font-family:\"Anthropic Serif Display\",Georgia,serif;font-size:1.75rem;line-height:1.15;font-weight:500;letter-spacing:-.015em;color:hsl(var(--text-000));margin:0}#content-container .digest-feature-pill{font-family:ui-monospace,\"SF Mono\",Menlo,Consolas,monospace;font-size:.75rem;line-height:1;letter-spacing:.01em;padding:.3rem .6rem;border-radius:999px;background:hsl(var(--accent-brand)/.12);color:hsl(var(--accent-main-000));border:1px solid hsl(var(--accent-brand)/.25);white-space:nowrap;transform:translateY(1px)}#content-container .digest-feature-lede{font-size:1.0625rem;line-height:1.65;color:hsl(var(--text-100));margin:0 0 1.25rem;max-width:none}#content-container .digest-feature-lede code{font-size:.875em;padding:.1em .35em}#content-container .digest-feature-try{font-size:.875rem;color:hsl(var(--text-400));margin:1.25rem 0 .5rem}#content-container .digest-feature .frame{margin:1rem 0;border-radius:0;padding:0}#content-container .digest-feature .frame>*,#content-container .digest-feature [class*=CodeBlock],#content-container .digest-feature pre{border-radius:0}#content-container .digest-feature-link{display:inline-flex;align-items:center;gap:.35rem;font-size:.875rem;font-weight:500;color:hsl(var(--accent-main-100));text-decoration:none;border-bottom:none;margin-top:.75rem}#content-container .digest-feature-link::after{content:\"→\";transition:transform 120ms ease-out}#content-container .digest-feature-link:hover::after{transform:translateX(3px)}.digest-wins{margin:2.5rem 0;padding:1.5rem 1.75rem 1.25rem;background:hsl(var(--bg-200));border:1px solid hsl(var(--border-300)/.1)}.dark .digest-wins{background:hsl(var(--bg-200)/.6)}#content-container .digest-wins-title{font-family:\"Anthropic Serif Display\",Georgia,serif;font-size:1.25rem;font-weight:500;color:hsl(var(--text-000));margin:0 0 .75rem}.digest-wins-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(16rem,1fr));column-gap:2rem}#content-container .digest-wins-grid>div{position:relative;font-size:.875rem;line-height:1.5;color:hsl(var(--text-300));padding:.5rem 0 .5rem 1.125rem;border-top:1px solid hsl(var(--border-300)/.06);margin:0}#content-container .digest-wins-grid>div::before{content:\"+\";position:absolute;left:0;top:.5rem;font-family:ui-monospace,\"SF Mono\",Menlo,Consolas,monospace;font-size:.8125rem;font-weight:600;color:hsl(var(--accent-brand))}#content-container .digest-wins-grid>div:first-child,#content-container .digest-wins-grid>div:nth-child(2){border-top:none;padding-top:0}#content-container .digest-wins-grid>div:first-child::before,#content-container .digest-wins-grid>div:nth-child(2)::before{top:0}#content-container .digest-wins-grid code{font-size:.8125rem;padding:.1em .3em}:root{--toc-wrapper-max:92rem;--toc-wrapper-pad:2rem;--toc-col:19rem;--toc-side:28rem;--toc-btn-size:1.75rem}#toc-collapse-toggle{display:none;align-items:center;justify-content:center;position:fixed;top:10rem;right:calc(max((100% - var(--toc-wrapper-max))/2,0px) + var(--toc-wrapper-pad) + var(--toc-col) - var(--toc-btn-size) - .35rem);transition:right 200ms ease-out;z-index:30;width:var(--toc-btn-size);height:var(--toc-btn-size);border-radius:9999px;border:1px solid hsl(var(--border-300)/.15);background:hsl(var(--bg-100));color:hsl(var(--text-400));cursor:pointer}#toc-collapse-toggle:hover{background:hsl(var(--bg-300));color:hsl(var(--text-100))}#toc-collapse-toggle svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}#toc-collapse-toggle .toc-glyph{display:none;stroke-width:2}@media print{#toc-collapse-toggle{display:none!important}}@media (prefers-reduced-motion:reduce){#toc-collapse-toggle{transition:none}}@media (min-width:1280px){html:has(#table-of-contents-layout) #toc-collapse-toggle{display:flex}html.toc-collapsed #toc-collapse-toggle .toc-chevron{transform:rotate(180deg)}html.toc-collapsed #toc-collapse-toggle{right:.5rem;width:auto;padding:0 .5rem;gap:.25rem}html.toc-collapsed #toc-collapse-toggle .toc-glyph{display:block}html.toc-collapsed #table-of-contents-layout{display:none!important}html.toc-collapsed #content-side-layout:has(#table-of-contents-layout){display:none!important}html.toc-collapsed #content-container:has(#table-of-contents-layout) #content-area{width:100%!important}html.toc-collapsed #content-container:has(#table-of-contents-layout) #content-area>*{max-width:calc(var(--toc-wrapper-max) - var(--toc-side))}}@media (max-width:640px){.digest-feature{margin:1.5rem 0}#content-container .digest-feature-title{font-size:1.375rem}.digest-feature,.digest-wins{padding:1.25rem 1rem 1rem}.digest-wins-grid{grid-template-columns:1fr}#content-container .digest-wins-grid>div:nth-child(2){border-top:1px solid hsl(var(--border-300)/.06);padding-top:.5rem}#content-container .digest-wins-grid>div:nth-child(2)::before{top:.5rem}}[role=menu]:has(>.nav-dropdown-item){width:340px;max-width:calc(100vw - 32px);max-height:min(680px,calc(100vh - 130px));padding:8px;border-radius:16px}[role=menu]:has(>.nav-dropdown-item:nth-child(5)){width:640px;display:grid;grid-template-columns:1fr 1fr;column-gap:8px;align-content:start}.nav-dropdown-item{padding:9px 12px}.nav-dropdown-item span.text-sm{font-size:14.5px;font-weight:600;color:#141413}.nav-dropdown-item span.text-xs{font-size:13.5px;line-height:1.4;color:#73726c}.dark .nav-dropdown-item span.text-sm{color:#faf9f5}.dark .nav-dropdown-item span.text-xs{color:#97958c}@media (max-width:700px){[role=menu]:has(>.nav-dropdown-item:nth-child(5)){width:340px;display:block}}.nav-tabs .nav-tabs-item:focus-visible{outline:2px solid currentColor;outline-offset:-4px;border-radius:8px}#navigation-items button[aria-haspopup=menu]:not(#localization-select-trigger)~button[aria-haspopup=menu]{display:none}[data-base-ui-portal]:has(.nav-dropdown-item):has(~[data-base-ui-portal] .nav-dropdown-item){visibility:hidden;pointer-events:none}"}],"page":{"pagePath":"en/costs","slug":"/en/costs","pageMetadata":{"sidebarTitle":"Costs","title":"Manage costs effectively","description":"Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.","keywords":["cost","pricing","price","tokens","usage","spend","billing"],"href":"/en/costs"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Step,Steps,Tab,Table,Tabs}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Claude Code charges by API token consumption. For subscription plan pricing (Pro, Max, Team, Enterprise), see `,_jsx(_components.a,{href:`https://claude.com/pricing`,children:`claude.com/pricing`}),`. Per-developer costs vary widely based on model selection, codebase size, and usage patterns such as running multiple instances or automation.`]}),`\n`,_jsx(_components.p,{children:`Across enterprise deployments, the average cost is around $13 per developer per active day and $150-250 per developer per month, with costs remaining below $30 per active day for 90% of users. To estimate spend for your own team, start with a small pilot group and use the tracking tools below to establish a baseline before wider rollout.`}),`\n`,_jsxs(_components.p,{children:[`This page covers Claude Code usage only: how to `,_jsx(_components.a,{href:`#track-your-costs`,children:`track your costs`}),`, `,_jsx(_components.a,{href:`#manage-costs-for-your-organization`,children:`manage costs for your organization`}),`, and `,_jsx(_components.a,{href:`#reduce-token-usage`,children:`reduce token usage`}),`. For usage limits in other Claude products, see the `,_jsx(_components.a,{href:`https://support.claude.com`,children:`Claude Help Center`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`track-your-costs`,children:`Track your costs`}),`\n`,_jsxs(Heading,{level:`3`,id:`using-the-/usage-command`,children:[`Using the `,_jsx(_components.code,{children:`/usage`}),` command`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The Session block in `,_jsx(_components.code,{children:`/usage`}),` shows API token usage and is intended for API users. Claude Max and Pro subscribers have usage included in their subscription, so the session cost figure isn’t relevant for billing purposes. Subscribers see plan usage bars, activity stats, and a usage breakdown on the same screen.`]})}),`\n`,_jsxs(_components.p,{children:[`The Session block at the top of `,_jsx(_components.code,{children:`/usage`}),` shows detailed token usage statistics for your current session. Claude Code computes the dollar figure locally from token counts at list price, unless a `,_jsx(_components.a,{href:`/en/settings-reference#modelpricing`,children:_jsx(_components.code,{children:`modelPricing`})}),` table is in effect. An administrator sets one in your organization’s managed settings so the figure uses your contracted rates, and while a table is in effect the `,_jsx(_components.code,{children:`Total cost`}),` line carries the note `,_jsx(_components.code,{children:`at your organization's configured rates`}),`. The figure is an estimate, so for authoritative billing see the Usage page in the `,_jsx(_components.a,{href:`https://platform.claude.com/usage`,children:`Claude Console`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Total cost: $0.55`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Total duration (API): 6m 20s`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Total duration (wall): 6h 33m 10s`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Total code changes: 0 lines added, 0 lines removed`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Usage by model:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` claude-sonnet-4-6: 1.2k input, 5.3k output, 940.0k cache read, 50.0k cache write ($0.55)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`These totals reset when `,_jsx(_components.code,{children:`/clear`}),` starts a new session, so the next session’s total cost starts at $0. Before v2.1.211, they kept accumulating across `,_jsx(_components.code,{children:`/clear`}),` for the lifetime of the Claude Code process.`]}),`\n`,_jsxs(_components.p,{children:[`For a response from the Claude API billed at the 1.1× `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/about-claude/pricing#data-residency-pricing`,children:`data residency rate`}),`, Claude Code multiplies the list price of that response’s tokens by 1.1 in the session cost figure. The same total appears in the `,_jsx(_components.a,{href:`/en/statusline#cost-and-duration-tracking`,children:`status line’s cost field`}),`, and the multiplied figure also counts toward `,_jsx(_components.a,{href:`/en/cli-reference#cli-flags`,children:_jsx(_components.code,{children:`--max-budget-usd`})}),`.`]}),`\n`,_jsx(Heading,{level:`4`,id:`prompt-cache-statistics`,children:`Prompt cache statistics`}),`\n`,_jsxs(_components.p,{children:[`After the main conversation’s first API response, Claude Code also adds a `,_jsx(_components.code,{children:`Prompt cache (main)`}),` line to the Session block, summarizing the session’s `,_jsx(_components.a,{href:`/en/prompt-caching`,children:`prompt cache`}),` use: the request count, the share of input tokens served from cache, cache misses, and whether the cache is warm right now. Requires Claude Code v2.1.251 or later.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Prompt cache (main): 14 requests · 91% of input tokens from cache · 2 misses (last 6m 10s ago, 310.2k tokens re-cached) · 1 expected rebuild (compaction or tool-result clearing) · warm (1h TTL, last activity 40s ago)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`The misses, expected rebuilds, and warm or cold parts of the line mean the following:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Misses`}),`: requests that re-processed content the cache already held, with the time of the last miss and how many tokens those requests wrote back to the cache. `,_jsx(_components.a,{href:`/en/prompt-caching#actions-that-invalidate-the-cache`,children:`Actions that invalidate the cache`}),` lists the usual causes. When Claude Code can identify a likely cause for the last miss, the line names it too, for example `,_jsx(_components.code,{children:`likely cause: tool definitions changed`}),`. The likely-cause text requires Claude Code v2.1.260 or later.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Expected rebuilds`}),`: when Claude Code has itself just rewritten the conversation, by `,_jsx(_components.a,{href:`/en/prompt-caching#compacting-the-conversation`,children:`compaction`}),` or by clearing old tool results from context, it counts the same kind of miss as an expected rebuild instead. This part appears only after at least one expected rebuild has happened.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Warm or cold`}),`: whether the cached prefix is still within its `,_jsx(_components.a,{href:`/en/prompt-caching#cache-lifetime`,children:`cache lifetime`}),`, with the TTL in effect. When the cache is cold, the line shows how long the session has been idle. When no response has reported cache tokens, the line ends with `,_jsx(_components.code,{children:`no prompt caching reported by the API`}),` instead.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The counts come from the cache token fields in the API’s responses, so the line works on every provider and gateway. It covers the main conversation only, not subagents. `,_jsx(_components.code,{children:`/clear`}),` resets it with the rest of the Session block.`]}),`\n`,_jsxs(_components.p,{children:[`Status line scripts can read the same numbers from the `,_jsxs(_components.a,{href:`/en/statusline#prompt-cache-fields`,children:[_jsx(_components.code,{children:`prompt_cache`}),` object`]}),`.`]}),`\n`,_jsx(Heading,{level:`4`,id:`plan-usage-breakdown`,children:`Plan usage breakdown`}),`\n`,_jsxs(_components.p,{children:[`On a Pro, Max, Team, or Enterprise plan, `,_jsx(_components.code,{children:`/usage`}),` also shows a breakdown of what counts against your plan limits, with recommendations:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Attribution`}),`: recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total. An MCP server’s share counts only the requests that consumed one of its tool results. Before v2.1.222, after one call to an MCP server, Claude Code attributed every subsequent request to that server, overstating its share.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Recommendations`}),`: suggested changes, one per row. Each row starts with a share of your recent usage, at least 10%, as in `,_jsx(_components.code,{children:`25% Trim ~/code/api/CLAUDE.md · 49k tokens per request`}),`.`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`How to read the share`}),`: it tells you how much of your usage the row applies to, not how much the change saves. One request can count toward several rows, so the shares can add up to more than 100%.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`How to apply recommendations`}),`: to have Claude Code apply the ones it can, see `,_jsx(_components.a,{href:`#apply-recommendations-with-the-fix-shortcut`,children:`Apply recommendations with the fix shortcut`})]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Loops`}),`: a row for each of the heaviest `,_jsxs(_components.a,{href:`/en/scheduled-tasks`,children:[_jsx(_components.code,{children:`/loop`}),` or other session-scoped scheduled tasks`]}),` that ran recently, ordered by total tokens, with a count of the rest. Requires Claude Code v2.1.242 or later.`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`What each row reports`}),`: how often the task fires, how many times it ran, its total and per-run tokens, and when it last ran`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Stopped and re-created loops`}),`: Claude Code keys a row by the task’s prompt, so a loop you stop and re-create stays one row`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Press `,_jsx(_components.code,{children:`d`}),` or `,_jsx(_components.code,{children:`w`}),` to switch between the last 24 hours and the last 7 days. The figures are approximate and computed from local session history on this machine, so usage from other devices or claude.ai is not included.`]}),`\n`,_jsxs(_components.p,{children:[`In the `,_jsx(_components.a,{href:`/en/vs-code#check-account-and-usage`,children:`VS Code extension`}),`, the attribution shares and recommendations appear in the Account \u0026 usage dialog with a Day and Week toggle, without the Loops rows.`]}),`\n`,_jsx(Heading,{level:`4`,id:`apply-recommendations-with-the-fix-shortcut`,children:`Apply recommendations with the fix shortcut`}),`\n`,_jsxs(_components.p,{children:[`When the `,_jsx(_components.code,{children:`/usage`}),` footer shows a hint such as `,_jsx(_components.code,{children:`f to fix 2 of 3`}),`, press `,_jsx(_components.code,{children:`f`}),` to have Claude Code act on the recommendations it can. The `,_jsx(_components.code,{children:`f`}),` shortcut requires Claude Code v2.1.305 or later.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`After any turn in progress ends, Claude Code runs each `,_jsx(_components.a,{href:`/en/model-config#adjust-effort-level`,children:_jsx(_components.code,{children:`/effort`})}),` command shown in a row without `,_jsx(_components.code,{children:`run`}),`.`]}),`\n`,_jsx(_components.li,{children:`Claude then gets one prompt with a step for each of the other rows it can act on. The prompt asks Claude to show you each change before making it.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`To see what pressing `,_jsx(_components.code,{children:`f`}),` does with each of your rows, find the row’s shape in the first column:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`Row shape`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Example row`}),_jsxs(_components.th,{style:{textAlign:`left`},children:[`When you press `,_jsx(_components.code,{children:`f`})]})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[`Ends in an `,_jsx(_components.code,{children:`/effort`}),` command with no `,_jsx(_components.code,{children:`run`}),` before it`]}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`40% Switch from max to high effort · /effort high`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Claude Code runs the command`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{style:{textAlign:`left`},children:[`Ends in `,_jsx(_components.code,{children:`run`}),` and a command`]}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`30% Compact before you step away · run /compact`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Nothing happens for this row. Run the command yourself at the Claude Code prompt`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Ends in anything else`}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`25% Trim ~/code/api/CLAUDE.md · 49k tokens per request`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Claude gets a step in the prompt for some of these rows, and nothing happens for the rest. If Claude shows you no change for a row, follow that recommendation yourself`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`In `,_jsx(_components.code,{children:`f to fix 2 of 3`}),`, the first number counts the rows Claude Code acts on when you press `,_jsx(_components.code,{children:`f`}),`, and the second counts the rows shown. A hint with no `,_jsx(_components.code,{children:`of`}),` in it, such as `,_jsx(_components.code,{children:`f to fix both`}),`, means Claude Code acts on every row shown.`]}),`\n`,_jsxs(_components.p,{children:[`While `,_jsx(_components.a,{href:`/en/remote-control`,children:`Remote Control`}),` is connected, the footer shows no `,_jsx(_components.code,{children:`f`}),` hint. If pressing `,_jsx(_components.code,{children:`f`}),` closes `,_jsx(_components.code,{children:`/usage`}),` with `,_jsx(_components.code,{children:`Nothing was sent. Turn off Remote Control to use fixes.`}),`, Remote Control connected while `,_jsx(_components.code,{children:`/usage`}),` was open. To use `,_jsx(_components.code,{children:`f`}),` again, `,_jsx(_components.a,{href:`/en/remote-control#check-connection-status`,children:`disconnect Remote Control`}),`, then run `,_jsx(_components.code,{children:`/usage`}),` at the Claude Code prompt and press `,_jsx(_components.code,{children:`f`}),` again.`]}),`\n`,_jsx(Heading,{level:`4`,id:`check-your-usage-credits-spend`,children:`Check your usage-credits spend`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`/usage`}),` also shows a usage-credits row while `,_jsx(_components.a,{href:`#add-usage-credits-to-your-subscription`,children:`usage credits`}),` are on. What the row shows depends on your plan:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Pro and Max`}),`: your spend for the current month, measured against your monthly spend limit when you have set one. When you haven’t set a limit, the row shows `,_jsx(_components.code,{children:`Unlimited`}),` and no spend figure.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Team and Enterprise`}),`: your own spend for the current month, measured against any `,_jsx(_components.a,{href:`#claude-for-teams-and-enterprise`,children:`limit your organization set`}),` that applies to you. A limit that covers the whole organization doesn’t appear in the row. When you have no limit of your own, the row shows your spend with no limit beside it. While usage credits are off for you, `,_jsx(_components.code,{children:`/usage`}),` shows no usage-credits row.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`When you have a spend limit, the row appears as soon as usage credits are on and shows 0% until you first spend usage credits. Before v2.1.236, `,_jsx(_components.code,{children:`/usage`}),` showed the row only on Pro and Max plans, and a row with a spend limit stayed hidden until you had spent something.`]}),`\n`,_jsx(Heading,{level:`4`,id:`when-the-usage-request-fails`,children:`When the usage request fails`}),`\n`,_jsxs(_components.p,{children:[`When the request for your plan limits fails, most often because the usage endpoint is rate limited, `,_jsx(_components.code,{children:`/usage`}),` shows the last usage bars it loaded on this machine within the past 60 minutes, along with a `,_jsx(_components.code,{children:`Showing last-known usage`}),` note stating how long ago that data was fetched. Press `,_jsx(_components.code,{children:`r`}),` to retry; a successful retry replaces the last-known bars with fresh data. Without a snapshot from the past 60 minutes, `,_jsx(_components.code,{children:`/usage`}),` reports that the usage endpoint is rate limited and offers the same retry shortcut. Before v2.1.208, a rate-limited request in a session that hadn’t loaded usage yet always showed the error with no bars.`]}),`\n`,_jsxs(_components.p,{children:[`A message such as `,_jsx(_components.code,{children:`rate limited until 3:14am`}),` in `,_jsx(_components.code,{children:`/usage`}),` means Claude Code can’t fetch your plan limits again until then, not that your work with Claude is limited. If you press `,_jsx(_components.code,{children:`r`}),` earlier, expect the same message. Press `,_jsx(_components.code,{children:`r`}),` after that time for fresh data.`]}),`\n`,_jsx(Heading,{level:`3`,id:`read-the-token-count-beside-the-spinner`,children:`Read the token count beside the spinner`}),`\n`,_jsxs(_components.p,{children:[`While Claude works in the main conversation, the line beside the spinner can end with an elapsed time and a token count, as in `,_jsx(_components.code,{children:`Deciphering… (10m 27s · ↓ 5.5k tokens)`}),`. It is a live, approximate count of the output the current turn has produced so far. The arrow beside the count points down while output arrives or tools run.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`What it covers`}),`: output the turn generates, such as the text and tool calls Claude streams back, its thinking, and the output of subagents that run in the `,_jsx(_components.a,{href:`/en/sub-agents#run-subagents-in-foreground-or-background`,children:`foreground`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`What it leaves out`}),`: what Claude Code sends to the model, so your prompt, the conversation history, and the rest of your context don’t move it`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`When it resets`}),`: at the start of each turn, and when Claude Code `,_jsx(_components.a,{href:`/en/prompt-caching#compacting-the-conversation`,children:`compacts the conversation`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`When it stays hidden`}),`: until output starts arriving, when the row is too narrow to fit it, and in `,_jsx(_components.a,{href:`/en/accessibility`,children:`screen reader mode`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`It won’t match the `,_jsx(_components.code,{children:`Usage by model`}),` output figures in the `,_jsx(_components.code,{children:`/usage`}),` Session block, which add up the whole session rather than one turn. It also differs from the token count `,_jsx(_components.a,{href:`/en/statusline#notifications-share-the-status-line-row`,children:`verbose mode adds`}),`, because that count measures the size of your context rather than one turn’s output.`]}),`\n`,_jsx(Heading,{level:`3`,id:`analyze-your-usage-patterns`,children:`Analyze your usage patterns`}),`\n`,_jsxs(_components.p,{children:[`Run `,_jsx(_components.a,{href:`/en/commands#all-commands`,children:_jsx(_components.code,{children:`/insights`})}),` for a report on how you work rather than how many tokens you’ve used. It analyzes your recent sessions on this machine and writes an HTML report covering what you work on, friction points such as misunderstood requests or buggy code, and suggestions for using Claude Code more effectively. A single run analyzes up to 200 sessions it hasn’t seen before and skips very short ones. When sessions are left out, the report header shows the analyzed count with the total in parentheses, for example `,_jsx(_components.code,{children:`200 sessions (412 total)`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`When `,_jsx(_components.a,{href:`/en/permission-modes#eliminate-prompts-with-auto-mode`,children:`auto mode`}),` is available to the session and your recent sessions mostly ran without it, the report can also include an estimate of how many permission prompts auto mode could have handled across those sessions.`]}),`\n`,_jsxs(_components.p,{children:[`Claude Code writes the latest report to `,_jsx(_components.code,{children:`~/.claude/usage-data/report.html`}),` and saves a timestamped copy of each run in the same directory, so earlier reports aren’t overwritten. Claude Code deletes reports on the same schedule as the rest of your session data: at startup, it removes files older than `,_jsx(_components.a,{href:`/en/claude-directory#cleaned-up-automatically`,children:_jsx(_components.code,{children:`cleanupPeriodDays`})}),`, 30 days by default.`]}),`\n`,_jsxs(_components.p,{children:[`You can run `,_jsx(_components.code,{children:`/insights`}),` on any plan and with any provider. The analysis runs through the same provider and account as your regular sessions, and the tokens count against your plan or API usage. Sessions from other devices and claude.ai aren’t included.`]}),`\n`,_jsx(Heading,{level:`3`,id:`add-usage-credits-to-your-subscription`,children:`Add usage credits to your subscription`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans`,children:`Usage credits`}),` let you keep working past your plan’s usage limit. To manage them, run `,_jsx(_components.code,{children:`/usage-credits`}),` after signing in with your claude.ai subscription through `,_jsx(_components.code,{children:`/login`}),`; the command isn’t available with API key authentication. In self-serve Enterprise organizations, Enterprise trials, and Enterprise organizations billed through AWS Marketplace, the command requires Claude Code v2.1.248 or later; earlier versions reject it with `,_jsx(_components.a,{href:`/en/errors#unknown-command`,children:_jsx(_components.code,{children:`Unknown command: /usage-credits`})}),`. What it opens depends on your role:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`Your role`}),_jsxs(_components.th,{style:{textAlign:`left`},children:[`What `,_jsx(_components.code,{children:`/usage-credits`}),` does`]})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Pro or Max subscriber`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Opens `,_jsx(_components.a,{href:`https://claude.ai/settings/usage`,children:_jsx(_components.strong,{children:`Settings > Usage`})}),` on claude.ai in the browser. In its `,_jsx(_components.strong,{children:`Usage credits`}),` section you can turn usage credits on or off and check your credit balance, this month’s spend, and your monthly spend limit`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Team or Enterprise member with billing access`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Opens your organization’s usage settings, `,_jsx(_components.a,{href:`https://claude.ai/admin-settings/usage`,children:_jsx(_components.strong,{children:`Organization settings > Usage`})}),`, in the browser`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:`Team or Enterprise member without billing access`}),_jsx(_components.td,{style:{textAlign:`left`},children:`Asks you to confirm, then sends a request to your organization’s admins. Before v2.1.211, Claude Code sent the request without a confirmation step`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`For Team and Enterprise members without billing access, the confirmation appears only in interactive sessions: in non-interactive mode with the `,_jsx(_components.code,{children:`-p`}),` flag and from `,_jsx(_components.a,{href:`/en/remote-control`,children:`Remote Control`}),`, the command sends no request and tells you to run it in an interactive session instead.`]}),`\n`,_jsxs(_components.p,{children:[`If you run `,_jsx(_components.code,{children:`/usage-credits`}),` again while your earlier request is waiting on an admin, Claude Code tells you a request has already been sent rather than sending a duplicate. After an admin dismisses your request, running the command again sends a new one. Before v2.1.222, a dismissed request also blocked new requests.`]}),`\n`,_jsxs(_components.p,{children:[`On Pro and Max plans, when you reach your spend limit with usage credits still available, Claude Code prompts you to raise or remove the limit without leaving the CLI. If the server rejects the change, see `,_jsx(_components.a,{href:`/en/errors#could-not-update-your-spend-limit`,children:`Could not update your spend limit`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`manage-costs-for-your-organization`,children:`Manage costs for your organization`}),`\n`,_jsx(_components.p,{children:`Which controls you have depends on how your organization accesses Claude Code: a Claude for Teams or Enterprise plan, the Claude Console, or a cloud provider. On Teams and Enterprise plans, usage draws from each member’s seat allowance. On the Console and on cloud providers, usage is billed per token to your organization. If your organization mixes sign-in methods, each developer is metered according to the one they authenticated with.`}),`\n`,_jsxs(_components.p,{children:[`The table maps each setup to where you see spend, where you cap it, and how you pull per-user numbers. On an individual Pro or Max plan you have no organization to manage, so track your own usage-credit spend, including `,_jsx(_components.a,{href:`/en/fast-mode#see-where-fast-mode-spend-appears`,children:`fast mode`}),`, under `,_jsx(_components.a,{href:`#add-usage-credits-to-your-subscription`,children:`Add usage credits to your subscription`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`Your setup`}),_jsx(_components.th,{style:{textAlign:`left`},children:`See spend`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Cap spend`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Per-user reporting`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.a,{href:`#claude-for-teams-and-enterprise`,children:`Claude for Teams or Enterprise`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.a,{href:`https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans`,children:`Spend report in org analytics`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Spend limits in admin settings`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.a,{href:`https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans`,children:`Spend report CSV`}),`; `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/api/admin/analytics`,children:`Enterprise Analytics API`}),` on Enterprise`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.a,{href:`#claude-console`,children:`Claude Console (API)`})}),_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.a,{href:`https://platform.claude.com/usage`,children:`Console usage page`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Workspace spend limits`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.a,{href:`https://platform.claude.com/claude-code`,children:`Console dashboard`}),`, `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api`,children:`Claude Code Analytics API`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.a,{href:`#cloud-providers`,children:`Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry`})}),_jsx(_components.td,{style:{textAlign:`left`},children:`Your cloud billing console`}),_jsx(_components.td,{style:{textAlign:`left`},children:`Your cloud’s budget controls`}),_jsxs(_components.td,{style:{textAlign:`left`},children:[_jsx(_components.a,{href:`/en/monitoring-usage`,children:`OpenTelemetry`}),` or an `,_jsx(_components.a,{href:`/en/llm-gateway`,children:`LLM gateway`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/en/monitoring-usage`,children:`OpenTelemetry export`}),` works on every setup and is the only option that streams per-user token and cost metrics into your own observability stack in near real time.`]}),`\n`,_jsx(Heading,{level:`3`,id:`report-spend-at-your-contracted-rates`,children:`Report spend at your contracted rates`}),`\n`,_jsxs(_components.p,{children:[`By default, Claude Code computes every cost figure it shows developers at list price, so if your organization pays contracted rates, the figures in `,_jsx(_components.code,{children:`/usage`}),`, the status line, and OpenTelemetry don’t match your bill. To make them match, set the `,_jsx(_components.a,{href:`/en/settings-reference#modelpricing`,children:_jsx(_components.code,{children:`modelPricing`})}),` managed setting to your rates. The setting changes what Claude Code reports, not what Anthropic charges. Requires Claude Code v2.1.242 or later.`]}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Take the rates from your contract`,children:_jsx(_components.p,{children:`Enter the per-million-token rates from your contract. Claude Code doesn’t fetch them from the Claude Console, so update the setting when the contract changes.`})}),_jsx(Step,{title:`Write the setting`,children:_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`multiplier`}),` below 1 for a flat discount or above 1 for a markup, list each model’s four per-token rates under `,_jsx(_components.code,{children:`overrides`}),`, or do both. A markup requires Claude Code v2.1.271 or later. The `,_jsxs(_components.a,{href:`/en/settings-reference#modelpricing`,children:[_jsx(_components.code,{children:`modelPricing`}),` entry`]}),` has the shape and a paste-ready example.`]})}),_jsx(Step,{title:`Deploy it through managed settings`,children:_jsxs(_components.p,{children:[`Deliver it as `,_jsx(_components.a,{href:`/en/managed-settings`,children:`managed settings`}),`: server-managed settings, an MDM policy, `,_jsx(_components.code,{children:`managed-settings.json`}),`, or a `,_jsx(_components.a,{href:`/en/managed-settings#compute-the-policy-with-a-helper-program`,children:`policy helper`}),`. Claude Code ignores the key in user, project, and local settings and in `,_jsx(_components.code,{children:`--settings`}),`.`]})})]}),`\n`,_jsxs(_components.p,{children:[`To confirm the rates are in effect, run `,_jsx(_components.code,{children:`/usage`}),` in a session that has `,_jsx(_components.a,{href:`/en/managed-settings#read-the-source-in-%2Fstatus`,children:`received the managed settings`}),`: the Session block’s `,_jsx(_components.code,{children:`Total cost`}),` line carries the note `,_jsx(_components.code,{children:`at your organization's configured rates`}),`. The figures are still estimates, not an invoice. The per-million-token prices in the `,_jsx(_components.code,{children:`/model`}),` picker stay at list price.`]}),`\n`,_jsx(Heading,{level:`3`,id:`claude-for-teams-and-enterprise`,children:`Claude for Teams and Enterprise`}),`\n`,_jsxs(_components.p,{children:[`On Claude for Teams and Enterprise plans, each member’s Claude Code usage draws from a per-seat allowance that resets on a rolling five-hour window and a weekly window. The allowance is shared with Claude chat and Cowork, and its size depends on the member’s `,_jsx(_components.a,{href:`https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan`,children:`seat tier`}),` (Standard or Premium). Your controls live in the claude.ai admin console, not the Claude Console.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`See spend`}),`: the `,_jsx(_components.a,{href:`https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans`,children:`spend report in org analytics`}),` shows estimated spend per user and per model, with CSV export, updated daily. The report covers usage-credit spend and appears once usage credits are turned on. Usage inside the seat allowance isn’t metered in dollars.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`See adoption`}),`: the `,_jsx(_components.a,{href:`https://claude.ai/analytics/claude-code`,children:`analytics dashboard`}),` shows daily active users, sessions, and contribution metrics, with CSV export of contribution data. See `,_jsx(_components.a,{href:`/en/analytics`,children:`track team usage with analytics`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cap spend`}),`: the seat allowance is the default ceiling. To let members continue past it, turn on `,_jsx(_components.a,{href:`https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans`,children:`usage credits`}),` and set spend limits at the organization, group, or individual member level.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Pull per-user numbers`}),`: on the Enterprise plan, the `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/api/admin/analytics`,children:`Enterprise Analytics API`}),` returns per-user usage and cost reports across Claude surfaces, including Claude Code. A Primary Owner creates a key with the `,_jsx(_components.code,{children:`read:analytics`}),` scope at `,_jsx(_components.a,{href:`https://claude.ai/analytics/api-keys`,children:`claude.ai/analytics/api-keys`}),`. On the Teams plan, export the `,_jsx(_components.a,{href:`https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans`,children:`spend report CSV`}),`, which lists token usage and estimated spend per user and per model.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`https://support.claude.com/en/articles/14782391-claude-enterprise-consumption-guide`,children:`Claude Enterprise consumption guide`}),` is the planning reference for admins. It explains how consumption differs across Claude chat, Claude Code, and Cowork, and gives per-user dollar starting points for budgeting. Budget more for a coding seat than a chat seat: each Claude Code turn carries file contents, tool calls, and multi-step reasoning, so one debugging session can consume more than a day of chat.`]}),`\n`,_jsx(Heading,{level:`3`,id:`claude-console`,children:`Claude Console`}),`\n`,_jsxs(_components.p,{children:[`API organizations manage Claude Code spend through `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/build-with-claude/workspaces`,children:`workspaces`}),`. You can `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/build-with-claude/workspaces#workspace-limits`,children:`set workspace spend limits`}),` on total Claude Code spend and `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/build-with-claude/workspaces#usage-and-cost-tracking`,children:`view cost and usage reporting`}),` in the Console.`]}),`\n`,_jsxs(Note,{children:[_jsx(_components.p,{children:`When you first authenticate Claude Code with your Claude Console account, a workspace called “Claude Code” is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage.`}),_jsxs(_components.p,{children:[`For organizations with custom rate limits, Claude Code traffic in this workspace counts toward your organization’s overall API rate limits. You can set a `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/api/rate-limits#setting-lower-limits-for-workspaces`,children:`workspace rate limit`}),` on this workspace’s Limits page in the Claude Console to cap Claude Code’s share and protect other production workloads.`]})]}),`\n`,_jsxs(_components.p,{children:[`For per-user reporting, the `,_jsx(_components.a,{href:`https://platform.claude.com/claude-code`,children:`Console dashboard`}),` shows spend and accepted lines per member, and the `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api`,children:`Claude Code Analytics API`}),` returns the same daily per-user metrics programmatically with an `,_jsx(_components.a,{href:`https://platform.claude.com/settings/admin-keys`,children:`Admin API key`}),`. See `,_jsx(_components.a,{href:`/en/analytics#access-analytics-for-api-customers`,children:`analytics for API customers`}),`.`]}),`\n`,_jsx(Heading,{level:`4`,id:`rate-limit-recommendations`,children:`Rate limit recommendations`}),`\n`,_jsx(_components.p,{children:`When setting up Claude Code for teams, consider these Token Per Minute (TPM) and Request Per Minute (RPM) per-user recommendations based on your organization size:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Team size`}),_jsx(_components.th,{children:`TPM per user`}),_jsx(_components.th,{children:`RPM per user`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`1-5 users`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`200k-300k`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`5-7`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`5-20 users`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`100k-150k`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2.5-3.5`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`20-50 users`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`50k-75k`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1.25-1.75`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`50-100 users`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`25k-35k`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`0.62-0.87`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`100-500 users`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`15k-20k`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`0.37-0.47`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`500+ users`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`10k-15k`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`0.25-0.35`})]})]})]}),`\n`,_jsx(_components.p,{children:`For example, if you have 200 users, you might request 20k TPM for each user, or 4 million total TPM (200*20,000 = 4 million).`}),`\n`,_jsx(_components.p,{children:`The TPM per user decreases as team size grows because fewer users tend to use Claude Code concurrently in larger organizations. These rate limits apply at the organization level, not per individual user, which means individual users can temporarily consume more than their calculated share when others aren’t actively using the service.`}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`If you anticipate scenarios with unusually high concurrent usage (such as live training sessions with large groups), you may need higher TPM allocations per user.`})}),`\n`,_jsx(Heading,{level:`3`,id:`cloud-providers`,children:`Cloud providers`}),`\n`,_jsxs(_components.p,{children:[`On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, Claude Code is billed per token to your cloud account, and spend controls live in your cloud provider’s billing console. Claude Code does not send metrics from your cloud back to Anthropic, so the `,_jsx(_components.a,{href:`/en/analytics`,children:`analytics dashboards`}),` and the Claude Code Analytics API do not cover this usage.`]}),`\n`,_jsx(_components.p,{children:`For per-user cost attribution, you have three options:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`OpenTelemetry`}),`: `,_jsx(_components.a,{href:`/en/monitoring-usage`,children:`export metrics`}),` from each developer’s machine to your own observability stack. This gives you per-user token counts, costs, and tool activity regardless of provider.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A Claude apps gateway`}),`: a self-hosted `,_jsx(_components.a,{href:`/en/claude-apps-gateway`,children:`Claude apps gateway`}),` provides per-user usage attribution, OTLP metrics with token counts, and `,_jsx(_components.a,{href:`/en/claude-apps-gateway-spend-limits`,children:`per-user spend limits`}),` on these providers.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`An LLM gateway`}),`: route all Claude Code traffic through a proxy that tracks spend per key. Several large enterprises reported using `,_jsx(_components.a,{href:`/en/llm-gateway`,children:`LiteLLM`}),`, an open-source tool that `,_jsx(_components.a,{href:`https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend`,children:`tracks spend by key`}),`. This project is unaffiliated with Anthropic and has not been audited for security.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`when-a-developer-asks-about-a-limit`,children:`When a developer asks about a limit`}),`\n`,_jsx(_components.p,{children:`Developers usually bring limit questions to their admin, so it helps to know which ceiling they hit. These situations mean different things:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`“You’ve hit your session limit” or “You’ve hit your weekly limit”`}),`: a seat-based usage window on a subscription plan, shared across all models, so the developer can’t restore access by switching models with `,_jsx(_components.code,{children:`/model`}),`. The message shows when the window resets. After the model-specific “You’ve hit your Opus limit” or “You’ve hit your Sonnet limit” message, switching to a model outside that family with `,_jsx(_components.code,{children:`/model`}),` does keep the developer working. See `,_jsx(_components.a,{href:`/en/errors#youve-hit-your-session-limit`,children:`usage limit errors`}),`. What the developer can do in the meantime:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Run `,_jsx(_components.code,{children:`/usage-credits`}),` to request usage beyond the allowance, if you have `,_jsx(_components.a,{href:`https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans`,children:`usage credits`}),` turned on.`]}),`\n`,_jsxs(_components.li,{children:[`On Claude Code v2.1.234 or later, `,_jsx(_components.a,{href:`/en/interactive-mode#wait-for-a-usage-limit-to-reset`,children:`wait and continue the interrupted task automatically after the reset`}),`; that section lists when Claude Code starts the wait on its own and when the developer picks it from `,_jsx(_components.code,{children:`/rate-limit-options`}),`. To control for your fleet whether Claude Code starts that wait on its own, set `,_jsx(_components.a,{href:`/en/settings-reference#autocontinueatusagelimit`,children:_jsx(_components.code,{children:`autoContinueAtUsageLimit`})}),` in `,_jsx(_components.a,{href:`/en/settings#settings-precedence`,children:`managed settings`}),`.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`“You’ve hit your individual spend limit”, “org’s monthly spend limit”, or “team’s shared budget”`}),`: the developer’s request would be billed to usage credits, and those credits have reached a spend limit you set. To let the developer continue, go to `,_jsx(_components.a,{href:`https://claude.ai/admin-settings/usage`,children:_jsx(_components.strong,{children:`Organization settings > Usage`})}),` and increase the limit the message names. When the message also names a plan reset time, the developer can instead wait until then. See `,_jsx(_components.a,{href:`/en/errors#youve-hit-your-monthly-spend-limit`,children:`the error reference`}),` for each variant.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`A spend limit message from a `,_jsx(_components.a,{href:`/en/claude-apps-gateway`,children:`Claude apps gateway`})]}),`: the developer passed a spend cap you set on your self-hosted gateway, and the gateway blocks their requests until the period resets or you raise the cap. See `,_jsx(_components.a,{href:`/en/claude-apps-gateway-spend-limits`,children:`gateway spend limits`}),` for caps, reset schedules, and the message the developer sees.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`A context or auto-compact warning`}),`: not a usage limit. The conversation has grown close to the session’s `,_jsx(_components.a,{href:`/en/model-config#set-the-auto-compact-window`,children:`auto-compact window`}),`, the threshold where Claude Code summarizes older history to free space. Point the developer at `,_jsx(_components.a,{href:`#reduce-token-usage`,children:`reduce token usage`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Unexpectedly high spend on an API or cloud-provider plan`}),`: usually traces back to long sessions that were never cleared or to Opus left as the default model. The highest-impact habits to share are clearing between unrelated tasks and matching the model to the job, both covered in `,_jsx(_components.a,{href:`#reduce-token-usage`,children:`reduce token usage`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`agent-team-token-costs`,children:`Agent team token costs`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/en/agent-teams`,children:`Agent teams`}),` spawn multiple Claude Code instances, each with its own context window. Token usage scales with the number of active teammates and how long each one runs.`]}),`\n`,_jsx(_components.p,{children:`To keep agent team costs manageable:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Use Sonnet for teammates. It balances capability and cost for coordination tasks.`}),`\n`,_jsx(_components.li,{children:`Keep teams small. Each teammate runs its own context window, so token usage is roughly proportional to team size.`}),`\n`,_jsx(_components.li,{children:`Keep spawn prompts focused. Teammates load CLAUDE.md, MCP servers, and skills automatically, but everything in the spawn prompt adds to their context from the start.`}),`\n`,_jsx(_components.li,{children:`Shut down teammates when their work is done. Each active teammate continues consuming tokens until it exits or the session ends.`}),`\n`,_jsxs(_components.li,{children:[`Agent teams are disabled by default. Set `,_jsx(_components.code,{children:`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`}),` in your `,_jsx(_components.a,{href:`/en/settings`,children:`settings.json`}),` or environment to enable them. See `,_jsx(_components.a,{href:`/en/agent-teams#enable-agent-teams`,children:`enable agent teams`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`reduce-token-usage`,children:`Reduce token usage`}),`\n`,_jsxs(_components.p,{children:[`Token costs scale with context size: the more context Claude processes, the more tokens you use. Claude Code automatically optimizes costs through `,_jsx(_components.a,{href:`/en/prompt-caching`,children:`prompt caching`}),`, which reduces costs for repeated content like system prompts, and auto-compaction, which summarizes conversation history when approaching context limits.`]}),`\n`,_jsx(_components.p,{children:`The following strategies help you keep context small and reduce per-message costs.`}),`\n`,_jsx(Heading,{level:`3`,id:`manage-context-proactively`,children:`Manage context proactively`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`/usage`}),` to check your current token usage, or `,_jsx(_components.a,{href:`/en/statusline#context-window-usage`,children:`configure your status line`}),` to display it continuously.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Clear between tasks`}),`: Use `,_jsx(_components.code,{children:`/clear`}),` to start fresh when switching to unrelated work. Stale context wastes tokens on every subsequent message. Use `,_jsx(_components.code,{children:`/rename`}),` before clearing so you can find the session later, then `,_jsx(_components.code,{children:`/resume`}),` to return to it.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Add custom compaction instructions`}),`: `,_jsx(_components.code,{children:`/compact Focus on code samples and API usage`}),` tells Claude what to preserve during summarization.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`You can also customize compaction behavior in your CLAUDE.md file at the root of your project:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`markdown`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`markdown`,children:_jsxs(_components.code,{language:`markdown`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#569CD6`,\"--shiki-dark-font-weight\":`bold`},children:`# Compact instructions`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`When you are using compact, please focus on test output and code changes`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`choose-the-right-model`,children:`Choose the right model`}),`\n`,_jsxs(_components.p,{children:[`Sonnet handles most coding tasks well and costs less than Opus. Reserve Opus for complex architectural decisions or multi-step reasoning. Use `,_jsx(_components.code,{children:`/model`}),` to switch models mid-session, or set a default in `,_jsx(_components.code,{children:`/config`}),`. A switch to Opus also applies to the `,_jsx(_components.a,{href:`/en/model-config#setting-your-model`,children:`subagents that inherit your session’s model`}),`. For simple subagent tasks, specify `,_jsx(_components.code,{children:`model: haiku`}),` in your `,_jsx(_components.a,{href:`/en/sub-agents#choose-a-model`,children:`subagent configuration`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`reduce-mcp-server-overhead`,children:`Reduce MCP server overhead`}),`\n`,_jsxs(_components.p,{children:[`MCP tool definitions are `,_jsx(_components.a,{href:`/en/mcp#scale-with-mcp-tool-search`,children:`deferred by default`}),`, so only tool names and server instructions enter context until Claude uses a specific tool. Run `,_jsx(_components.code,{children:`/context`}),` to see what’s consuming space.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Prefer CLI tools when available`}),`: Tools like `,_jsx(_components.code,{children:`gh`}),`, `,_jsx(_components.code,{children:`aws`}),`, `,_jsx(_components.code,{children:`gcloud`}),`, and `,_jsx(_components.code,{children:`sentry-cli`}),` are still more context-efficient than MCP servers because they don’t add any per-tool listing. Claude can run CLI commands directly.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Disable unused servers`}),`: Run `,_jsx(_components.code,{children:`/mcp`}),` to see configured servers and disable any you’re not actively using.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`install-code-intelligence-plugins-for-typed-languages`,children:`Install code intelligence plugins for typed languages`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`/en/plugins/code-intelligence`,children:`Code intelligence plugins`}),` give Claude precise symbol navigation instead of text-based search, reducing unnecessary file reads when exploring unfamiliar code. A single “go to definition” call replaces what might otherwise be a grep followed by reading multiple candidate files. Installed language servers also report type errors automatically after edits, so Claude catches mistakes without running a compiler.`]}),`\n`,_jsx(Heading,{level:`3`,id:`offload-processing-to-hooks-and-skills`,children:`Offload processing to hooks and skills`}),`\n`,_jsxs(_components.p,{children:[`Custom `,_jsx(_components.a,{href:`/en/hooks`,children:`hooks`}),` can preprocess data before Claude sees it. Instead of Claude reading a 10,000-line log file to find errors, a hook can grep for `,_jsx(_components.code,{children:`ERROR`}),` and return only matching lines, reducing context from tens of thousands of tokens to hundreds.`]}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.a,{href:`/en/skills`,children:`skill`}),` can give Claude domain knowledge so it doesn’t have to explore. For example, a “codebase-overview” skill could describe your project’s architecture, key directories, and naming conventions. When Claude invokes the skill, it gets this context immediately instead of spending tokens reading multiple files to understand the structure.`]}),`\n`,_jsx(_components.p,{children:`For example, this PreToolUse hook filters test output to show only failures:`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`settings.json`,id:`settings-json`,children:[_jsxs(_components.p,{children:[`Add this to your `,_jsx(_components.a,{href:`/en/settings#where-settings-live`,children:`settings.json`}),` to run the hook before every Bash command:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hooks\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"PreToolUse\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"matcher\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bash\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hooks\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"command\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"command\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"~/.claude/hooks/filter-test-output.sh\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),_jsxs(Tab,{title:`filter-test-output.sh`,id:`filter-test-output-sh`,children:[_jsxs(_components.p,{children:[`The hook calls this script. Create the folder with `,_jsx(_components.code,{children:`mkdir -p ~/.claude/hooks`}),`, save the script below as `,_jsx(_components.code,{children:`~/.claude/hooks/filter-test-output.sh`}),`, and make it executable with `,_jsx(_components.code,{children:`chmod +x ~/.claude/hooks/filter-test-output.sh`}),`. It checks if the command is a test runner and modifies it to show only failures:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`#!/bin/bash`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`input`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cat`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`cmd`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$input`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '.tool_input.command'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# If running tests, filter to show only failures`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pattern`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"'^(npm test|pytest|go test)( [^;\u0026|\u003c>`$#\\\\\\\\[:cntrl:]]*)?$'\"})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [[ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$cmd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =~`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $pattern`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]]; `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`then`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` filtered_cmd`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$cmd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 2>\u00261 | grep -A 5 -E '(FAIL|ERROR|error:)' | head -100\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$input`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --arg`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` filtered`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$filtered_cmd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{hookSpecificOutput: {hookEventName: \"PreToolUse\", updatedInput: (.tool_input + {command: $filtered})}}'`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"{}\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`fi`})}),`\n`]})})})]})]}),`\n`,_jsxs(_components.p,{children:[`To verify the setup, run `,_jsx(_components.code,{children:`/hooks`}),` and check that the hook appears under PreToolUse. You can also start Claude Code with `,_jsx(_components.code,{children:`claude --debug-file ./claude-debug.txt`}),` and ask Claude to run `,_jsx(_components.code,{children:`npm test`}),`. When the hook rewrites the command, that log file contains a `,_jsx(_components.code,{children:`modified tool input keys`}),` line listing `,_jsx(_components.code,{children:`command`}),` and the other Bash input fields.`]}),`\n`,_jsx(Heading,{level:`3`,id:`move-instructions-from-claude-md-to-skills`,children:`Move instructions from CLAUDE.md to skills`}),`\n`,_jsxs(_components.p,{children:[`Your `,_jsx(_components.a,{href:`/en/memory`,children:`CLAUDE.md`}),` file is loaded into context at session start. If it contains detailed instructions for specific workflows (like PR reviews or database migrations), those tokens are present even when you’re doing unrelated work. `,_jsx(_components.a,{href:`/en/skills`,children:`Skills`}),` load on-demand only when invoked, so moving specialized instructions into skills keeps your base context smaller. Aim to keep CLAUDE.md under 200 lines by including only essentials.`]}),`\n`,_jsx(Heading,{level:`3`,id:`adjust-extended-thinking`,children:`Adjust extended thinking`}),`\n`,_jsx(_components.p,{children:`Extended thinking is enabled by default because it significantly improves performance on complex planning and reasoning tasks. Thinking tokens are billed as output tokens, and the default budget can be tens of thousands of tokens per request depending on the model.`}),`\n`,_jsxs(_components.p,{children:[`For simpler tasks where deep reasoning isn’t needed, you can reduce costs by lowering the `,_jsx(_components.a,{href:`/en/model-config#adjust-effort-level`,children:`effort level`}),` with `,_jsx(_components.code,{children:`/effort`}),` or in `,_jsx(_components.code,{children:`/model`}),`, or by disabling thinking in `,_jsx(_components.code,{children:`/config`}),`. You can’t turn off thinking on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, which always use extended thinking.`]}),`\n`,_jsxs(_components.p,{children:[`On models with a `,_jsx(_components.a,{href:`/en/model-config#adaptive-reasoning-and-fixed-thinking-budgets`,children:`fixed thinking budget`}),`, you can also lower the budget by setting the `,_jsx(_components.code,{children:`MAX_THINKING_TOKENS`}),` `,_jsx(_components.a,{href:`/en/env-vars`,children:`environment variable`}),`, for example `,_jsx(_components.code,{children:`MAX_THINKING_TOKENS=8000`}),`. Adaptive-reasoning models ignore nonzero budgets, so use effort levels there instead.`]}),`\n`,_jsx(Heading,{level:`3`,id:`delegate-verbose-operations-to-subagents`,children:`Delegate verbose operations to subagents`}),`\n`,_jsxs(_components.p,{children:[`Running tests, fetching documentation, or processing log files can consume significant context. Delegate these to `,_jsx(_components.a,{href:`/en/sub-agents#isolate-high-volume-operations`,children:`subagents`}),` so the verbose output stays in the subagent’s context while only a summary returns to your main conversation.`]}),`\n`,_jsxs(_components.p,{children:[`The subagent’s own requests still draw on your usage. To spend less on them, `,_jsx(_components.a,{href:`/en/sub-agents#choose-a-model`,children:`choose a smaller model for a subagent`}),` or `,_jsx(_components.a,{href:`/en/sub-agents#run-every-subagent-on-one-model`,children:`run every subagent on one model`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`manage-agent-team-costs`,children:`Manage agent team costs`}),`\n`,_jsxs(_components.p,{children:[`Agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode, because each teammate maintains its own context window and runs as a separate Claude instance. Keep team tasks small and self-contained to limit per-teammate token usage. See `,_jsx(_components.a,{href:`/en/agent-teams`,children:`agent teams`}),` for details.`]}),`\n`,_jsx(Heading,{level:`3`,id:`write-specific-prompts`,children:`Write specific prompts`}),`\n`,_jsx(_components.p,{children:`Vague requests like “improve this codebase” trigger broad scanning. Specific requests like “add input validation to the login function in auth.ts” let Claude work efficiently with minimal file reads.`}),`\n`,_jsx(Heading,{level:`3`,id:`work-efficiently-on-complex-tasks`,children:`Work efficiently on complex tasks`}),`\n`,_jsx(_components.p,{children:`For longer or more complex work, these habits help avoid wasted tokens from going down the wrong path:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Use plan mode for complex tasks`}),`: Press Shift+Tab to cycle to `,_jsx(_components.a,{href:`/en/permission-modes#analyze-before-you-edit-with-plan-mode`,children:`plan mode`}),` before implementation. Claude explores the codebase and proposes an approach for your approval, preventing expensive re-work when the initial direction is wrong.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Course-correct early`}),`: If Claude starts heading the wrong direction, press Escape to stop immediately. Use `,_jsx(_components.code,{children:`/rewind`}),` or double-tap Escape to restore conversation and code to a previous checkpoint.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Give verification targets`}),`: Include test cases, paste screenshots, or define expected output in your prompt. When Claude can verify its own work, it catches issues before you need to request fixes.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Test incrementally`}),`: Write one file, test it, then continue. This catches issues early.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`background-token-usage`,children:`Background token usage`}),`\n`,_jsx(_components.p,{children:`Claude Code uses tokens for some background functionality even when idle:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Conversation summarization`}),`: Background jobs that summarize previous conversations for the `,_jsx(_components.code,{children:`claude --resume`}),` feature`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Command processing`}),`: Some commands like `,_jsx(_components.code,{children:`/usage`}),` may generate requests to check status`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`These background processes consume a small amount of tokens (typically under $0.04 per session) even without active interaction.`}),`\n`,_jsxs(_components.p,{children:[`When prompt suggestions are on, Claude Code also sends a short request to the model your session is using after Claude responds, to `,_jsx(_components.a,{href:`/en/interactive-mode#prompt-suggestions`,children:`suggest your next prompt`}),`. That request reuses the conversation’s prompt cache, so it is mostly cache reads plus a few output tokens. Claude Code `,_jsx(_components.a,{href:`/en/interactive-mode#when-claude-code-skips-suggestions`,children:`skips it while your account is close to or at its usage limit`}),`. To stop these requests, `,_jsx(_components.a,{href:`/en/interactive-mode#turn-prompt-suggestions-off`,children:`turn prompt suggestions off`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`why-usage-climbs-in-a-long-session`,children:`Why usage climbs in a long session`}),`\n`,_jsx(_components.p,{children:`A session that has been open for hours can use far more of your plan limits than your activity suggests, usually for one of these reasons:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Long context`}),`: Claude Code sends your full conversation with every request, and each time Claude uses tools it sends another request carrying that batch of tool results. With `,_jsx(_components.a,{href:`/en/prompt-caching`,children:`prompt caching`}),`, Claude Code re-reads that history at the `,_jsx(_components.a,{href:`https://platform.claude.com/docs/en/about-claude/pricing`,children:`cached token rate`}),`, so a one-line question in a session that has been open all day still draws usage for the whole conversation. See `,_jsx(_components.a,{href:`#manage-context-proactively`,children:`Manage context proactively`}),` for ways to keep your context small`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cache misses`}),`: your first message after a break longer than the `,_jsx(_components.a,{href:`/en/prompt-caching#cache-lifetime`,children:`cache lifetime`}),` misses the cache and reprocesses your full context. See `,_jsx(_components.a,{href:`/en/prompt-caching#which-ttl-each-request-gets`,children:`which lifetime your requests get`}),` and `,_jsx(_components.a,{href:`/en/prompt-caching#choose-the-ttl-yourself`,children:`the controls for setting it`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Scheduled tasks`}),`: a `,_jsx(_components.a,{href:`/en/scheduled-tasks`,children:`session-scoped scheduled task`}),` fires on its interval even while the session is idle, sending your full context each time`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Cross-session messages`}),`: Claude Code delivers a `,_jsx(_components.a,{href:`/en/cross-session-messaging`,children:`message from another of your sessions`}),` as a new turn when this session sits idle, sending your full context each time. To hold inbound messages instead of delivering them, set `,_jsx(_components.a,{href:`/en/settings-reference#crosssessioninbound`,children:_jsx(_components.code,{children:`crossSessionInbound`})}),` to `,_jsx(_components.code,{children:`hold`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Goal check-ins`}),`: while background work keeps an active `,_jsx(_components.a,{href:`/en/goal`,children:`goal`}),` waiting, Claude Code `,_jsx(_components.a,{href:`/en/goal#background-work-defers-evaluation`,children:`asks Claude to check on that work`}),` even when the session sits idle, starting a new turn that sends your full context. Claude Code starts at most three idle check-ins per goal between your prompts. Before v2.1.246, idle check-ins were uncapped. To turn check-ins off, set `,_jsx(_components.a,{href:`/en/env-vars`,children:_jsx(_components.code,{children:`CLAUDE_CODE_GOAL_CHECKIN_MINUTES`})}),` to `,_jsx(_components.code,{children:`0`}),`. Idle check-ins require Claude Code v2.1.236 or later`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Subagents and workflows`}),`: every subagent, and every agent a `,_jsx(_components.a,{href:`/en/workflows#cost`,children:`dynamic workflow`}),` spawns, sends its own requests on top of the main conversation’s. The `,_jsx(_components.a,{href:`#plan-usage-breakdown`,children:`attribution breakdown`}),` shows the subagent share`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Agent teammates`}),`: each active `,_jsx(_components.a,{href:`#agent-team-token-costs`,children:`teammate`}),` keeps consuming tokens until it exits`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Compaction`}),`: `,_jsx(_components.code,{children:`/compact`}),` reads the conversation it summarizes, so `,_jsx(_components.a,{href:`/en/prompt-caching#compacting-the-conversation`,children:`compacting a large context`}),` is itself a large request. When you want a fresh start instead of continuity, `,_jsx(_components.code,{children:`/clear`}),` costs nothing`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`On a Pro, Max, Team, or Enterprise plan, the `,_jsxs(_components.a,{href:`#plan-usage-breakdown`,children:[_jsx(_components.code,{children:`/usage`}),` breakdown`]}),` recommends a change for behaviors behind 10% or more of your recent usage, such as long context or cache misses.`]}),`\n`,_jsx(Heading,{level:`2`,id:`understanding-changes-in-claude-code-behavior`,children:`Understanding changes in Claude Code behavior`}),`\n`,_jsxs(_components.p,{children:[`Claude Code regularly receives updates that may change how features work, including cost reporting. Run `,_jsx(_components.code,{children:`claude --version`}),` to check your current version.`]}),`\n`,_jsx(_components.p,{children:`For billing questions about your specific account, contact Anthropic support through the in-product messenger:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Subscription plans`}),` (Pro, Max, Team, Enterprise): sign in at `,_jsx(_components.a,{href:`https://claude.ai`,children:`claude.ai`}),`, click your initials in the lower left, and select `,_jsx(_components.strong,{children:`Get help`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Console (API) billing`}),`: sign in at `,_jsx(_components.a,{href:`https://platform.claude.com`,children:`platform.claude.com`}),`, click your initials, and select `,_jsx(_components.strong,{children:`Get help`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`https://support.claude.com/en/articles/9015913-how-to-get-support`,children:`How to get support`}),` for the full flow, including who can reach a human agent on each plan.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"sidebarTitle":"Costs","title":"Manage costs effectively","description":"Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.","keywords":["cost","pricing","price","tokens","usage","spend","billing"],"href":"/en/costs"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Track your costs","slug":"track-your-costs","depth":2,"children":[{"title":"Using the /usage command","slug":"using-the-/usage-command","depth":3,"children":[]},{"title":"Prompt cache statistics","slug":"prompt-cache-statistics","depth":4,"children":[]},{"title":"Plan usage breakdown","slug":"plan-usage-breakdown","depth":4,"children":[]},{"title":"Apply recommendations with the fix shortcut","slug":"apply-recommendations-with-the-fix-shortcut","depth":4,"children":[]},{"title":"Check your usage-credits spend","slug":"check-your-usage-credits-spend","depth":4,"children":[]},{"title":"When the usage request fails","slug":"when-the-usage-request-fails","depth":4,"children":[]},{"title":"Read the token count beside the spinner","slug":"read-the-token-count-beside-the-spinner","depth":3,"children":[]},{"title":"Analyze your usage patterns","slug":"analyze-your-usage-patterns","depth":3,"children":[]},{"title":"Add usage credits to your subscription","slug":"add-usage-credits-to-your-subscription","depth":3,"children":[]}]},{"title":"Manage costs for your organization","slug":"manage-costs-for-your-organization","depth":2,"children":[{"title":"Report spend at your contracted rates","slug":"report-spend-at-your-contracted-rates","depth":3,"children":[]},{"title":"Claude for Teams and Enterprise","slug":"claude-for-teams-and-enterprise","depth":3,"children":[]},{"title":"Claude Console","slug":"claude-console","depth":3,"children":[]},{"title":"Rate limit recommendations","slug":"rate-limit-recommendations","depth":4,"children":[]},{"title":"Cloud providers","slug":"cloud-providers","depth":3,"children":[]},{"title":"When a developer asks about a limit","slug":"when-a-developer-asks-about-a-limit","depth":3,"children":[]},{"title":"Agent team token costs","slug":"agent-team-token-costs","depth":3,"children":[]}]},{"title":"Reduce token usage","slug":"reduce-token-usage","depth":2,"children":[{"title":"Manage context proactively","slug":"manage-context-proactively","depth":3,"children":[]},{"title":"Choose the right model","slug":"choose-the-right-model","depth":3,"children":[]},{"title":"Reduce MCP server overhead","slug":"reduce-mcp-server-overhead","depth":3,"children":[]},{"title":"Install code intelligence plugins for typed languages","slug":"install-code-intelligence-plugins-for-typed-languages","depth":3,"children":[]},{"title":"Offload processing to hooks and skills","slug":"offload-processing-to-hooks-and-skills","depth":3,"children":[]},{"title":"Move instructions from CLAUDE.md to skills","slug":"move-instructions-from-claude-md-to-skills","depth":3,"children":[]},{"title":"Adjust extended thinking","slug":"adjust-extended-thinking","depth":3,"children":[]},{"title":"Delegate verbose operations to subagents","slug":"delegate-verbose-operations-to-subagents","depth":3,"children":[]},{"title":"Manage agent team costs","slug":"manage-agent-team-costs","depth":3,"children":[]},{"title":"Write specific prompts","slug":"write-specific-prompts","depth":3,"children":[]},{"title":"Work efficiently on complex tasks","slug":"work-efficiently-on-complex-tasks","depth":3,"children":[]}]},{"title":"Background token usage","slug":"background-token-usage","depth":2,"children":[]},{"title":"Why usage climbs in a long session","slug":"why-usage-climbs-in-a-long-session","depth":2,"children":[]},{"title":"Understanding changes in Claude Code behavior","slug":"understanding-changes-in-claude-code-behavior","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/claude-code/f164a83c5609d421/consent-loader.js","/docs/_mintlify/custom/claude-code/a14b5f5366e4b482/antalytics-loader.js","/docs/_mintlify/custom/claude-code/4cd6fefc4e377e79/toc-collapse.js","/docs/_mintlify/custom/claude-code/f6b3e97e7cbfc8d3/settings-anchor-redirect.js","/docs/_mintlify/custom/claude-code/45be325883f4820b/plugins-anchor-redirect.js","/docs/_mintlify/custom/claude-code/7c53cb088b8331b3/nav-tab-click.js"],"subdomain":"claude-code","siteName":"Claude Code Docs","title":"Manage costs effectively - Claude Code Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/costs","matchLevel":0},"fr":{"href":"/fr/costs","matchLevel":1},"de":{"href":"/de/costs","matchLevel":1},"it":{"href":"/it/costs","matchLevel":1},"jp":{"href":"/ja/costs","matchLevel":1},"es":{"href":"/es/costs","matchLevel":1},"ko":{"href":"/ko/costs","matchLevel":1},"zh-CN":{"href":"/zh-CN/costs","matchLevel":1},"zh-TW":{"href":"/zh-TW/costs","matchLevel":1},"ru":{"href":"/ru/costs","matchLevel":1},"id":{"href":"/id/costs","matchLevel":1},"pt-BR":{"href":"/pt/costs","matchLevel":1}}},"lastModified":"2026-10-23T02:30:48.313Z","originalFileLocation":"en/costs.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Claude Code Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Manage costs effectively - Claude Code Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Claude Code Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://code.claude.com/docs/en/costs\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://claude-code.mintlify.app/_mintlify/api/og/v2?division=Usage+and+costs\u0026amp;title=Manage+costs+effectively\u0026amp;description=Track+token+usage%2C+set+team+spend+limits%2C+and+reduce+Claude+Code+costs+with+context+management%2C+model+selection%2C+extended+thinking+settings%2C+and+preprocessing+h\u0026amp;theme=8d9812df31da293aba4e8103\u0026amp;signature=e03666c585128bd14ffc5a3e1df2744e04fea28d637cf5b9ad54cdc5253f08b3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Manage costs effectively - Claude Code Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://claude-code.mintlify.app/_mintlify/api/og/v2?division=Usage+and+costs\u0026amp;title=Manage+costs+effectively\u0026amp;description=Track+token+usage%2C+set+team+spend+limits%2C+and+reduce+Claude+Code+costs+with+context+management%2C+model+selection%2C+extended+thinking+settings%2C+and+preprocessing+h\u0026amp;theme=8d9812df31da293aba4e8103\u0026amp;signature=e03666c585128bd14ffc5a3e1df2744e04fea28d637cf5b9ad54cdc5253f08b3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/claude-code/pLsy-mRpNksna2sx/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Claude Code Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0E0E0E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://code.claude.com/docs/en/costs\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/en/costs.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://code.claude.com/docs/en/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://code.claude.com/docs/fr/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://code.claude.com/docs/de/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"it\" href=\"https://code.claude.com/docs/it/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://code.claude.com/docs/ja/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://code.claude.com/docs/es/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://code.claude.com/docs/ko/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-CN\" href=\"https://code.claude.com/docs/zh-CN/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-TW\" href=\"https://code.claude.com/docs/zh-TW/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://code.claude.com/docs/ru/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"id\" href=\"https://code.claude.com/docs/id/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt-BR\" href=\"https://code.claude.com/docs/pt/costs\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://code.claude.com/docs/en/costs\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://code.claude.com/#organization\",\"name\":\"Claude Code Docs\",\"url\":\"https://code.claude.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/claude-code/c5r9_6tjPMzFdDDT/logo/light.svg?fit=max\u0026auto=format\u0026n=c5r9_6tjPMzFdDDT\u0026q=85\u0026s=78fd01ff4f4340295a4f66e2ea54903c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://code.claude.com/docs#website\",\"name\":\"Claude Code Docs\",\"url\":\"https://code.claude.com/docs\",\"publisher\":{\"@id\":\"https://code.claude.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://code.claude.com/docs/en/costs#webpage\",\"url\":\"https://code.claude.com/docs/en/costs\",\"name\":\"Manage costs effectively\",\"description\":\"Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.\",\"dateModified\":\"2026-10-23T02:30:48.313Z\",\"isPartOf\":{\"@id\":\"https://code.claude.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://code.claude.com/docs/en/costs#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://code.claude.com/docs/en/costs#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Usage and costs\",\"item\":\"https://code.claude.com/docs/en/monitoring-usage\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Manage costs effectively\",\"item\":\"https://code.claude.com/docs/en/costs\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://code.claude.com/docs/en/costs#article\",\"headline\":\"Manage costs effectively\",\"name\":\"Manage costs effectively\",\"description\":\"Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.\",\"url\":\"https://code.claude.com/docs/en/costs\",\"mainEntityOfPage\":{\"@id\":\"https://code.claude.com/docs/en/costs#webpage\"},\"dateModified\":\"2026-10-23T02:30:48.313Z\",\"keywords\":\"cost, pricing, price, tokens, usage, spend, billing\",\"publisher\":{\"@id\":\"https://code.claude.com/#organization\"},\"isPartOf\":{\"@id\":\"https://code.claude.com/docs#website\"}}]}\u003c/script>","siteName":"Claude Code Docs","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"Getting started","menu":[{"item":"Overview","description":"What Claude Code is and how to install it","pages":[{"title":"Overview","href":"/en/overview"}]},{"item":"Quickstart","description":"Install, start a session, make your first change","pages":[{"title":"Quickstart","href":"/en/quickstart"}]},{"item":"Core concepts","description":"How it works, what loads, what it costs","pages":[{"title":"Core concepts","href":"/en/how-claude-code-works"}]},{"item":"Use Claude Code","description":"Memory, sessions, workflows, and prompts","pages":[{"title":"Use Claude Code","href":"/en/memory"}]},{"item":"Platforms and integrations","description":"Terminal, IDEs, desktop, web, and Slack","pages":[{"title":"Platforms and integrations","href":"/en/platforms"}]},{"item":"Code review and pull requests","description":"PR reviews, local review, security, and CI","pages":[{"title":"Code review and pull requests","href":"/en/code-review"}]}],"pages":[{"title":"Getting started","href":"/en/overview"}]},{"tab":"Build with Claude Code","menu":[{"item":"Agents and parallel work","description":"Subagents, agent view, teams, worktrees","pages":[{"title":"Agents and parallel work","href":"/en/agents"}]},{"item":"MCP","description":"Connect your tools and data","pages":[{"title":"MCP","href":"/en/mcp-quickstart"}]},{"item":"Skills","description":"Package workflows Claude can run","pages":[{"title":"Skills","href":"/en/skills"}]},{"item":"Artifacts","description":"Publish a page from a session","pages":[{"title":"Artifacts","href":"/en/artifacts"}]},{"item":"Automation","description":"Hooks, channels, schedules, non-interactive runs","pages":[{"title":"Automation","href":"/en/hooks-guide"}]},{"item":"Guides","description":"Work in large codebases","pages":[{"title":"Guides","href":"/en/large-codebases"}]},{"item":"Troubleshooting","description":"Install, configuration, and error fixes","pages":[{"title":"Troubleshooting","href":"/en/troubleshoot-install"}]}],"pages":[{"title":"Build with Claude Code","href":"/en/agents"}]},{"tab":"Plugins","menu":[{"item":"Plugins","description":"What plugins are and what they add","pages":[{"title":"Plugins","href":"/en/plugins/overview"}]},{"item":"Use plugins","description":"Find plugins and add them","pages":[{"title":"Use plugins","href":"/en/plugins/install"}]},{"item":"Create plugins","description":"Create, test, and publish a plugin","pages":[{"title":"Create plugins","href":"/en/plugins/create"}]},{"item":"Mods","description":"Change the Claude Code interface","pages":[{"title":"Mods","href":"/en/plugins/mods/overview"}]},{"item":"Run a marketplace","description":"Host and share plugins","pages":[{"title":"Run a marketplace","href":"/en/plugins/create-marketplace"}]},{"item":"Manage plugins for your organization","description":"Control plugins across a team","pages":[{"title":"Manage plugins for your organization","href":"/en/plugins/org"}]},{"item":"Troubleshooting","description":"Install and loading problems","pages":[{"title":"Troubleshooting","href":"/en/plugins/troubleshooting"}]},{"item":"Reference","description":"Manifests, CLI, and marketplace schema","pages":[{"title":"Reference","href":"/en/plugins/manifest-reference"}]}],"pages":[{"title":"Plugins","href":"/en/plugins/overview"}]},{"tab":"Administration","menu":[{"item":"Setup and access","description":"Install, sign-in, and managed settings","groups":[{"group":"Setup and access","pages":[{"title":"Set up Claude Code for your organization","sidebarTitle":"Administration overview","href":"/en/admin-setup"},{"sidebarTitle":"Advanced setup","title":"Advanced setup","href":"/en/setup"},{"sidebarTitle":"Authentication","title":"Authentication","href":"/en/authentication"},{"sidebarTitle":"Managed settings","title":"Deploy managed settings","href":"/en/managed-settings"},{"sidebarTitle":"Server-managed settings","title":"Configure server-managed settings","href":"/en/server-managed-settings"},{"sidebarTitle":"Managed MCP configuration","title":"Control MCP server access for your organization","href":"/en/managed-mcp"},{"title":"Configure auto mode","sidebarTitle":"Configure auto mode","href":"/en/auto-mode-config"}]},{"group":"Deployment","pages":[{"title":"Enterprise deployment overview","sidebarTitle":"Overview","href":"/en/third-party-integrations"},{"title":"Feature availability","sidebarTitle":"Feature availability","href":"/en/feature-availability"},{"sidebarTitle":"Amazon Bedrock","title":"Claude Code on Amazon Bedrock","href":"/en/amazon-bedrock"},{"sidebarTitle":"Claude Platform on AWS","title":"Claude Code on Claude Platform on AWS","href":"/en/claude-platform-on-aws"},{"sidebarTitle":"Google Cloud's Agent Platform","title":"Claude Code on Google Cloud's Agent Platform","href":"/en/google-vertex-ai"},{"sidebarTitle":"Microsoft Foundry","title":"Claude Code on Microsoft Foundry","href":"/en/microsoft-foundry"},{"sidebarTitle":"Network configuration","title":"Enterprise network configuration","href":"/en/network-config"},{"title":"Run Claude Code behind a corporate launcher","sidebarTitle":"Corporate launcher","href":"/en/corporate-launcher"},{"title":"Development containers","href":"/en/devcontainer"}]},{"group":"Gateways","pages":[{"sidebarTitle":"Overview","title":"Run Claude Code through a gateway","href":"/en/gateways"},{"group":"Claude apps gateway","root":{"title":"Claude apps gateway for Amazon Bedrock, Claude Platform on AWS, Google Cloud, and Microsoft Foundry","sidebarTitle":"Claude apps gateway","href":"/en/claude-apps-gateway"},"pages":[{"title":"Claude apps gateway configuration","sidebarTitle":"Configuration","href":"/en/claude-apps-gateway-config"},{"title":"Claude apps gateway spend limits","sidebarTitle":"Spend limits","href":"/en/claude-apps-gateway-spend-limits"},{"title":"Claude apps gateway deployment and operations","sidebarTitle":"Deployment","href":"/en/claude-apps-gateway-deploy"},{"title":"Deploy Claude apps gateway on AWS","sidebarTitle":"Deployment example: AWS","href":"/en/claude-apps-gateway-on-aws"},{"title":"Deploy Claude apps gateway on Google Cloud","sidebarTitle":"Deployment example: Google Cloud","href":"/en/claude-apps-gateway-on-gcp"}]},{"group":"Other gateways","root":{"sidebarTitle":"Overview","title":"Other LLM gateways","href":"/en/llm-gateway"},"pages":[{"sidebarTitle":"Connect to a gateway","title":"Connect Claude Code to an LLM gateway","href":"/en/llm-gateway-connect"},{"sidebarTitle":"Organization rollout","title":"Roll out an LLM gateway for your organization","href":"/en/llm-gateway-rollout"},{"sidebarTitle":"Compatibility guide","title":"Claude Code gateway compatibility guide","href":"/en/llm-gateway-protocol"}]}]},{"group":"Usage and costs","pages":[{"title":"Monitoring","description":"Learn how to enable and configure OpenTelemetry for Claude Code.","href":"/en/monitoring-usage"},{"sidebarTitle":"Costs","title":"Manage costs effectively","href":"/en/costs"},{"title":"Track team usage with analytics","description":"View Claude Code usage metrics, track adoption, and measure engineering velocity in the analytics dashboard.","href":"/en/analytics"}]},{"group":"Security and data","pages":[{"title":"Security","href":"/en/security"},{"title":"Data usage","href":"/en/data-usage"},{"title":"Zero data retention","href":"/en/zero-data-retention"},{"title":"Set up Claude Code (local mode) for a HIPAA-ready organization","sidebarTitle":"HIPAA setup","href":"/en/hipaa-setup"}]},{"group":"Adoption","pages":[{"title":"Communications kit","href":"/en/communications-kit"},{"title":"Champion kit","href":"/en/champion-kit"}]}]},{"item":"Deployment","description":"Cloud providers, network, containers","pages":[{"title":"Deployment","href":"/en/third-party-integrations"}]},{"item":"Gateways","description":"Route requests through a gateway","pages":[{"title":"Gateways","href":"/en/gateways"}]},{"item":"Usage and costs","description":"Monitoring, spend, and analytics","pages":[{"title":"Usage and costs","href":"/en/monitoring-usage"}]},{"item":"Security and data","description":"Security, data use, and retention","pages":[{"title":"Security and data","href":"/en/security"}]},{"item":"Adoption","description":"Kits for rolling out to a team","pages":[{"title":"Adoption","href":"/en/communications-kit"}]}]},{"tab":"Configuration","menu":[{"item":"Settings","description":"Files, precedence, and keys","pages":[{"title":"Settings","href":"/en/settings"}]},{"item":"Permissions and sandboxing","description":"What Claude Code can do without asking","pages":[{"title":"Permissions and sandboxing","href":"/en/permissions"}]},{"item":"Environments","description":"Cloud and self-hosted environments","pages":[{"title":"Environments","href":"/en/cloud-environments"}]},{"item":"Model and responses","description":"Models, effort, and output styles","pages":[{"title":"Model and responses","href":"/en/model-config"}]},{"item":"Interface","description":"Terminal, keys, voice, and status line","pages":[{"title":"Interface","href":"/en/terminal-config"}]}],"pages":[{"title":"Configuration","href":"/en/settings"}]},{"tab":"Reference","menu":[{"item":"Reference","description":"Commands, flags, tools, hooks, and variables","pages":[{"title":"Reference","href":"/en/cli-reference"}]},{"item":"Glossary","description":"Terms used across the docs","pages":[{"title":"Glossary","href":"/en/glossary"}]}],"pages":[{"title":"Reference","href":"/en/cli-reference"}]},{"tab":"Agent SDK","menu":[{"item":"Agent SDK","description":"Overview, quickstart, and migration","pages":[{"title":"Agent SDK","href":"/en/agent-sdk/overview"}]},{"item":"Build agents","description":"Configuration and examples","pages":[{"title":"Build agents","href":"/en/agent-sdk/configuration"}]},{"item":"Core concepts","description":"The agent loop, features, and sessions","pages":[{"title":"Core concepts","href":"/en/agent-sdk/agent-loop"}]},{"item":"Input and output","description":"Streaming, user input, structured output","pages":[{"title":"Input and output","href":"/en/agent-sdk/streaming-vs-single-mode"}]},{"item":"Extend with tools","description":"Custom tools, MCP, and subagents","pages":[{"title":"Extend with tools","href":"/en/agent-sdk/custom-tools"}]},{"item":"Customize behavior","description":"System prompts, skills, and plugins","pages":[{"title":"Customize behavior","href":"/en/agent-sdk/modifying-system-prompts"}]},{"item":"Control and observability","description":"Permissions, hooks, cost, and tracing","pages":[{"title":"Control and observability","href":"/en/agent-sdk/permissions"}]},{"item":"Deployment","description":"Hosting and secure deployment","pages":[{"title":"Deployment","href":"/en/agent-sdk/hosting"}]},{"item":"SDK references","description":"TypeScript and Python","pages":[{"title":"SDK references","href":"/en/agent-sdk/typescript"}]}],"pages":[{"title":"Agent SDK","href":"/en/agent-sdk/overview"}]},{"tab":"What's New","pages":[{"title":"What's New","href":"/en/whats-new"}]},{"tab":"Resources","pages":[{"title":"Resources","href":"/en/legal-and-compliance"}]}]},{"language":"fr","pages":[{"title":"fr","href":"/fr/costs"}]},{"language":"de","pages":[{"title":"de","href":"/de/costs"}]},{"language":"it","pages":[{"title":"it","href":"/it/costs"}]},{"language":"jp","pages":[{"title":"jp","href":"/ja/costs"}]},{"language":"es","pages":[{"title":"es","href":"/es/costs"}]},{"language":"ko","pages":[{"title":"ko","href":"/ko/costs"}]},{"language":"zh-CN","pages":[{"title":"zh-CN","href":"/zh-CN/costs"}]},{"language":"zh-TW","pages":[{"title":"zh-TW","href":"/zh-TW/costs"}]},{"language":"ru","pages":[{"title":"ru","href":"/ru/costs"}]},{"language":"id","pages":[{"title":"id","href":"/id/costs"}]},{"language":"pt-BR","pages":[{"title":"pt-BR","href":"/pt/costs"}]}]},"title":"Manage costs effectively - Claude Code Docs","buildId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","deploymentId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","dynamics":[],"chunks":[]}