ccusage alternatives for Claude Code cost tracking

Last verified

ccusage is good and widely used. It reads Claude Code's local JSONL logs, deduplicates properly, and reports by day, month and session. It's free, open source, and has more history behind it than anything else here. If it does what you need, keep using it.

People look for something else for three reasons.

Reason 1 — "I also need my metered API spend"

The most common one, and it's a category boundary rather than a shortcoming.

Claude Code cost trackers read local session logs. Metered API spend — the money you're billed for OpenAI, Anthropic, xAI and Gemini API calls — lives in provider billing APIs and needs an admin credential. Different data source, different question.

If your AI bill has both an agent side and a production-API side, you're currently running two tools and adding the numbers yourself.

What to use: something that covers both. tokn agents reads the same local logs, and the rest of TKN reads the four provider billing APIs, so the two land in one place. Or keep ccusage and add a billing-API reader alongside it — they don't conflict.

Reason 2 — "I want it on my phone"

Everything in this category is a CLI or a local dashboard. That's the right shape for a tool you run while working — and the wrong shape for "did last week cost more than usual?" checked on a Sunday.

What to use: an app that reads the data and shows a trend. iOS apps for tracking AI API spend covers the options and what to compare.

Note the limitation honestly: a phone app can't read the JSONL files on your laptop. Anything showing agent cost on a phone is either syncing from a machine you run or showing metered API spend instead. Be sure which one you're looking at.

Reason 3 — "I want to be told, not to go and look"

ccusage answers a question when you ask it. It doesn't have an opinion about whether the number is abnormal.

For a lot of people that's the actual gap: not "I can't see my costs" but "I don't look, so I find out late."

What to use: anything with a threshold. A cron job piping ccusage --json into a Slack webhook is a perfectly good version and costs nothing — getting alerted when AI spend spikes has the pattern.

The options

ToolReadsShapeNeeds a credential
ccusageClaude Code logsCLINo
cccostClaude Code logsCLI, live sessionNo
token-meterClaude Code + Codex logsLocal dashboardNo
/costCurrent sessionBuilt inNo
tokn agentsClaude Code logsCLINo
TKN appProvider billing APIsiOSAdmin key
Helicone / PortkeyYour request trafficProxyTheir key

The first five answer "what did my coding agent cost". The last two answer "what am I being billed". Those are genuinely different questions and most people eventually want both.

What all of these share

Worth knowing, because it applies to any tool in this category including ours:

  • They price from published rates, not your invoice. The logs record tokens; dollars are computed. Rates change, and a stale price table silently produces wrong numbers. Ask any tool when its prices were last verified.
  • Deduplication is where they differ in correctness. Resuming a session re-appends the same record. A tool that doesn't key on requestId + message.id over-reports. If two tools disagree, this is usually why.
  • On a Pro or Max plan there is no dollar cost. Usage draws against quota. A cost figure from a plan-billed session tells you what the work _would_ have cost on the API — which is a genuinely useful comparison, but it isn't a charge. Plan vs API billing.

When to keep ccusage

If you only need Claude Code numbers, it's mature, it's free, and it does the job. Nothing on this page is an argument against it — the honest reasons to add something else are all about covering a _different_ question, not doing the same one better.

Sources