Introduction
v0.2 · self-hosted

The token meter for your Claude Code crew.

Multi-user aggregation, real-time SSE, a drop-in React widget, and a built-in dashboard. Self-host in one command — keep every byte of usage data on your own infra.

What you get

Live counters, anywhere

Drop <TokenCounter /> on your team site, marketing page, or hero. SSE keeps every embed in sync — no polling, no stale data.

Multi-user from day one

Per-user, per-machine, per-model leaderboards. Solo dev or 50-person org — same server, same wire format.

Operator dashboard included

Built-in SPA at /. No Grafana required. Prometheus is optional — use it if you already run that stack.

Your data, your disk

SQLite by default. Self-host on a Mac mini, a Linux box, Docker, or Kubernetes. Postgres / MySQL coming next.

Zero-touch ingest

Run an agent on each laptop, or use Claude Code's PostToolUse hook with one line in settings.json. Both work offline-resilient.

Themable React widget

5 themes × 5 variants × slot-machine digit animation. Tree-shakeable ESM + CJS, 43 KB minified.

See it live

The whole widget package, embedded right here. This is the same @wigtoken-temp/widget you’d install — running against an in-page mock backend so you can poke at it without a server.

Theme: purple · Section: heroopen in new tab ↗
import { ProviderConfig, WeightedTokenCounter, CostCounter, BurnSparkline } from "@wigtoken-temp/widget";
 
<ProviderConfig server={env.SERVER} token={env.TOKEN}>
  <h1>Our crew has processed <WeightedTokenCounter /> tokens.</h1>
  <CostCounter />
  <BurnSparkline range="24h" />
</ProviderConfig>

Install

# self-hosted server (with built-in dashboard)
npm install -g @wigtoken-temp/wigtoken
wigtoken init && wigtoken start
 
# or pull the image
docker run -d -p 10103:10103 -v wigtoken:/data ghcr.io/wigtn/wigtoken:latest
# embed on your own site
npm install @wigtoken-temp/widget
# push transcripts from a personal laptop
npm install -g @wigtoken-temp/agent
wigtoken-agent run --server https://your-server --token wti_...

How it fits together

Claude Code session(s)            wigtoken server                 Consumers
─────────────────────             ──────────────────              ──────────
~/.claude/projects/   ──watch──►  chokidar + scanner              GET /api/usage/*
  *.jsonl                          │                              SSE /api/usage/stream
                                   ▼                              GET /metrics       (optional)
                                  SQLite (WAL)                    SSE /embed/stream
                                   │                                       │
                                   ▼                                       ▼
                                 Hono app  ─────►  operator dashboard SPA + @wigtoken-temp/widget

Get started

Quickstart →

Pick solo, team, or org. 30 seconds to first counter, 10 minutes to a shared team dashboard.

Widget reference →

Live iframes per component. 16 widgets, 7 themes, 5 variants — every prop documented.

Deployment →

Native (launchd / systemd), Docker, Compose, Kubernetes — pick the layout that matches your team size.

Self-hosting →

TLS, token scopes, embed origins, headless mode, backups, upgrades. Production hardening guide.

Claude Code hooks →

Skip the agent: one `settings.json` block and every Claude Code session pushes its usage.

API reference →

Every REST + SSE + Prometheus endpoint, every status code, every token scope.

Compared to

wigtokenccusageCodeBurn
Surfaceserver + dashboard + widgetCLIhosted web app
Hostingself-host anywherelocal onlySaaS
Multi-user
Multi-machine
Real-time SSEn/apoll
Embed widget✅ npm package
Custom widget components16+n/a
Prometheus / Grafana✅ optional
Audit log
Token scopesingest / read / embed / adminn/an/a
Data ownershipyoursyourstheirs
LicenseMITMITproprietary

See the full comparison page for the long-form story.

Latest

  • v0.2.0 — widget visual overhaul: slot-machine digit animation, gradient stroke sparkline, glow rings on EmbedPulseDot, responsive StatGrid, 7 themes including cyan + rose.
  • v0.1.5 — first npm publish with provenance.
  • v0.1.0 — initial release.

See the CHANGELOG for the full log.