Analyze coding (agent) CLI token usage and costs from local data.
open sourceMITself-hostablefree
ccusage reads the local usage logs that coding-agent CLIs write and turns them into daily, weekly, monthly and per-session token and cost reports. It started as a Claude Code tool and now covers Codex, OpenCode, Amp, Gemini CLI, Copilot CLI, Goose and many others. Run it with npx ccusage@latest; no API key or account needed.
Ways to install
Package managers
Problems it solves
- how much would my Claude Code usage have cost on the API this month
- see my token usage per day from Claude Code
- which session burned through all my tokens
- is my Max subscription worth it compared to paying per token
- track Codex and Claude Code usage in one report
- monthly breakdown of AI coding agent costs by model
- check usage without logging in to any dashboard
- report on usage from the local logs my agent CLI already writes
Features
- daily, weekly, monthly and session reports
- per-model cost
- supports Claude Code, Codex, OpenCode, Amp, Gemini CLI, Copilot CLI and more
- reads local data only
- JSON output
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what ccusage does.
- Claude Code Usage Monitor Real-time Claude Code usage monitor with predictions and warnings
- Ponytail Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
- CodexBar Every AI coding limit, in your menu bar.
- clauth Claude Code multi-account manager, usage monitor (CLI, TUI & cross-account delegation via MCP)