Claude token counter

Count the tokens.
Know what they cost.

A Claude token counter measures the input, output, cache-read, and cache-write tokens used by Claude. TokenMaxing counts those categories from your actual Claude Code sessions, estimates their USD cost, and attributes them to a repository and developer.

Input

New context sent to Claude: your prompt, instructions, and uncached conversation context.

Output

Tokens Claude generates while reasoning, explaining, and producing code or tool calls.

Cache read

Previously cached context reused by a session. It is billed differently from fresh input.

Cache write

Context written into the prompt cache for reuse. This has its own price and should not vanish into “input.”

Why the split matters: providers price each category differently. A single total can describe activity, but it cannot explain cost accurately when cached and uncached input are blended together.

Counter vs tracker

Pasted text is a preview. Session history is the receipt.

Text tokenizer

Useful before a request. It estimates the token count of text you paste, but has no tools, responses, cache behavior, history, or repository context.

Local usage CLI

Great for checking one machine locally. Tools such as ccusage can summarize Claude Code logs without an account.

TokenMaxing

Keeps history across sessions, distinguishes accounts, attributes usage to repos and people, prices it, and makes it useful to a team.

Actual usage

From session file to useful signal.

The collector runs locally and reads the usage metadata written by Claude Code and Codex. Raw logs, prompts, and source code stay on your machine. If you enable cloud sync, only normalized usage metadata is sent as OpenTelemetry—so your count reflects what the coding agent really used, not a guess based on one prompt.

  1. 1 Read new Claude Code and Codex session usage.
  2. 2 Separate input, output, cache-read, and cache-write tokens.
  3. 3 Attach the active repository and the correct account identity.
  4. 4 Estimate model-aware USD cost and roll history up over time.

Also built for Codex

One count across both coding agents.

TokenMaxing handles Codex token usage alongside Claude Code, with the same repository, developer, cost, and history model.

Explore analytics →

Frequently asked questions

Claude token counter FAQ

How do I count Claude Code tokens?

Use TokenMaxing to read the usage metadata in your local Claude Code session files. It separates input, output, cache-read, and cache-write tokens, estimates their model-aware USD cost, and attributes the usage to the active repository and developer.

What's the difference between input and cache tokens?

Input tokens are new context sent to Claude. Cache-write tokens are context stored for reuse, while cache-read tokens are previously cached context reused by a later request. Each category can be priced differently, so keeping them separate produces a more accurate cost estimate.

Does TokenMaxing count Codex tokens?

Yes. TokenMaxing counts Codex usage alongside Claude Code, using the same token-category, repository, developer, cost, and history model.

Stop estimating. Count the session that happened.

Install TokenMaxing to see your real Claude Code and Codex token count, the cache categories behind it, and the estimated cost by repository.