AI Token Analytics
See where your AI
tokens actually go.
Track token usage across Claude Code, Codex, and Open Code.
Beautiful heatmaps, deep analytics, 100% local.

How it works
Three steps. That's it.
Install
One command. Works with npx for a one-off run, or install globally with bun/npm.
Run
tokenleak auto-detects Claude Code, Codex, and Open Code from your local config directories. No setup required.
Get your dashboard
A full terminal dashboard appears — heatmap, streaks, cost, cache hit rate, model breakdown, and more. Export to SVG, PNG, or JSON anytime.
Features
Everything you need to know
about your token spend.
100% Local
Your data never leaves your machine. tokenleak reads local logs only — no APIs, no telemetry, no cloud.
Multi-Provider
Automatically detects Claude Code, Codex, and Open Code. One unified dashboard for all your AI coding tools.
Beautiful Output
Terminal dashboards with ANSI heatmaps, self-contained SVGs, PNG cards, and structured JSON. Dark and light themes.
Deep Analytics
Streaks, rolling windows, peak days, cache economics, day-of-week and hour-of-day breakdowns, session stats, projected monthly burn, and model rankings.
Compare Ranges
Auto-split or pick custom date ranges with --compare. See deltas across tokens, cost, streaks, active days, cache hit rate, and model mix.
Share Anywhere
Copy to clipboard, open in your default app, or upload to GitHub Gist with --upload gist. One command, shared everywhere.
Gallery
Every provider. Every theme.
Claude Code, Codex, and Open Code — all in one view. Switch between dark and light themes, or focus on a single provider.

Compare Mode
See how your usage changed over time.
Split your date range in half automatically, or specify two custom periods. tokenleak computes deltas across every metric — tokens, cost, streaks, cache hit rate, and model mix.
Output: currentPeriod · previousPeriod · deltas
Output Formats
Terminal. SVG. PNG. JSON.
Terminal
- GitHub-style heatmap (░▒▓█)
- Streaks, cache rate, cost panel
- Day-of-week + hour-of-day bars
- Adapts to terminal width
SVG
- Self-contained, no dependencies
- Embeds in READMEs and docs
- Dark and light themes
- Badge variant for streak counts
PNG
- High-resolution via sharp
- 1200×630 wrapped year card
- Perfect for social sharing
- --upload gist in one command
JSON
- Schema-versioned output
- Daily usage per provider
- All aggregated stats
- Pipe into your own tools

Export & Share
One command to share everywhere.
Export your usage as a shareable PNG card, self-contained SVG, or structured JSON — then send it anywhere in one step.
AI Wrapped
Your year in tokens, laid bare.
A 12-slide interactive presentation of your Claude Code & Codex sessions — streaks, peak days, model breakdowns, cache efficiency, and more. Obsidian dark, aged gold. Zero fluff.
01 / 12 · Intro
AI
Wrapped
'25
Providers
All your tools. One view.
Claude Code
~/.claude/projects/*/*.jsonl
Reads JSONL conversation logs. Parses every assistant message with a usage field for input, output, and cache token counts.
Codex
~/.codex/sessions/YYYY/MM/DD/
Reads JSONL session logs. Parses response events for token usage with cumulative delta extraction.
Open Code
~/.local/share/opencode/storage/
Reads from the primary message storage, with SQLite database and legacy JSON session fallback.
Get Started
Up and running in seconds.
Or install globally: bun install -g tokenleak
Get started
Ready to see
your tokens?
No account, no API keys, no data leaving your machine. Just run one command and see exactly where your AI spend is going.
Or install globally with bun install -g tokenleak