MXterm Pro

Claude Code and Codex Token Usage: What the Token Meter Reads

Henry AGI
4 min read
Cover: Claude Code and Codex token usage, with the Claude Code, Codex and MXterm icons side by side.

Claude Code token usage appears in MXterm Pro's Token Meter. It reads Claude Code, Codex, Gemini CLI and omp transcripts and reports tokens over the last 5 hours and 7 days. By default that's spend, not a plan percentage, except Codex, whose files carry one, as fresh as your last turn. Opt-in switches in Settings add Claude limits (macOS only), Codex limits and account balances.

What the Token Meter Shows

MXterm Pro
Claude Code token usage in the Token Meter: what an agent row lists, from tokens used to the 7 day breakdown
Claude Code token usage in the Token Meter: what an agent row lists, from tokens used to the 7 day breakdown

Once an installed agent or a saved account key gives it something to show, the Token Meter sits in the right-hand group of title-bar buttons and stays there while the app is open, so you don't have to open a panel to find it.

The bar carries a single figure: the most constrained quota anywhere, colored by how close it is. If nothing you've configured publishes a quota, the chip shows the 5-hour token total of Claude Code, or of Codex when Claude Code isn't installed. With no agent installed and only account balances, it shows the lowest USD balance.

Click it for a summary. Every provider you have set up gets one two-line row: its name and the reset clock that matters on the first line, and on the second its 5-hour and weekly bars where a limit is known, or today's spend and tokens where none is. The provider you pin in Settings → Token Meter is listed first (Claude Code unless you change it, or none).

Open a row for that agent's full detail. It lists tokens used in the last 5 hours and the last 7 days, abbreviated with K, M or B, plus a sparkline of the last 24 hours with one bar per hour. Cost tiles show estimated cost for today, the last 7 days and the last 30 days at API rates; the Stats panel footer shows the date of the price table.

The 7-day breakdown covers fresh input, output, cache writes, cache reads, and the number of turns. The numbers refresh in the background about once a minute.

An agent only shows up if it's installed, meaning its transcript folder exists. With no local agent and no account key saved, the meter renders nothing at all rather than an empty gauge. A gauge reading zero claims you've used nothing, which isn't the same as not knowing.

Related guideRun Claude Code and Codex in Split Terminal Panes

Which Agents the Token Meter Reads From Disk

MXterm Pro
Where token counts come from: each agent keeps a transcript on disk, records tokens per turn, and Token Meter reads them.
Where the token counts come from.

For the token counts, Token Meter has one source: the transcript each agent keeps on your disk. Claude Code, Codex, Gemini CLI and omp record the token counts for every turn in theirs. The meter doesn't call a provider's API or ask you to sign in for the token counts. There's no API key to paste and no account to connect, and the counts are computed on your Mac.

The list is four names long because the meter reads the transcript folders of Claude Code, Codex, Gemini CLI and omp. It does not read OpenCode, so it shows nothing for it rather than a guess.

There is a second, separate source that isn't transcripts. Paste an API key in Settings → Token Meter for a supported account provider and it gets its own row, showing what that provider reports: a balance, a plan quota or spend. That's a different measurement with different caveats. Read the difference between usage and balance before you treat any of these numbers as interchangeable.

Why Cache Reads Get Their Own Line

MXterm Pro
Claude Code and Codex token usage with cache reads counted in one total versus shown on their own line
Claude Code and Codex token usage with cache reads counted in one total versus shown on their own line

Most tokens in a long agent session are cache reads: context the agent has already sent, served back from the provider's cache on each new turn. Counted together with everything else, they make a session look far bigger than it is.

Given their own line, cache reads stay out of the way, and you can see what the rest of the session actually came to.

What It Won't Show

By default Token Meter reports spend: tokens already used. It doesn't predict how much more you can run. Claude Code's transcripts don't record where a subscription stands, so a Claude percentage needs another source. Codex's session files carry its rate-limit readings, but only as fresh as your last Codex turn. Two opt-in switches now provide a live figure for each.

For Claude, Plan limits work on macOS only. Turn it on in Settings → Token Meter. The app then reads Claude Code's saved sign-in from your macOS Keychain and fetches your real plan usage from api.anthropic.com.

Live Codex limits reads Codex's ChatGPT sign-in from ~/.codex/auth.json and sends it to chatgpt.com to fetch the current 5-hour and weekly windows.

It is designed only to read that file. An expired token makes no request and asks you to run codex. A sign-in kept in the system keychain instead is not read at all. Both switches need you to turn them on in Settings → Token Meter.

Codex is the one that has a number even with that switch off. Its own CLI writes the plan's rate-limit readings into its session files, so the meter reads them from the same lines it already scans. That reading is only as fresh as your last Codex turn, which is the reason the live switch exists.

The 5-hour and 7-day figures are windows that look back from the current moment. "Used in the last 5 hours" is exactly what the number means. It says nothing about what your plan allows.

Who It's For

Token Meter is built for running Claude Code and Codex side by side, in split panes or together in a Control Room. It shows which one is eating tokens without switching into either CLI to ask. If you run a single agent now and then, you won't learn much from it. See also the Token Meter page and the Token Meter docs.

See it running for yourself

Multi-pane SSH, Command Recipes (Cmd+J), and a multi-agent Control Room.

Download MXterm Pro

Frequently Asked Questions

Does the Token Meter need anything turned on?

There's nothing to turn on for the token counts. The plan-limit and account-provider parts need you to turn them on in Settings → Token Meter.

How do I see my Claude Code token usage in MXterm Pro?

Click the meter in the title bar and open Claude Code's row. It shows tokens used in the last 5 hours and 7 days, plus a 24-hour sparkline with one bar per hour. Cost tiles show estimated cost at API rates, labeled as not what a subscription was billed; the Stats panel footer shows the date of the price table. A 7-day breakdown covers fresh input, output, cache writes, cache reads and turns. Codex gets the same when it's installed.

Which agents does the Token Meter cover?

Claude Code, Codex, Gemini CLI and omp, each only if it's installed. Their token counts are read off disk: the meter scans their transcript folders and does not read OpenCode. Separately, you can add account providers as account rows by pasting an API key. Those report a balance, a plan quota or spend, not tokens from a transcript.

Does it show my rate limit or what percentage of my plan I've used?

For Claude, only if you enable it. Codex shows one from its session files even with the switch off. Plan limits (macOS only) in Settings → Token Meter shows real percentages of your Claude plan from api.anthropic.com, using Claude Code's saved sign-in. Live Codex limits fetches Codex's figure fresh through chatgpt.com. Both need you to turn them on in Settings → Token Meter.

Does it need an API key, or send my usage anywhere?

Not for token counts. Those are computed on your Mac from the transcripts Claude Code and Codex already write, with no API key or account. The opt-in switches do contact a provider: Claude plan limits contacts api.anthropic.com, live Codex limits contacts chatgpt.com, and an account provider's key is used against that provider. For what MXterm Pro sends, see the Privacy page.

Why are cache reads shown separately?

On a long session most tokens are cache reads, and adding them to everything else makes the session look far bigger than it is. A separate line shows what the rest of the session came to.

Ask AI about MXterm Pro

Open a live answer in ChatGPT, Claude or Perplexity, based on this page. The assistant writes it, not us, so check the sources it cites.

Question sentHow do I track Claude Code and Codex token usage on my Mac with MXterm Pro?