ccusage
Token and cost reports for Claude Code, Codex, Gemini CLI and other agents from local logs, by day, month and session
Install
npx ccusage@latestNo install needed. Alternatives: bunx ccusage, pnpm dlx ccusage.
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.
Security check
- Only reads local agent logs and builds reports
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.
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.
Related
A CLI for every Google Workspace API with JSON output and agent skills: Drive, Gmail, Calendar, Sheets and more
Local search over Markdown notes, docs and meeting transcripts: keywords, semantic search and reranking, with an MCP server
A task manager for AI-driven development: breaks a PRD into dependent tasks and guides the agent through them via MCP or CLI
Anthropic's official plugins for knowledge work roles: sales, support, product, marketing, legal, finance, data and enterprise search