The built-in commands
| Command | Shows |
|---|---|
/usage | Where you stand against your plan's limits, and when they reset |
/cost | Tokens and cost for the current session. Most useful when you pay per token with an API key |
/context | What is filling the context window right now: files, tools, MCP servers, history |
/status | Your account, model and settings |
Teams that pay through the API can also see spend by key and workspace in the Claude Console.
Where the numbers live
Every session is saved as a JSONL file under ~/.claude/projects, in a folder named after the project path. Each assistant message in the file carries a usage record: the model, input tokens, output tokens, and tokens written to and read from the prompt cache. Any tool that shows history is adding these up.
Why cache tokens matter
Claude Code caches the conversation so far and re-reads it on every turn. Cache reads are billed at a fraction of the normal input price and cache writes at a premium. In a long session they are most of the token count. A tool that ignores them, or prices them as ordinary input, gives you the wrong number.
Seeing usage over time
ccusage
An open-source command-line tool that reads the transcript files and prints daily, monthly and per-session tables. Run it with npx ccusage. It's the quickest answer if you live in the terminal.
OpenTelemetry
Claude Code can export usage metrics to an OpenTelemetry collector. This is the route for teams that want dashboards across many developers, and it needs somewhere to send the data.
Rollcage
Rollcage's usage view reads the same local transcripts and shows tokens per day, project, model and session in a Mac window, with the cost at Anthropic's API list prices including cache reads and writes. It covers Codex sessions too, and sits next to the rest of what Rollcage shows about your agents: memory, storage and blocked actions.
What cost means on Pro and Max
On a subscription you aren't billed per token, so the cost figure is an equivalent: what the same usage would have cost through the API. It's useful for two things. It tells you whether the plan pays for itself, and it shows which projects and habits burn through your limits.
Ways to use less
- Start a new session, or run
/clear, when you change task. A long history is re-read on every turn. - Use
/compactbefore the context fills up, not after. - Check
/contextfor MCP servers and large files you aren't using. - Pick the model for the job. The largest model costs several times more per token than the mid-sized one.
- Give precise instructions and file paths. Exploration is the expensive part.
Questions
How do I check my Claude Code usage limit?
Type /usage in a session. It shows how much of your plan's allowance you've used and when it resets.
Why is /cost different from what I'm billed?
/cost is an estimate for one session, calculated locally. Your invoice covers every session and machine, and on a subscription plan there's no per-token charge at all.
Does usage tracking need an API key or an account?
Not for tools that read local transcripts, such as ccusage and Rollcage. They only read files already on your Mac.
How far back can I see?
As far back as your transcripts go. Claude Code deletes old sessions after a retention period, 30 days by default, which you can raise with the cleanupPeriodDays setting.