Usage
Token and cost accounting for every agent session on this machine — per provider, per model, per day — read from your agents' own local history.
Usage
Settings → Usage is an accounting of what your coding agents have actually consumed: tokens, estimated cost, cache savings, and how close you are to your plan's rate limits.
Open Settings (Ctrl+,) and pick Usage under Editor & Workflow. The row appears when the Agent Chat GUI is on, which it is by default.
Where The Numbers Come From
Codemux reads the history files your agent CLIs already keep on disk:
| Provider | Source |
|---|---|
| Claude Code | ~/.claude/projects |
| Codex | ~/.codex/sessions |
| OpenCode | OpenCode's local data directory |
That has three consequences worth internalizing:
- It counts sessions Codemux didn't launch. A
clauderun in a plain terminal shows up here too. The page says so: "…regardless of which app launched them." - It is this machine only. Nothing is fetched from a provider's API, and nothing syncs from your other devices.
- Sessions Codemux ran are not double-counted — live usage events are deliberately discarded in favour of the provider's own history file.
Scanning is incremental, so a refresh re-reads only what changed.
Period and Refresh
A segmented control picks the window: Today, 7 days (the default), 30 days, or 90 days.
Today buckets by hour across the trailing 24 hours — not the calendar day — so an evening session is still visible at 1am. The longer periods bucket by day. Bucket boundaries follow your local timezone.
The page polls every 30 seconds while open; the header subline reads Aug 14 – Aug 21 · live (or refreshing…). The refresh button re-scans provider history before refetching. Export CSV downloads codemux-usage-7d.csv.
With nothing in range: "No agent activity in this period."
Overview
Three headline numbers:
| Stat | Footnote |
|---|---|
| Estimated cost | API/list-price equivalent |
| Tokens | "64% served from cache" |
| Sessions | provider history on this machine |
Below them, a stacked bar chart per bucket — toggle between Est. cost and Tokens. Hovering a bar reads out the bucket, its total, and the per-provider split. The legend colors each provider: Claude Code, Codex, Cursor, OpenCode.
Two footnotes sit under the chart and are worth taking literally:
API/list-price equivalent · not an invoice
input + output + cache read + cache write
Token composition
A five-cell strip breaking the total apart:
- Processed — everything.
- Cached input, with what share of input it was.
- Uncached input, with the number of cache writes.
- Output, noting reasoning tokens where the provider separates them (Codex and OpenCode do).
- Cache savings — dollars, plus a multiplier like
3.4× vs uncached list price.
Provider Lanes
One expandable row per provider: its logo, name, and plan label (Max 20x, ChatGPT Pro, …) or a plain Provider history when no plan is reported.
- Quota meters — up to two bars, 5h and week, with a
resets 14:30note in local time. The bar shifts tone as it fills: calm, then ember past 60%, then attention past 85%. - Sparkline of that provider's tokens per bucket.
- Tokens and cost on the right.
- Expand for per-model rows: model id,
18% of tokens(marked· subagentswhen subagent work contributed), tokens, cost.
Quota meters need a live session. Plan limits are reported by the provider while a session runs and are held in memory only — they're never written to disk. A provider you haven't used since launching Codemux shows no meters, and they don't survive a restart.
Breakdown
A toggle between Model and Day.
- Model — a flat cross-provider list, most expensive first.
- Day — the same buckets, newest first, with cost, share of cost, and tokens.
Beside it, a Cost confidence block: how much was provider reported, how much Codemux priced from a model table, how much is unpriced, and the cache savings.
How Cost Is Estimated
Cost is a list-price estimate, not a bill.
Codemux carries a static table of published per-million-token rates — separate figures for input, output, cache reads, and the two cache-write durations — and matches your model ids against it.
- Where a provider reports its own cost (OpenCode does), that figure is preferred.
- A model Codemux doesn't recognize still contributes tokens, but no cost. Those tokens land in the Unpriced line of Cost confidence and show
—instead of a dollar figure, so a new model release quietly deflates the total rather than silently inventing a price. Check that line before trusting the headline number. - Subscription plans are not modelled at all. If you're on a flat-rate plan, the cost column tells you what the same work would have cost through an API — useful for comparing models, meaningless as a statement of what you owe.
CSV Export
One row per bucket × provider × model:
bucket_start, provider, model, input_tokens, output_tokens,
cache_read_tokens, cache_write_tokens, reasoning_tokens,
total_tokens, cost_usd, cost_sourceLive quota figures are deliberately excluded — they're a point-in-time reading, not history.
Related
- Settings — the rest of the settings surface
- Agent Chat — the context-window meter for a single thread