**Turn your local AI coding agent logs into a stat card you commit to your READM
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
That card is this repository's own, generated by the command below and committed as a file.
It is not a screenshot and not a hosted image — which is the whole point.
One command: it finds your agents, shows your stats and writes the card. --no-publish stops
it there, and that path has no networking code in it at all — no account, no sign-in, nothing
sent. Running it often? npm i -g @tokenchit/cli, then tokenchit generate --no-publish.
Then, if you want to
Proves your handle over GitHub's device flow and puts you on the public
board, with a hosted card that refreshes without a commit. It
sends daily totals by agent and model and your handle — never prompts, replies or file paths
— and tokenchit unpublish takes all of it back.
Dropping --no-publish runs the same thing at the end of generate. At a terminal it names
the board and waits for a y first; a piped or scripted run has nobody to ask, so it
publishes — which is why --no-publish is what this page leads with.
Put it in your README
The card is a file, so the path is relative to the Markdown file you paste this into: ./
beside the card, ../ from a README one directory down. A profile README is its own
repository, so the SVG has to be committed to *that* repo.
Why this one
- **The card is a file, not a URL.** Comparable tools serve cards from a hosted endpoint, so
your README depends on someone else's uptime and rate limits. A committed SVG has none of
that — GitHub serves it directly, and it keeps working if this site goes away.
- **Nothing leaves your machine unless you ask.** init, sync, recap, ledger and
doctor do not import the networking module at all — a test enforces that, rather than a
promise. publish holds the only code that uploads; generate ends by calling it, asking
first at a terminal but not in a script, which is what --no-publish is for. --dry-run
prints the exact bytes.
- **Honest about what it cannot see.** Logs get rotated, prices change, and some models have
no public price. Where a number is incomplete, the tool says so.
What it reads
| agent | source |
| --- | --- |
| **Claude Code** | ~/.claude*/projects/**/*.jsonl — every profile directory, not just the default |
| **Codex** | ~/.codex/sessions/**/rollout-*.jsonl |
| **OpenCode** | ~/.local/share/opencode/opencode.db |
| **Gemini CLI** | ~/.gemini/tmp/*/chats/*.jsonl |
Gemini records token counts only in recent versions, so an installation whose recordings all
predate that is reported as detected-but-uncountable rather than as a confident zero.
Copilot CLI is detected and reported as unsupported: it records only a live context gauge,
never a cumulative total.
**Your numbers will not match Claude Code's Stats panel.** It counts an API call once per
streaming rewrite, so it reads roughly twice as high. sync prints both figures and the gap.
**Equivalent cost is not what you paid** — it is what these tokens would cost at list API
rates. Most agent usage runs under a subscription. See docs/internals.md.
Commands
Moving your history between machines
tokenchit ledger --export writes a portable copy — usage only, no credentials, no
transcripts, no paths. --import previews merging one in and writes nothing until you
add --apply.
The merge is by **session**, not by day, which is the only way to tell two machines' work apart
from one machine's work copied twice: the same session seen twice counts once at its fuller
reading, and different sessions add. History banked before this version carries no session
identity, so it is kept and reported but never added — nothing in an aggregate distinguishes
independent work from a duplicate.
> **Upgrading migrates the ledger, and going back a version is not safe.**