ccusage CLI

Token and cost reports for Claude Code, Codex, Gemini CLI and other agents from local logs, by day, month and session

  • 19,238 ★ on the repository
  • Last commit
CLIEditors’ pick

Extended access

Why this level

  • Runs via npx and reads local logs of Claude Code, Codex and other agents
  • Downloads a price table to compute cost; works without network with --offline
All reasons and checks

ccusage/ccusage

Install

Manual install

npx ccusage@latest

No install needed. Alternatives: bunx ccusage, pnpm dlx ccusage.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Runs via npx and reads local logs of Claude Code, Codex and other agents
  • Downloads a price table to compute cost; works without network with --offline

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 project

Limitations

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.

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.

Discussion

No questions or reviews yet.

CLI tools

Counts token use and cost of Claude Code and Codex sessions from local logs and shows remaining limits in the status line

CLIExtended access535Repository stars

TokenTracker counts tokens and spend across Claude Code, Codex, Cursor, Gemini CLI and other agents from local logs and shows them on a local dashboard

CLIBroad access2.1KRepository stars

A real-time terminal monitor for Claude Code usage: tokens, messages and cost in the five-hour window, with forecasts and export

CLIExtended access8.8KRepository stars

cc-lens

Claude Code Lens (cc-lens)

Local Claude Code analytics: a dashboard of sessions, tokens, cost and projects from your ~/.claude data, no cloud

CLIExtended access599Repository stars
Official

A CLI and MCP server that tally token spend across 41 tools and agents, break it down by project and model, and help cut wasted tokens

CLIExtended access11.6KRepository stars

Local browsing, search and cost tracking for Claude Code, Codex and other agent sessions in one web UI

CLIExtended access6.3KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
ccusage (this entry)no19,238
Claude Resets: usage reset trackernonot requiredunofficial tracker of Claude limit resets
TokenTrackerno2,149tokenTracker counts tokens and spend across Claude Code
Claude Powerlineno1,175a statusline for Claude Code

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.

README badge

Report a problem

Foxx AIccusage
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.