ccusage CLI
Token and cost reports for Claude Code, Codex, Gemini CLI and other agents from local logs, by day, month and session
- 19,238 ★ on the repository
- Last commit
Extended access
Why this level
- Runs via npx and reads local logs of Claude Code, Codex and other agents
- Downloads a price table to compute cost; works without network with --offline
Install
- Works in
Manual install
npx ccusage@latestNo install needed. Alternatives: bunx ccusage, pnpm dlx ccusage.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Runs via npx and reads local logs of Claude Code, Codex and other agents
- Downloads a price table to compute cost; works without network with --offline
This is third-party code. Review the repository files before installing.
What it does
ccusage reads the usage data coding agents store on disk and builds tables by day, week, month and session. It supports Claude Code, Codex, OpenCode, Amp, Gemini CLI, GitHub Copilot CLI, Goose and more. For Claude Code it adds a five-hour billing window report, per-project breakdown and a status line. Costs are shown in USD including cache tokens, output can be JSON, and prices can be overridden in config.
Who it is for. For people using agents on a subscription or API who want to see real token and money usage.
Good fit when
- You want to know what agent work costs per month
- You want to compare usage across projects or agents
- You need to track Claude Code five-hour limits
Not a fit when
- You need team-wide spend tracking across machines
- Your agent does not keep local usage logs
Example request
Show how many tokens and dollars Claude Code used this month by projectLimitations
Counts only what is in local logs on this machine. Costs are estimates based on a price table; --offline uses cached prices without network. The Claude Code status line is in beta.
How to disable. Nothing to remove when run via npx. If you added the status line to Claude Code, remove it from settings.json.
FAQ
Does ccusage send my data anywhere?
The README describes analysis of local data. Pricing is fetched from the network, which --offline disables.
Can I hide costs?
Yes, --no-cost removes cost columns and fields.
Discussion
No questions or reviews yet.
Related
CLI toolsCounts token use and cost of Claude Code and Codex sessions from local logs and shows remaining limits in the status line
TokenTracker counts tokens and spend across Claude Code, Codex, Cursor, Gemini CLI and other agents from local logs and shows them on a local dashboard
A real-time terminal monitor for Claude Code usage: tokens, messages and cost in the five-hour window, with forecasts and export
cc-lens
Claude Code Lens (cc-lens)
Local Claude Code analytics: a dashboard of sessions, tokens, cost and projects from your ~/.claude data, no cloud
A CLI and MCP server that tally token spend across 41 tools and agents, break it down by project and model, and help cut wasted tokens
Local browsing, search and cost tracking for Claude Code, Codex and other agent sessions in one web UI
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| ccusage (this entry) | no | 19,238 | ||
| Claude Resets: usage reset tracker | no | not required | unofficial tracker of Claude limit resets | |
| TokenTracker | no | 2,149 | tokenTracker counts tokens and spend across Claude Code | |
| Claude Powerline | no | 1,175 | a statusline for Claude Code |
README in short
The README starts with npx and a table of supported agents with a command for each. It then covers bunx, pnpm and Nix, report examples with date, project and timezone filters, JSON export and a compact mode for screenshots. Full docs are at ccusage.com.