Quickstart
Install nothing, run one command, and see your AI coding spend in TallyGraph.
TallyGraph reads the usage history that AI coding agents already keep on your machine (Claude Code, Codex, OpenCode and Pi), turns it into token and cost records, and sends only those numbers, plus the CLI and runtime versions, to your workspace. There is no SDK to add and no proxy to run.
Requirements
- Node.js 22.13 or newer. The CLI reads local SQLite files with
node:sqlite. Check withnode --version. - A TallyGraph account and workspace.
- At least one supported agent used on this machine (see sources).
Three steps
1. Create a write token
Open Connectors in the app and create a token. It is shown once. The command on that page already has it filled in.
2. Run the command
npx --yes tallygraph collect --token tg_xxxxxxxx
It finds the agents installed on this machine, reads their history read-only, and uploads the usage. The last line tells you what happened:
[tallygraph] delivered=1284 rejected=0 retained=0 status=ok
3. Keep it running (optional)
Install it as a background service so new usage keeps arriving every 15 minutes, starting at login:
npx --yes tallygraph service install --token tg_xxxxxxxx
Check it with tallygraph service status and remove it with tallygraph service uninstall.
Supported sources
The CLI looks in these default paths. Nothing is written there.
| Agent | Read from | Override |
|---|---|---|
| Claude Code | ~/.claude/projects | --claude-dir |
| Codex | ~/.codex/sessions | --codex-dir |
| OpenCode | ~/.local/share/opencode/opencode.db | --db |
| Pi | ~/.pi/agent/sessions | --pi-dir |
| claude-tap | ~/.local/share/claude-tap/traces.sqlite3 | --db |
| Cursor, tokscale | an export file you pass in | --file |
Troubleshooting
| You see | What it means | Fix |
|---|---|---|
| No local sources found | None of the default paths exist on this machine. | Use the agent at least once, or point the CLI at its folder with the override flag. |
| Node version error | Node is older than 22.13. | Upgrade Node (nvm install 22, or your package manager). |
| auth failed (401/403) | The token is wrong, revoked or expired. | Create a new token. Rows stay in the local spool and go out on the next run. |
| retries exhausted | The network or the API failed five times. | Run the command again. Nothing was lost. |
| Dashboard still empty | The upload has not landed yet. | Wait a few seconds and reload. Check the last CLI line says status=ok. |
npx tallygraph read. It prints the events as JSON lines and makes no network calls.