llm-tokei
See where your local coding-agent tokens went.
Website: agentic-rs.github.io/llm-tokei
llm-tokei scans the session files already on your machine and turns them into
fast, grouped usage reports: input, output, reasoning, cache tokens, sessions,
turns, and estimated cost.
Why Use It
- One report across agents: Codex CLI, OpenCode, Claude Code, GitHub Copilot Chat, and GitHub Copilot CLI.
- Useful default table: grouped by source and model, with cost columns included.
- Time windows that match how people ask:
--24h,--7d,--1m,--today,--week,--month. - Cost visibility: bundled prices from models.dev plus local overrides for subscriptions, multipliers, and custom rates.
- Table and automation output: readable terminal tables or stable JSON for scripts.
- Replayable transcripts: dump Codex and Copilot sessions into JSONL message streams.
- Safe local reads: parses local files and opens OpenCode's SQLite database read-only.
Install
Or build a local binary:
Quick Examples
# Default report: source x model
# Human-readable numbers for this week
# Last 24 hours by project
# Top expensive sessions in the last 7 days
# Daily trend for the current month
# JSON for scripts
# Show input/output as bytes instead of tokens
# Dump replayable messages
Supported Sources
| Source | Default location |
|---|---|
| Codex CLI | $CODEX_HOME/sessions or ~/.codex/sessions |
| OpenCode | $OPENCODE_DATA_DIR/opencode.db, $XDG_DATA_HOME/opencode/opencode.db, or ~/.local/share/opencode/opencode.db |
| Claude Code | $CLAUDE_HOME/projects or ~/.claude/projects |
| GitHub Copilot Chat | VS Code, Insiders, VSCodium, and Cursor workspaceStorage roots |
| GitHub Copilot CLI | ~/.copilot/session-state |
Use --source and source path flags to narrow or override discovery.
Learn More
Read the full usage guide: docs/usage.md.
The guide covers config defaults, periods, filters, grouping, table fitting,
JSON output, pricing overrides, token semantics, source caveats, caching, and
the dump subcommand.
To regenerate the showcase SVG from real CLI output: