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
- ccusage
- What the dollar figure means
- What local trackers can’t see
- Other trackers
- Keep more than 30 days
- Privacy
- Which one to use
- Questions
Start with the official numbers
Only Anthropic and OpenAI know how much of your plan you’ve used, so start there:
- Claude Code:
/usageshows your five-hour and weekly bars with reset times, plus what’s using them up. On Pro and Max, your status line script gets the same two percentages, so you can keep them on screen. More in Claude Code usage limits. - Codex:
/statusin the CLI shows what’s left of your windows./usagethere shows tokens, not limits. The usage dashboard at chatgpt.com/codex/settings/usage shows both windows and your credits. More in how to check your Codex usage.
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:
| Command | What it shows |
|---|---|
daily, weekly, monthly | Tokens and estimated cost per day, week or month, with the models used |
session | The same, per conversation |
blocks | Claude Code grouped into five-hour blocks, with the active block’s burn rate and a projection |
statusline | A compact line for the Claude Code status line (marked beta) |
claude daily --instances | Claude 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.
- On a subscription (Pro, Max, Plus), the figure shows what the same work would have cost on the API. It’s a handy way to compare days and projects, and to see whether a subscription pays off. It doesn’t tell you how close you are to a limit.
- On an API key it’s close to what you pay, but your provider’s billing page has the final number.
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:
- Other places that share your limit. Your Claude limits are shared with Claude on the web, the desktop app and your phone. From December, Codex limits on Plus, Pro and Business will be shared with ChatGPT (what changes). None of that shows up in your logs.
- Other machines. A laptop, a server you SSH into, or a cloud session each keeps its own logs.
- Five-hour blocks are rebuilt, not read.
ccusage blocksworks out the windows from the times in your logs. The real window and its reset time are the ones/usageshows. - Deleted logs. Claude Code deletes old transcripts, so older history disappears too (see below).
So if a tracker says you’re fine and /usage says you’re at 90%, trust /usage.
Other trackers
- CodexBar: a macOS 14+ menu bar app (also on Linux) that shows the session, weekly and monthly windows of Codex, Claude and many other providers, with countdowns to the next reset. It gets the numbers through the sessions you already have, such as CLI sign-ins, API keys and, if you choose, browser cookies. Install it with
brew install --cask codexbar. - Claude-Code-Usage-Monitor: a live terminal view for Claude Code with your pace, forecasts and warnings. Its latest version can take the official limit percentages from the status line, labels which numbers are official and which are estimates, and can keep its own history beyond Claude Code’s 30-day cleanup.
- codex-ratelimit: the Codex five-hour and weekly percentages and reset times, read from
~/.codex/sessions. - A status line. ccstatusline and
ccusage statuslinekeep cost and usage at the bottom of Claude Code. See ready-made status lines.
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 know | Use |
|---|---|
| How much of my limit is left | /usage in Claude Code, /status or the dashboard in Codex |
| The limits always in view | Your status line, CodexBar, or Meowdoro (below) |
| Which day, project or model used the most | ccusage daily, session, --instances, --breakdown |
| Whether the subscription pays off | ccusage monthly, compared with what you pay |
| A warning before I run out | Claude-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.
Related guides
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.