Track your tokens, feature by feature.
Make sure you track your Return On Token Spend (ROTS).
# every branch. every agent. every machine. posted on the PR.
No database. No SaaS.
Just git refs.
Your agents already log every token to disk. tokenchecker parses those logs, dedupes them, and publishes per-machine totals to custom git refs on origin โ then a hook or Action renders the table on the PR.
your laptop origin (GitHub) PR โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โ claude / codex / โ git push โ refs/token-usage/ โ GitHub Action: โ gemini / cursor logs โ โโโโโโโโโโโบ โ laptop-a1b2c3d4 โ fetch refs/token-usage/* โ โ โ (pre-push โ desktop-e5f6a7b8 โ aggregate head branch โ โผ โ hook runs โ coworker-c9d0e1f2 โ upsert PR comment โ tokenchecker sync โ `sync`) โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
collect
Scans local logs of all four agents, keeps records matching the current repo, and normalizes them into dedupable records under .git/tokenchecker/.
push
Publishes to refs/token-usage/<machine-id> on origin. One ref per machine โ zero conflicts, zero external storage, never double-counts.
hook
A pre-push hook runs sync automatically, so usage data lands on origin together with the branch you're pushing. No CI or repo files required.
comment
The hook (via gh) or the optional tokenchecker@v0 Action upserts a sticky PR comment with per-tool, per-model totals and estimated cost.
Reads the logs your agents already write.
Parsed straight from local session files โ no API keys needed. Branch attribution is exact where recorded, and reconstructed from your HEAD reflog where it isn't.
Claude Code
~/.claude/projects/<project>/*.jsonlPer-message usage blocks. Branch attribution: exact โ gitBranch recorded per message.
Codex CLI
~/.codex/sessions/Y/M/D/*.jsonltoken_count events. Branch attribution: recorded in session metadata.
Gemini CLI
~/.gemini/tmp/<sha256(cwd)>/chats/Per-message tokens. Branch attribution: inferred from HEAD reflog at message time.
Cursor
state.vscdb (bubble records)Per-message tokenCount. Branch attribution: inferred from HEAD reflog at message time.
Paranoid about correctness.
Never double-counts
Every record has a stable id (message / session / bubble). Streaming snapshots, re-collection, and multi-machine overlap all collapse to the max-total record. Idempotent by construction.
Real cost estimates
Four token buckets priced at each model's API list rates โ cache reads counted separately from fresh input (they're billed differently and dominate agent usage). Prices via LiteLLM's community table, a pinned file, or an embedded fallback โ every report says which.
Whole team, every machine
Each machine owns one ref: refs/token-usage/<machine-id>. Laptop, desktop, coworkers โ all aggregate into a single PR comment with a per-machine breakdown.
Zero infrastructure
Single-file, stdlib-only Python 3.9+. Storage is plain git refs on origin. Cleanup is git push origin --delete refs/token-usage/<id>. Nothing else is stored anywhere.
Five verbs. That's the whole tool.
Know what every feature
actually cost.
Two commands. Every repo on your machine. Forever.
๐ค AI token usage for
feature/streaming-tts