How Claude Code Costs Work: Tokens and Usage Explained
Wondering how Claude Code costs are calculated? The official docs put it this way: "Claude Code charges by API token consumption." In other words, what counts is how many tokens the model reads and writes. This post is based on the official docs as checked on 2026-11-25. The display may change with updates, so it's worth checking the latest docs too.
How tokens add up
Tokens are split into input and output. According to the docs, the larger the context, the more tokens you use. Claude Code sends the entire conversation along with every request. So in a session you've kept open for a long time, even one short question can use a lot.
Repeated content like the system prompt is handled by the prompt cache. Tokens read from the cache and tokens written to the cache are counted separately. Also keep in mind that thinking tokens are counted as output tokens.
Checking in /usage
Run /usage at the prompt and look at the Session section. It shows input, output, cache read, and cache write tokens for each model. The amount shown next to them is an estimate calculated locally by applying standard rates to the token counts. It may differ from your actual billing, so treat it as a reference.
If you're signed in with a plan account, the docs say the Session amount has nothing to do with billing. In that case, look at the plan usage bar and the usage breakdown on the same screen. For each habit that makes up 10% or more of your recent usage, the breakdown shows a suggestion for improvement. Press the d and w keys to switch between the last 24 hours and the last 7 days. These figures are calculated from the local records on the device you're using right now. Usage from other devices or claude.ai isn't included.
Habits that use fewer tokens
- When you move on to unrelated work, start fresh with
/clear. - If you need to continue the conversation, write what to keep after
/compact. - According to the docs, Sonnet handles most coding tasks well and costs less than Opus. Use
/modelto pick the model that fits your task. - For simple tasks, lower the effort level with
/effort. - Turn off MCP servers you aren't using in
/mcp.
What the app does
Usage Monitor is a third-party macOS menu bar app that isn't affiliated with Anthropic. On the Stats screen, you can see usage by model, an activity heatmap, and token trends.
Learn more about Usage Monitor
Sources
Usage Monitor: Claude Code usage in your Mac menu bar · What it does