ccusage
ccusage is an open-source CLI that reads local usage data from coding agent CLIs and turns it into daily, weekly, monthly, and per-session reports. It covers Claude Code, Codex, OpenCode, Amp, Goose, OpenClaw, Kilo, Kimi, Qwen, GitHub Copilot CLI, Gemini CLI, Grok Build CLI, and more. The Reddit community consistently recommends it as the first tool to install when coding-agent token bills become hard to explain.
Key Features
- Local-only analysis: Reads session logs on your machine, so no usage data is uploaded to a server.
- Time-based reports: Daily, weekly, monthly, and session views show where tokens and costs go.
- Multi-provider support: One command can report every detected source together.
- Simple runner:
npx ccusage@latestworks without a global install; Nix, bun, and pnpm runners are also supported. - Cost focus: Reports are built around cost visibility, not just token counts.
Use Cases
- Cost management: Developers who want to see which sessions, models, or projects burn the most budget.
- Team governance: Leads who need a simple local view of agent CLI usage before introducing broader tooling.
- Optimization baseline: Teams that want a measurement step before installing context compression or retrieval tools.
- Tool selection: Users comparing Claude Code, Codex, OpenCode, or other CLIs and checking which one is cheaper for their workflow.
Pricing
ccusage is free and open source under the MIT license. There is no hosted service or paid tier; it is a local CLI.
Getting Started
- Run
npx ccusage@latestfrom a directory where your coding agent CLI has session logs. - Use
ccusage daily,ccusage weekly,ccusage monthly, orccusage sessionfor aggregate reports. - Use a focused command such as
ccusage claude dailyorccusage codex dailyto inspect one provider.
Frequently Asked Questions
Does ccusage reduce my token usage?
No. It measures usage and costs from local data. It is a dashboard, not an optimizer, which is exactly why it works as a first step.
Where does the data come from?
Local session logs written by the supported coding agent CLIs. No cloud account or API key is required.
What is the main limitation?
It can only see sources it has adapters for, and it reports what the local logs contain, so it will not show usage from cloud-only sessions or agents with no local log integration.
Alternatives
- Langfuse: Full observability platform for LLM applications, including tracing and analytics.
- Helicone: Proxy-based LLM monitoring with cost tracking.
- CodeRabbit: AI code review that adds a different view of engineering workflow costs.
Tips & Best Practices
- Measure before optimizing: Run a weekly report first, then install retrieval or compression tools and compare.
- Compare providers: Use
ccusage weeklyto see whether one agent CLI is dramatically more expensive. - Pair with a proxy: For API-level visibility, combine ccusage's local agent view with an LLM observability proxy.
Conclusion
ccusage answers the most common coding-agent question quickly: where did my tokens and money go? It is free, local, and supports the major agent CLIs, making it a sensible first observability tool before adding heavier infrastructure.
Comments
No comments yet. Be the first to comment!
Related Tools
T3 Code
t3.codes
Open-source agent harness control surface for Claude Code, Codex, Cursor, Grok Build, and OpenCode with desktop, web, and mobile apps.
CC Switch
ccswitch.io
CC Switch is a free, open-source Rust/Tauri app that manages providers, MCP servers, and skills for Claude Code, Codex, Gemini CLI, and more from one UI.
VelaTerm
velaterm.com
Open-source terminal and agent manager built for the AI-agent era: organize Claude Code, Codex, and seven more agents into a project tree with live status, split panes, and remote access.
Related Insights
Seven AI Coding CLIs, Six Months: No Matter How Strong the Model, Work Needs Supervision
Claude Code, Codex, opencode, pi, omp and DeepSeek Harness all have personalities. After six months of deep use I run a division of labor: pi for the fastest cheapest reviews, omp for complex PRs, DeepSeek Harness on V4 Flash for high-frequency low-cost review, and Claude Code, Qoder and Cursor for writing. No matter how strong the model, work needs supervision — ideally from an independent third party.
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.
Codex Can Run Grok, GLM, and DeepSeek: Import Three Providers in Three Minutes
Codex should not be limited to GPT. The community project codex-router plugs OpenCode Go, Grok OAuth, and the Z.ai GLM Coding Plan into the Codex model picker: one install command, keys stay on your machine, native GPT models are untouched. A copy-paste guide with troubleshooting notes.