ccusage
One command that reads your coding agents' local logs and shows how many tokens you've used and what they would have cost.
The verdict
Worth a try
Free, read-only, nothing to set up, and the most widely used way to see where your tokens go. Just remember the dollar figures are estimates at API prices, not your bill, and they only cover the machine you run it on.
Best forAnyone on a Claude, Codex or other agent plan who wants to know how much they're really using, or which projects and models eat the most.
- Stars
- 19.1k
- Licence
- MIT
- Language
- Rust
- Last release
- 22 Oct 2026
- Created
- 29 May 2025
- Open issues
- 1
As of 23 Oct 2026. Numbers move fast on trending repos.
npx ccusage@latestNeeds Node.js. bunx ccusage, pnpm dlx ccusage and a Nix package also work. There's nothing to install permanently.
What it is
ccusage is a free command-line tool that tells you how many tokens your coding agents have used and roughly what that would cost. Tokens are the chunks of text AI models read and write, and they're how AI usage is measured and billed.
Your agents already keep a log of every conversation on your computer. ccusage reads those logs and turns them into tables by day, week, month or session. It started with Claude Code (the name means "Claude Code usage") and now covers Codex, Gemini CLI, Copilot CLI, OpenCode, Amp, Antigravity and about a dozen more.
It's MIT-licensed and made by ryoppippi. It's been around since May 2025, is now written mostly in Rust, and ships new versions almost every day.
What actually happens when you use it
- You run one command.
npx ccusage@latestdownloads the latest version and runs it once. There's nothing to install or configure. - It finds your logs. It looks in the default folders each agent uses and picks up whatever it finds.
- You get a table. Each row shows input and output tokens, cached tokens, the models used and an estimated cost in US dollars.
- You can dig in.
ccusage monthly,ccusage sessionorccusage claude daily --instancesbreak things down by month, by conversation or by project.ccusage blocksshows Claude's 5-hour usage windows. - It can live in your status bar. There's a beta status line for Claude Code that shows your usage as you work.
It only reads. It doesn't change your agent's settings or send your logs anywhere.
What people like
- It's effortless. One commenter on the Hacker News launch thread said they like how easy it is to run with npx or bunx, with nothing to install.
- It shows what your subscription is really worth. This is the main reason people run it. It shows what you would have paid at API rates, and people use that to judge their plan. One Max user reported about $5k of tokens on a $100 plan.
- It works across agents. People use it to compare tools, for example checking Codex usage against a $20 plan and against paying per token elsewhere.
- It's a common yardstick. When people build tools that claim to save tokens, they often use ccusage to measure the difference.
- Counting bugs get fixed quickly. When a user found Codex usage counted 10 to 20 times too high, they sent a fix, and it was merged about two weeks later. A recent double-counting bug in some Claude setups was diagnosed in detail and closed the next day.
What people run into
- The dollar figure isn't your bill. It's what the same tokens would cost at the public API price. The docs say plainly: "Costs are estimates and may not reflect actual billing." If you're on a subscription, you paid your plan price, not this number.
- Counts can be wrong for a while. Agents change their log formats often, and ccusage has to catch up. Recent examples include Claude usage counted two to three times behind certain proxies, and the Codex over-counting. One API user found ccusage didn't match their Anthropic console, and a commenter thought the counting method was flawed at the time.
- Updates can change what it sees. One user found it stopped showing Claude usage after July, and the reply was to update to the latest version.
- Your history quietly shrinks. Claude Code deletes conversation logs after 30 days by default, so older months shrink every time you run it. One user only found out after noticing a drop in ccusage.
- It only sees one computer. If you use agents on a laptop and a desktop, each one shows only its own usage. A request to combine several computers has been open since 2025, and people still ask about it on Reddit.
Before you install
- You're running code from the internet.
npxdownloads and runs the newest version, which can access your whole machine. A Hacker News commenter raised exactly this concern. It's a popular, well-watched package, but if that worries you, install a fixed version instead of using@latest. - Your logs stay on your computer. The docs say all analysis happens locally. It can look up current model prices online;
--offlineuses the built-in price list instead. - Keep your history longer if you care about trends. Raise
cleanupPeriodDaysin your Claude Code settings so old logs aren't deleted after 30 days. - Hide costs before sharing screenshots.
--no-costremoves the dollar columns. - The "1 open issue" count is misleading. Issues from new contributors are closed automatically and reopened only if a maintainer thinks they're worth it. The project is well looked after, but that number doesn't mean there are no bugs.
The short version
ccusage is the easiest way to see how much you actually use your coding agents, and it costs nothing to try. Treat the dollar figure as "what this would cost at API prices", not as money you spent. Expect the odd counting bug when an agent changes how it writes logs, and update when numbers look off. For a quick, private look at where your tokens go, it's still the tool most people reach for.
Sources
GitHub
Hacker News
The week’s repos, every Friday.
From the same drop
obra/superpowers
Superpowers
A set of skills that makes your coding agent brainstorm, plan, write tests and review its own work before it calls anything done.
★ 304kBreakdown →
deepseek-ai/deepseek-harness
DeepSeek Harness
DeepSeek's own open-source coding agent, run from a web page or desktop app, built so that almost every feature is a plugin you can swap.
★ 259kBreakdown →
anomalyco/opencode
OpenCode
The most popular open-source coding agent. It works like Claude Code, in the terminal, a desktop app or the browser, but with almost any AI model you like.
★ 220kBreakdown →