Guides

Track Claude Code and Codex usage: ccusage and other tools

The most popular tracker is ccusage. Run npx ccusage@latest, and it reads the logs that Claude Code and Codex keep on your machine and adds up tokens and an estimated cost by day, week, session or five-hour block. That makes it good for history: which day, project or model used the most. It can’t tell you how much of your plan limit is left. Those numbers come from /usage in Claude Code, and from /status or the usage dashboard in Codex. For limits always in view, CodexBar puts them in the macOS menu bar, and Claude-Code-Usage-Monitor shows a live view in the terminal.

Start with the official numbers

Only Anthropic and OpenAI know how much of your plan you’ve used, so start there:

What neither shows well is history: how many tokens went into each project last week, which model cost the most, or what a heavy day looks like. That’s what trackers are for.

ccusage

ccusage is an open-source command-line tool (MIT). It reads the session logs that coding agents write on your machine and turns them into tables. It started with Claude Code. It now reads Codex and more than a dozen other agents, including OpenCode, Gemini CLI and GitHub Copilot CLI. You don’t need to install it:

npx ccusage@latest            # every agent it finds, by day
npx ccusage@latest claude daily
npx ccusage@latest codex daily
npx ccusage@latest blocks     # Claude Code by five-hour block

The reports you’ll use most:

CommandWhat it shows
daily, weekly, monthlyTokens and estimated cost per day, week or month, with the models used
sessionThe same, per conversation
blocksClaude Code grouped into five-hour blocks, with the active block’s burn rate and a projection
statuslineA compact line for the Claude Code status line (marked beta)
claude daily --instancesClaude Code usage split by project; --project name filters to one

Useful options: --since and --until for a date range, --last 1 for today or this week, --breakdown for cost per model, --json to save or script the numbers, and --no-cost to hide dollars when you share a screenshot.

Where it reads from. For Claude Code it reads ~/.claude/projects/ and ~/.config/claude/projects/, or the folders in CLAUDE_CONFIG_DIR. For Codex it reads sessions/ and archived_sessions/ under ~/.codex (or CODEX_HOME). Codex support is marked beta, because Codex’s log format keeps changing.

What the dollar figure means

The cost column is not your bill. ccusage prices the tokens at API rates: for Claude Code it uses the cost Claude Code wrote into its own logs where there is one, and otherwise it multiplies token counts by public price lists. Codex usage is always priced from token counts.

Cache tokens are listed separately. In long Claude Code sessions most input is read from the cache, which is far cheaper than fresh input, so a high token count doesn’t always mean a high cost.

What local trackers can’t see

Every tracker that reads local logs sees only this machine and only the agents it can read. That leaves gaps:

So if a tracker says you’re fine and /usage says you’re at 90%, trust /usage.

Other trackers

Keep more than 30 days

By default, Claude Code deletes session transcripts after 30 days. It does this in the background, without a message, and a tracker can’t count what’s gone. To keep more, raise cleanupPeriodDays in ~/.claude/settings.json:

{
  "cleanupPeriodDays": 365
}

The setting can’t be 0. To keep the numbers but not the transcripts, save a monthly report instead: npx ccusage@latest monthly --json > usage-2026-11.json.

Privacy

The logs these tools read contain your prompts, Claude’s and Codex’s replies, and pieces of your code. ccusage reads them locally. By default it downloads price data to work out costs, and --offline uses cached pricing data instead. CodexBar can read browser cookies for some providers, and that’s optional. Any tracker is third-party code that runs with your permissions, so install it from its official repository and read what it asks for.

Which one to use

You want to knowUse
How much of my limit is left/usage in Claude Code, /status or the dashboard in Codex
The limits always in viewYour status line, CodexBar, or Meowdoro (below)
Which day, project or model used the mostccusage daily, session, --instances, --breakdown
Whether the subscription pays offccusage monthly, compared with what you pay
A warning before I run outClaude-Code-Usage-Monitor, or the warnings Claude Code shows near the limit

Where Meowdoro fits

We build Meowdoro, a focus timer around the MacBook notch. It isn’t a cost tracker. It shows every Claude Code and Codex session you have running, how full each one’s context is, and your Codex plan limits, so you notice a session running out before it stops in the middle of a task. At your break it suggests /compact for the session that’s filling up (how to keep an eye on context and Codex limits). For history and dollars, use ccusage alongside it. Try it and tell us what’s missing.

Questions

Is ccusage accurate?

For token counts on this machine, yes: it adds up what the agents logged. The dollar figure is an estimate at API prices, and it can’t see usage from other machines or from Claude and ChatGPT chat, which share your limits.

Does ccusage work with Codex?

Yes. npx ccusage@latest codex daily reads Codex’s session logs under ~/.codex. Codex support is marked beta.

Can ccusage show how much of my limit is left?

No. It shows what you used. For what’s left, use /usage in Claude Code or /status in Codex. ccusage blocks estimates the current five-hour block from your logs, and the official reset time is the one /usage shows.

Why does ccusage show a cost when I pay a flat subscription?

It prices your tokens at API rates, which shows what the same work would cost without a subscription. You don’t pay that amount.

Why is my usage history missing older days?

Claude Code deletes transcripts after 30 days by default. Raise cleanupPeriodDays in your settings to keep them longer.

Is there a menu bar app for Claude Code and Codex limits?

CodexBar shows both, with reset countdowns, in the macOS menu bar. Meowdoro shows your Codex limits and each session’s context in the notch.

Sources: the ccusage repository and its documentation on Claude Code, Codex, cost modes and blocks; the repositories of CodexBar, Claude-Code-Usage-Monitor and codex-ratelimit; the Claude Code documentation on settings (cleanupPeriodDays). Read on November 6, 2026.