aiusage

Local-first usage & cost analytics for AI coding tools — one append-only ledger, exact collectors, and a live dashboard.

I use several AI coding tools daily, and none of them agree on what anything costs. aiusage is my answer: a local-first tracker with exact collectors for Claude Code, Codex, OpenCode, and my own agent swarm (plus estimates where only estimates exist), all feeding an append-only event history that is never rewritten — costs are recomputed on read from a live pricing catalog, so corrections apply retroactively without touching history.

On top of the ledger sits a pure analytics layer: rolling five-hour block windows, burn rate, per-model and per-project breakdowns, notional-vs-subscription ROI, a waste grade, and even a git-yield report that classifies spend by whether the resulting code was kept, reverted, or abandoned. A FastAPI + SSE web dashboard renders it live, and a statusline hook puts current quota (5-hour and weekly windows, context usage) directly into my editor chrome.

The pricing engine sweats the details that make naive trackers wrong: reasoning tokens as a subset of output tokens, tiered cache-write pricing, long-context tiers, and authoritative costs when a tool reports real spend.

Python, uv, FastAPI, SQLite, uPlot + Alpine. Private.