What Claude Code's /cost Command Shows
How to read the Claude Code /cost command: session spend, token breakdown, why Pro and Max differ from API billing, and when to use /usage instead.
By Capital & Compute
Type /cost into a Claude Code session and you expect a dollar figure. Whether you get one depends entirely on how you pay. On an API key, /cost prints your running spend for the session. On a Pro or Max subscription, that same command has nothing to bill you for, because you already paid a flat fee, so the number you actually want lives behind a different command.
That split trips up almost everyone. Most of the guides ranking for this still describe a single /cost that shows everyone their dollars. The tool moved on. Here is what the command reports in 2026, how to read the token breakdown, and why the figure is an estimate rather than your invoice.
What /cost shows
For API-key users, /cost is a live meter. Run it mid-session and Claude Code prints the total estimated spend so far, the wall-clock API time, and a per-model breakdown of the tokens that produced it. A typical readout looks like this:
Total cost: $0.4823
Total duration (API): 3m 12.4s
Total duration (wall): 18m 02.1s
Total code changes: 214 lines added, 37 removed
Usage by model:
claude-sonnet-4-6: 1.2m input, 18.4k output, 0.9m cache read
The headline is the dollar number. The useful part is the line under it. Input, output, and cache-read tokens carry wildly different prices, so two sessions with the same total token count can cost very different amounts depending on the mix. The official Claude Code documentation states it plainly: if you are using an API key, the /cost command shows your running spend for the current session.
/cost vs /usage vs /status
Three commands sound like they do the same thing. They do not.
| Command | Who it serves | What it reports |
|---|---|---|
/cost |
API-key users | Running dollar spend for the current session, plus token breakdown |
/usage |
Pro and Max users | Session percentage, weekly percentage, and any extra-usage balance |
/status |
Everyone | Account, model, and connection state for the current session |
If you pay per token, /cost is your command. If you pay a flat subscription, /usage is the one that matters, because your constraint is not dollars, it is how much of your rolling plan allowance you have burned. The Pro and Max documentation describes /usage as a snapshot of consumption against your limits: session percentage, weekly percentage, and extra balance in one view. These are three separate commands, not aliases of one another.
Why API users see dollars and subscribers do not
A subscription is a fixed payment for a usage ceiling. There is no per-session invoice to total, so a dollar meter would be meaningless. What a subscriber can actually run out of is allowance: the rolling five-hour window and the weekly cap. That is what /usage measures.
API billing is the opposite. Every token is metered and charged, so a running total is exactly the number you need to watch before a long agent run quietly drains a budget. The same task, run on a $20 Pro plan and on a raw API key, produces the same tokens and a completely different question: am I near my limit, or am I near my budget.
This is the single most common point of confusion, and it explains why the /cost figure is blank or absent for so many people. They are on Max, looking for a dollar amount the command was never going to give them.
How to read the token breakdown
The token mix is where the real cost hides. Three categories show up, and they are priced an order of magnitude apart. On Claude Sonnet 4.6, output tokens cost five times what input tokens do, and cached reads are close to free.
| Item | Value |
|---|---|
| Output | $15.00 |
| Input | $3.00 |
| Cache read | $0.30 |
What each line means for your bill:
- Input tokens are everything the model reads: your prompt, the files it opens, the command output it scans. Long context runs up input volume, but input is cheap per token.
- Output tokens are everything the model writes: explanations, code, tool calls. This is the costly line. A session that generates a lot of code or long reasoning is where dollars accumulate.
- Cache reads are repeated context the model has already seen, served from a prompt cache at a fraction of the input rate. Claude Code leans on this heavily, which is why a multi-turn session that keeps re-reading the same files stays far cheaper than the raw token count suggests.
There is a fourth category that does not appear in most rate cards: cache writes, the cost of putting context into the cache the first time. Anthropic prices a five-minute cache write at 1.25 times the input rate, so it is a small premium paid once to make every subsequent read cheap. For the full per-token rates across every current model, the AI model tracker keeps them dated and sourced.
These Sonnet 4.6 rates carry over unchanged to Claude Sonnet 5, the default model since June 30, 2026, which holds the same $3 / $15 standard rate (with a $2 / $10 introductory rate through August 31, 2026).
If output is your biggest line and the bill feels high, that is the lever. Tighter scope and less verbose instructions cut output directly. The token-saving tools breakdown tests whether the popular utilities actually move that number.
Why the number is an estimate, not your bill
The dollar figure /cost prints is computed on your machine. Claude Code multiplies your local token counts by a price table bundled into the build, then shows the result. It never asks Anthropic what you were actually charged.
That has two consequences. First, the figure can drift from your real invoice if the bundled prices lag a rate change. Second, on subscription plans any estimate is hypothetical anyway, an approximation of what the same tokens would have cost on the API. The cost-tracking documentation is explicit that the reported cost is a client-side estimate, not authoritative billing data. For the number that actually settles your account, the Claude Console usage page is the source of truth.
Treat /cost as a gauge, not a receipt. It is accurate enough to catch a runaway session in real time, which is the job that matters. For reconciling a monthly figure, go to the Console.
When /cost is not enough
/cost resets with every session. Close the terminal and the running total is gone. For anything beyond the current session, two options exist.
Claude Code logs every session to your local filesystem as JSONL, one file per session, under ~/.claude/projects/. Each line records the token counts for a single API call: input, output, cache creation, cache read, and the model used. The raw data for a full cost history is already on your disk.
Reading that by hand is miserable, which is why ccusage exists. It parses those JSONL files and reports usage by day, session, or project, so you can answer “what did Claude Code cost me this month” without a subscription dashboard. For modeling cost before you run a task rather than after, the cost-per-task calculator estimates token spend by task shape, and the Claude Code pricing breakdown walks through the per-task math in full.
Frequently asked questions
Frequently asked questions
- Does /cost work on Pro and Max plans?
- Not as a dollar meter. On Pro and Max the relevant command is /usage, which shows your session and weekly allowance rather than a price, because a flat subscription has no per-session bill to total. /cost shows running spend only when you are billed per token on an API key.
- How much does a Claude Code session cost?
- It depends on the token mix, not the session length. Output tokens dominate the bill at roughly five times the input rate on Sonnet, while cache reads are nearly free. A focused bug fix can cost a few cents; a long session that writes a lot of code can run to several dollars on the API meter.
- Where are Claude Code usage logs stored?
- In ~/.claude/projects/ as JSONL files, one per session. Each line records input, output, cache-creation, and cache-read tokens plus the model used, which is the raw data tools like ccusage read to build a full cost history.
- Is the /cost number accurate?
- It is a client-side estimate, computed locally from a bundled price table, not a reading of your actual invoice. It is reliable for catching an expensive session in real time but can drift from your bill. The authoritative figure is the Claude Console usage page.
Bottom line
/cost answers one question well: how much is this session spending right now, if you pay per token. If you are on Pro or Max, stop looking for a dollar figure and run /usage instead, because your real limit is allowance, not price. Either way, the token breakdown is the part worth reading. Output is the line that moves your bill, cache reads barely register, and the dollar total is an on-device estimate to be sanity-checked against the Console, never mistaken for the invoice.
Sources
- Anthropic. (2026). Models, usage, and limits in Claude Code (the /cost command for API-key users). Verified 2026-06-29. support.claude.com/en/articles/14552983
- Anthropic. (2026). Use Claude Code with your Pro or Max plan (the /usage command and plan allowances). Verified 2026-06-29. support.claude.com/en/articles/11145838
- Anthropic. (2026). Track cost and usage (cost as a client-side estimate). Verified 2026-06-29. code.claude.com/docs/en/agent-sdk/cost-tracking
- Anthropic. (2026). Pricing (Sonnet 4.6 per-token rate card). Verified 2026-06-29. claude.com/pricing
- ccusage. (2026). Usage analysis guide (parsing local session JSONL). Verified 2026-06-29. ccusage.com/guide