Track your costs
Using the /usage command
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./usage shows detailed token usage statistics for your current session. Claude Code computes the dollar figure locally from token counts priced at standard list rates, so it doesn’t reflect promotional pricing or contracted discounts and may differ from your actual bill. For authoritative billing, see the Usage page in the Claude Console.
/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.
Plan usage breakdown
On a Pro, Max, Team, or Enterprise plan,/usage also shows a breakdown of what counts against your plan limits:
- 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.
- Behavior flags: behaviors such as long context or cache misses, flagged when one accounts for 10% or more of recent usage.
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 same breakdown appears in the Account & usage dialog with a Day and Week toggle. Requires Claude Code v2.1.174 or later.
When the usage request fails
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.
Add usage credits to your subscription
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. What it opens depends on your role:
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.