FormingConfigclaude-codecodexopencodegemini-clipublished fresh until

See where your Claude Code and Codex tokens and money went, per day and per session

Summary Update before comparing costs: recent fixes correct recorded Codex Ultrafast pricing, duplicate OpenCode Claude Agent turns, and --until day boundaries. Reports remain estimates of local agent usage, not subscription invoices.

Not for team-wide OpenTelemetry metrics

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
AConfig · v20.0.34+wwfix.1ccusage CLI: token and cost reports from agent logs
How you use itA setting in your project
What it can doinstalls software · writes files · network · runs shell
What's inside
AConfig · v20.0.34+wwfix.1ccusage CLI: token and cost reports from agent logs
How you use it
A setting in your project
What it can do
installs software · writes files · network · runs shell
What's inside

What this thread does

As of November 2026, use ccusage 20.1.1 for local token and estimated-cost reports; older releases can miscount requests or underprice recorded Codex Ultrafast usage.

Do first: run the versioned CLI for a baseline report:

npx ccusage@20.1.1 daily

The repository README, read November 3, documents the npx ccusage invocation and daily; this command pins that invocation to the November 23 release. Compare the same date range and agent selection before and after a cost-saving change.

What it is

ccusage is a command-line report over the JSONL logs agent CLIs already write locally (for Claude Code under ~/.claude/projects/ or ~/.config/claude/projects/). As of November 2026, ccusage 20.1.1 sends a daily usage ping after a first-run notice; nothing from agent logs is sent. Collection is off with --offline and in CI; opt out with ccusage telemetry disable or DO_NOT_TRACK=1, per the README. @MahmutGundogdu described using it to measure his spend before moving to OpenTelemetry (8 September 2026, in Turkish).

Useful commands:

  • ccusage daily, weekly, monthly, session: all detected agents together
  • ccusage claude daily, ccusage codex daily, and the same for OpenCode, Gemini CLI, Copilot CLI, Amp and others
  • ccusage blocks: Claude Code's 5-hour usage windows
  • --json for scripts, --mode calculate|display|auto to choose how cost is computed

When to use it

Before you try a token-saving technique (a compression proxy, terser replies, a different harness), record a baseline, then compare a similar week afterwards. Most advice skips that step.

Alternatives

  • /usage inside Claude Code for the current session and its cache hit ratio.
  • Claude Code's OpenTelemetry metrics for a whole team.
  • Claude-Code-Usage-Monitor (MIT) for a live terminal view.

Caveats

  • Dollar figures are estimates at API list prices. On a Claude subscription they are not your bill, and they can differ from what /usage shows.
  • Without --offline (-O), each run downloads a model price table. That matters if you poll it every minute, for example in a status line.
  • From version 20 the npm package installs a prebuilt native binary through optional platform packages.
  • GitHub now identifies the licence as MIT; 20.1.0 makes the root MIT license detectable.

For a source-focused report, use ccusage claude daily --mode display; use --offline (-O) to avoid fetching pricing, per the README, read November 3.

Material fixes since 20.0.34

ReleaseDateEffect on a report
20.0.46October 30Uses Ultrafast pricing for recorded Codex Ultrafast requests
20.0.47November 1Counts OpenCode Claude Agent turns once in unified reports; retains sessions last active on the --until day
20.0.48November 2Release; its notes list no significant changes

Sources: 20.0.46, 20.0.47, 20.0.48. The intervening release history also includes request deduplication and configuration fixes; re-generate a baseline with the same version rather than mixing historical report outputs.

Evidence: rzv-me's October 28 issue #1987 provides a synthetic rollout showing recorded Ultrafast traffic falling back to Standard pricing in 20.0.45. The shipped fix is documented in 20.0.46. The reproduction is upstream evidence, not a WhatWorks lab run.

Limits

API-equivalent dollars are not the invoice for a Claude subscription. Report completeness depends on the local records available, and cost comparisons depend on both the pricing table and parser version.

Not for: collecting organization-wide telemetry from many machines; see claude-code-opentelemetry-token-cost-metrics.

checked 2026-11-23

Started from a post by @MahmutGundogdu, packaged by the editor. Original post

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# See where your Claude Code and Codex tokens and money went, per day and per session
Summary:  Update before comparing costs: recent fixes correct recorded Codex Ultrafast pricing, duplicate OpenCode Claude Agent turns, and --until day boundaries. Reports remain estimates of local agent usage, not subscription invoices.

## Options
- A · ccusage CLI: token and cost reports from agent logs · early, no verdict yet · installs software · writes files · network · runs shell
Copy for agent
get the whatworks thread ccusage-token-cost-report and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ccusage-token-cost-report

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · ccusage CLI: token and cost reports from agent logs

CLI that reads local usage logs from Claude Code, Codex, OpenCode, Gemini CLI and other agent CLIs and reports tokens, cache reads and writes and estimated cost by day, week, month, session or 5-hour block, as tables or JSON. MIT. Use --offline to skip the price-table download. Not for: team-wide cost metrics or per-customer API bills (it reads local logs only); see claude-code-opentelemetry-token-cost-metrics.

Format
Config
Source
github:ccusage/ccusage
Pinned
v20.0.34+wwfix.1 · d7555844929a
Content hash
d7555844929ad76e
Audit
scan passed
Can do
installs software · writes files · network · runs shell
Works with
claude-code · codex · opencode · gemini-cli
Check
ccusage 20.0.34 installed in the project; ccusage runs without a download; A Claude Code daily report runs without network access
Author
@ryoppippi
Kudos
0
Are you @ryoppippi? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package ccusage-cli before installing

A · Files

Read from the package source at the pinned version. Shown as is; nothing here runs.

Loading files…

Ask your agent
show me the files of the whatworks package ccusage-cli
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp