Tokscale – Track token usage across AI coding agents
Monitor token consumption and costs for multiple AI coding agents from your terminal, with a global leaderboard.
- Source repo
- junhoyeo/tokscale
- Stars
- ★ 5.7k
- Last updated
- today
- License
- MIT
- Primary language
- Rust
- FA score
- 52/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformChatGPT · Codex · Claude Code
- Cost
- Free, no paid service needed
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- A developer wants to monitor their token usage across Claude Code and OpenCode to optimize costs.
- Not a fit if
- Teams that need fully offline operation without reading local session files
- Users unwilling to log in or sync accounts for Cursor, Trae, or Warp integrations
- Users needing official support for clients without public APIs, such as Trae CN
- Source review
- 52/100 · Major gaps 1 safety controls not found
What does this agent do, and when should you use it?
Tokscale is a high-performance CLI tool and visualization dashboard that tracks token usage and costs across a wide range of AI coding agents, including OpenCode, Claude Code, Codex CLI, Cursor IDE, Gemini CLI, and more than 40 others. It reads local session files or databases from these agents, computes costs in real time using LiteLLM pricing data, and presents the information through an interactive TUI, a lightweight table mode, JSON exports, contribution graphs, and task-attributed reports. The tool also offers a social platform where users can submit their usage data to a world leaderboard and create public profiles, along with a web frontend for 2D/3D visualization and a 'Wrapped 2025' annual review feature. The core parsing and aggregation are implemented as a native Rust module for up to 10x faster processing. Tokscale is open-source under the MIT license.
Tokscale scans local storage of supported AI coding agents (e.g., Claude Code, OpenCode, Codex, Gemini CLI) to read session transcripts, databases, or exported CSV files. It parses token counts for input, output, cache read/write, and reasoning, then calculates costs using LiteLLM's pricing data with fallbacks to OpenRouter and Cursor pricing. The CLI provides commands like tokscale (TUI), tokscale --light (table), tokscale models, tokscale monthly, and tokscale --json for export. It also offers pricing for model cost lookup, graph for contribution graph data, report for task-attributed summaries (using external LLMs), usage for subscription quotas, and login/submit/autosubmit for leaderboard submission. For specific integrations, it has cursor login/sync, antigravity sync, trae sync, and warp sync commands. The frontend visualizes data on a web dashboard with a 3D contributions graph.
- A developer wants to monitor their token usage across Claude Code and OpenCode to optimize costs.
- A team lead needs to compare costs between different coding agents and review usage statistics across members.
- A developer wants to submit their usage data to the global leaderboard to compete and create a public profile.
- A user wants to generate a task-attributed report to understand which projects consumed the most tokens.
- A developer prefers a lightweight terminal dashboard without opening a browser to quickly check usage.
- A researcher wants to export detailed usage data in JSON format for further analysis and visualization.
How do you install or deploy this agent?
Quick start: run npx tokscale@latest or bunx tokscale@latest directly without installation. Also works with deno x npm:tokscale@latest. Requires Node.js or Bun. For source installation, clone the repository, run bun install and bun run build:core (Rust toolchain required).
How do you use this agent?
Basic commands: run tokscale to launch the interactive TUI, or tokscale --light for table output. Use tokscale models for model view, tokscale monthly for daily view, and tokscale --json to export JSON. Filter by client with --client opencode, and set date ranges with --since and --until. Look up prices with tokscale pricing "model-name", log in with tokscale login, and submit data with tokscale submit.
What are this agent's strengths and limitations?
- Supports over 40 AI coding agents, covering a wide range of tools.
- Real-time pricing using LiteLLM data with tiered pricing and cache discounts.
- Native Rust core provides ~10x faster processing.
- Multiple interfaces: interactive TUI, lightweight table, and JSON export.
- Social leaderboard feature allows sharing and competition, with public profiles.
- Requires reading local filesystem data from each agent, which may raise privacy and permission concerns.
- Many features (e.g., Cursor, Trae, Warp integrations) require login and sync, adding configuration and network steps.
- Task-attributed reports depend on external LLMs like Apple FM, Claude, or Codex, requiring their installation and authentication.
- Some agents (e.g., Trae CN) are unsupported due to missing official APIs.
- Subscription usage is vendor-reported and may not always be accurate or consistent.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Tokscale – Track token usage across AI coding agents This agent | 52 · Major gaps | CLIFree | ★ 5.7k | today | Rust | ChatGPT · Codex · Claude Code |
| ccxray | 73 · Some gaps | CLIFree + model costs | ★ 296 | 1d ago | JavaScript | Claude Code · Claude API |
| Agent Deck | 76 · Good | CLIFree + model costs | ★ 1.1k | today | Go | Codex · Claude Code |
| senpi | 74 · Some gaps | CLIFree + model costs | ★ 484 | today | TypeScript | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows: CLI tool reads multiple local data sources (e.g., ~/.claude/projects, ~/.codex/sessions) and may upload data to remote leaderboard (submit command). User confirmation mechanism exists (e.g., submit command requires explicit execution), but no least-privilege design (e.g., on-demand reading, sandbox). Data flow transparency: README clearly lists data sources and upload commands, but does not detail post-upload processing. Sensitive data handling: involves API keys (e.g., Cursor login) and local data, but no encryption storage mentioned. Dependency security: uses many dependencies, but no security audit or vulnerability scan evidence. External effects: may upload data to remote server, but no data deletion or revocation mechanism. Rollback: no data rollback or upload revocation feature. Source attribution: author info clear, but publisher unverified.
Evidence shows: project structure clear, README consistent with code, but no test results or CI status. Dependency availability: dependency list complete, but not verified. Failure messages: no error handling or user prompt examples.
Evidence shows: target users are AI developers, scenarios clear (track token usage). Capability boundaries: supports many platforms, but unsupported features not specified. Trigger precision: commands and options clearly defined, but no automation trigger mechanism. Environment fit: supports multiple platforms (Linux, macOS, Windows), but no containerization or virtualization support.
Evidence shows: information architecture clear, README has TOC and detailed instructions. Install notes: multiple installation methods (npx, bunx, deno). Naming stability: version numbers clear, but no naming conventions. Examples and FAQ: many examples, but no FAQ. Known limitations: not explicitly listed. License: MIT license clear. Versioning changelog: no CHANGELOG. Maintenance responsibility: author clear, but no maintenance plan.
Evidence shows: output usability: TUI and JSON output, easy to use. Marginal value: token tracking and leaderboard, unique value. Cost benefit: free and open source, but requires self-deployment.
Evidence shows: claim traceability: README feature descriptions consistent with code, but no test evidence. Cross-source verification: no third-party verification. Fact-inference separation: no clear distinction between facts and inferences.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- This tool reads local sensitive data (e.g., API keys, session logs) and may upload to remote servers; use with caution.
- Publisher identity is unverified; ensure source is trustworthy.
- No data deletion or revocation mechanism; uploads may be irreversible.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
<div align="center"> [](https://github.com/junhoyeo/tokscale) [email protected] is here! </div> What's Changed * [ImgBot] Optimize images by @imgbot[bot] in https://github.com/junhoyeo/tokscale/pull/1452 * fix(copilot): resolve the gh host and key every credential source and the endpoint to it by @kevin9327 in https://github.com/junhoyeo/tokscale/pull/1438 * fix(codex): count usage from compaction turns by @PJunhyuk in https://github.com/junhoyeo/tokscale/pull/1439 …View on GitHub ↗ -
Release notes excerpt
<div align="center"> [](https://github.com/junhoyeo/tokscale) [email protected] is here! </div> What's Changed * feat(frontend): link Discord and X from the website and README by @junhoyeo in https://github.com/junhoyeo/tokscale/pull/1443 * fix(tui): fall back when footer hints do not fit by @junhoyeo in https://github.com/junhoyeo/tokscale/pull/1444 * perf(cache): persist source shards in bounded parallel lanes by @junhoyeo in https://github.com/junhoyeo/tokscale/pull/1446 …View on GitHub ↗ -
Release notes excerpt
<div align="center"> [](https://github.com/junhoyeo/tokscale) [email protected] is here! </div> What's Changed * fix(pricing): map Claude 5.5 reasoning tiers and aliases to canonical models by @azestkingscrown in https://github.com/junhoyeo/tokscale/pull/1425 * fix(cline): clamp residual input tokens before aggregation by @xujiantop-crypto in https://github.com/junhoyeo/tokscale/pull/1399 …View on GitHub ↗