token-viewer — telemetry for code agents
live — sqlite + jsonl
daily input — today
5,759,642
5,759,642 input tokens · 1,420 tok/s
last 10m · pointy

Your agents spend tokens.
Now you can see it.

Token-viewer is a tiny localhost instrument — one big number, no dashboard bloat. It tails your local DBs and shows input-only, daily live with a pointy sparkline behind it. No cloud, no key, just node server.js.

opencode

~/.local/share/opencode/opencode.db · 22G

codex

state_5.sqlite · 58M total

claude

~/.claude/projects · auto

combined

all agents · daily sum

git clone https://github.com/Parithosh-Varma/token-viewer && cd token-viewer && node server.js
Zero deps · Node 22+ `node:sqlite` · README → · http://127.0.0.1:8787
● live demo — localhost:8787 · daily inputautoplay · muted · loop
why this exists

Cache is 93% of what you see

Token-viewer separates input, output, and cache re-reads. That 89M “total” is mostly cheap cache — daily input is the real spend.

input paycache cheapoutput small

Smooth, not jumpy

Number tweens with easeOutCubic 480–950ms at 60fps. Sparkline glides with it — no sharp jumps, subtle tension, no overshoot.

220ms poll60fps lerp~1.6px line

One number, minimal

Not a dashboard. One big Gnomon number, input-only by default, dark/light toggle, pointy graph as bg. Copy, fullscreen, done.

Gnomon displayInstrument Sans bodyGeist Mono data

Compatible with the agents you actually use

Auto-detects local stores. No API keys. If a DB isn’t there, it just shows 0 — other users with different setups see their own numbers.

opencode ✓ codex ✓ claude — auto cursor · windsurf · aider · continue — placeholder
GET /api/live — combined + per-agent · daily since 00:00
{
  "opencode": { "daily": { "sum_input": 5759642 } },
  "codex":    { "daily": { "total_tokens": 1279049 } },
  "combined": { "daily": { "sum_input": 6996187 } }
}
Also: /api/agents · /api/health · /health