A CLI that analyzes token usage and estimated costs for coding agent tools like Claude Code and Codex from their local data.
junhoyeo/tokscale
A Rust CLI and TUI that tracks token usage and estimated costs across many AI coding agents, with an optional public leaderboard.
- Stars
- 5,720
- Forks
- 465
- Open issues
- 88
- Last commit
- 14 hours ago
What is it?
Tokscale reads the local session data that AI coding agents such as Claude Code, Codex CLI, Gemini CLI, Cursor, OpenCode and many others write to disk, then aggregates token counts and estimated costs by day, week, month, model, client, project and session. Results can be viewed in an interactive terminal dashboard with multiple tabs, in a plain table, or exported as JSON for scripts and other tools.
Costs are computed from LiteLLM's pricing data, with OpenRouter as a fallback, and support tiered pricing and cache token discounts. Users can add custom price overrides for models that upstream databases do not yet cover. Parsing and aggregation run in a native Rust core.
The project also includes a web frontend with a contribution-style graph and a social layer where usage can be submitted to a leaderboard and public profile.
Key features
- 01Interactive terminal UI with views for overview, models, daily, hourly, sessions, projects and agents
- 02Tracks usage from dozens of coding agents, including Claude Code, Codex CLI, Gemini CLI, Cursor and OpenCode
- 03Breaks down input, output, cache read/write and reasoning tokens
- 04Estimates costs from LiteLLM pricing with OpenRouter fallback and custom overrides
- 05Filters by client, date range or year and exports JSON
Use cases
- Checking how much you spend across several AI coding agents each month
- Attributing AI coding costs to specific projects or workspaces
- Feeding usage data into scripts or dashboards through JSON output
- Comparing models and clients to see where tokens are going
Quick start
- 1
Submit your usage data to the leaderboard with bunx
bunx tokscale@latest submit
Things to know
- Some clients have no local usage data, so Freebuff token usage is estimated from transcripts.
- Cursor usage needs desktop auto-login or a pasted cookie, and is read from a cached API copy.
Topics
FAQ
- What is tokscale?
- A Rust CLI and TUI that tracks token usage and estimated costs across many AI coding agents, with an optional public leaderboard. Tokscale reads the local session data that AI coding agents such as Claude Code, Codex CLI, Gemini CLI, Cursor, OpenCode and many others write to disk, then aggregates token counts and estimated costs by day, week, month, model, client, project and session. Results can be viewed in an interactive terminal dashboard with multiple tabs, in a plain table, or exported as JSON for scripts and other tools.
- Is tokscale free to use? What license does it have?
- tokscale is open source under the MIT license. Check the license terms before using it in commercial products.
- Is tokscale still maintained?
- Actively maintained. The last commit to tokscale was on Oct 22, 2026.
- What can I use tokscale for?
- Checking how much you spend across several AI coding agents each month Attributing AI coding costs to specific projects or workspaces Feeding usage data into scripts or dashboards through JSON output Comparing models and clients to see where tokens are going
- How do I install tokscale?
- Submit your usage data to the leaderboard with bunx: bunx tokscale@latest submit
- Where can I get tokscale?
- The source code and installation instructions are on GitHub: https://github.com/junhoyeo/tokscale
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Local CLI and desktop app that breaks down your AI coding token spend and cost by tool, model, project and task.
Local-first tool to browse, search, and track token costs across AI coding agents such as Claude Code and Codex.
Desktop widget that tracks token usage, costs, limits and sessions across 46+ AI coding tools, with optional multi-device sync.
A TypeScript coding agent CLI where a single 'ulw' or 'mass ulw' keyword in your prompt makes it plan, delegate to multiple models, and verify the work.
A stateful agent harness for building AI agents with persistent memory, identity, and skills that learn over time, usable from a CLI, browser, or chat apps.