Claude Code doesn’t give you one place that answers “what did this cost, and why?” It gives you several, and each is good at a different question. This is a tour of them, based on Anthropic’s own documentation, so you can pick the right one instead of trying all of them.
Built into Claude Code
/usage inside a session. The Session block shows token usage by model (input, output, cache read, cache write) and an estimated dollar cost. Claude Code works that figure out locally from token counts at list price, so treat it as an estimate. Anthropic’s docs point you to the Claude Console for authoritative billing. The totals reset when you run /clear. On a Pro or Max plan, usage is included in the subscription, so /usage shows plan usage bars instead and the dollar figure isn’t meaningful for billing.
Subscribers also get a breakdown of recent usage by skills, subagents, plugins and individual MCP servers, plus flags for things like long context or cache misses. That breakdown is computed from session history on the machine you’re on, so usage from other devices or claude.ai isn’t included.
The status line. You can configure the status line to show cost and context usage continuously, so you notice a session getting expensive while it’s happening instead of afterwards.
/insights. This isn’t a cost report. It analyses your recent sessions and writes an HTML report on how you work, including friction points like misunderstood requests. Useful for habits, not for spend.
For teams and API organisations
- Claude Console has a usage page and workspace spend limits for API organisations. There’s also a Claude Code Analytics API that returns daily per-user metrics, using an Admin API key.
- Claude for Teams and Enterprise have a spend report in organisation analytics, with CSV export, and admin spend limits.
- A rough baseline. Anthropic’s cost documentation currently says average cost across enterprise deployments is around $13 per developer per active day, $150 to $250 per developer per month, and under $30 per active day for 90% of users. Their advice is to run a small pilot first and measure your own baseline. Use their numbers as a sanity check, not a forecast.
OpenTelemetry, if you want it in your own stack
Claude Code can export metrics, events and traces over OpenTelemetry, and the docs say it works on every setup, including Bedrock, Google Cloud and Foundry. You turn it on with environment variables:
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
claude
Among the metrics are claude_code.token.usage and claude_code.cost.usage, and events include claude_code.api_request, claude_code.api_error and claude_code.tool_result. Prompt text and tool content are redacted by default. You have to opt in with flags like OTEL_LOG_USER_PROMPTS=1, which is worth remembering before you point it at a shared backend.
The catch is that you need somewhere to receive and chart the data. That’s great if you already run an observability stack, and more work than it’s worth if you just want to look at your own usage.
ccusage, for quick reports from local data
ccusage is an MIT-licensed command-line tool that reads the usage data coding agents already store on your machine. It produces daily, weekly, monthly and per-session reports, and a view of 5-hour billing blocks, and its README lists support for Claude Code, Codex and a long list of other coding CLIs. It’s a good fit when you want a fast terminal answer to “what have I spent this week?” Its documentation focuses on token and cost reporting.
Where RetrySight Lite fits
Everything above mostly answers “how much.” The question that comes next is “why was that task so expensive?” which means finding the sessions where the agent went round in circles.
RetrySight Lite reads the same local logs and sorts what it finds into retry-type events per task: failed tool calls, edits, failed tests, rejected diffs, context compaction. You can open a task and see its timeline, so the expensive loop is something you can point at. It’s free, Apache 2.0, and runs entirely on your machine.
One honest caveat: a retry event in Lite is a failed tool call, an edit that changes a file, a test failure, a rejected diff or a context compaction. A long, legitimate refactor will still rack up a lot of edits, so use it to find where an agent looped, not as a score for how well it did. The taxonomy post explains what each event type means, and this one shows how to ask your editor about its own retries over MCP. If you’re weighing it against ccusage, there’s a side-by-side comparison.
Which one for which question
| You want to know | Use |
|---|---|
| What did this session cost? | /usage |
| What have I spent this week or month? | ccusage, or the Console |
| What is my team spending, and can I cap it? | Console or Teams analytics |
| Per-user metrics in my own dashboards | OpenTelemetry |
| Why was this task expensive, and where did it loop? | RetrySight Lite |
Keep one thing in mind
Costs that Claude Code or any local tool computes are estimates from token counts. For anything that touches a bill, the Console or your cloud provider’s billing page is the source of truth.
Anthropic also maintains a guide to reducing Claude Code costs (clear between unrelated tasks, pick the model to match the job, trim MCP overhead). It’s worth reading once you can see where your tokens are going.