tokscale: a high-performance token usage and cost tracker for AI coding agents with a native Rust core
tokscale: a high-performance token usage and cost tracker for AI coding agents with a native Rust core
What it solves
Tokscale provides a centralized way to monitor and analyze token consumption and costs across a wide variety of AI coding agents and IDEs. Instead of checking individual logs or dashboards for every tool used, it aggregates usage data from local files and APIs to give developers a unified view of their AI spend and productivity.
How it works
The tool uses a native Rust core to scan local data directories, session files, and databases (such as SQLite) used by various AI clients. It parses these logs to extract token counts for inputs, outputs, cache reads/writes, and reasoning. To calculate costs, it integrates with LiteLLM's pricing data, providing real-time cost estimates with automatic fallbacks for new models.
Who it’s for
It is designed for developers who use multiple AI coding assistants (like Cursor, Claude Code, GitHub Copilot, and others) and want to track their total token usage, monitor costs, and visualize their AI-assisted development patterns.
Highlights
- Broad Compatibility: Supports over 30 different AI clients, including Cursor, Claude Code, Zed Agent, and GitHub Copilot.
- High Performance: Built with a native Rust core for parallel file scanning and SIMD JSON parsing, making it significantly faster than pure JavaScript implementations.
- Interactive TUI: Features a terminal user interface with multiple views (Overview, Models, Daily, Hourly, Stats, Agents) and a GitHub-style contribution graph.
- Web Visualization: Offers an interactive 2D and 3D contribution graph for visualizing usage over time.
- Cost Tracking: Real-time pricing calculations for various models, including tiered pricing and cache discounts.
- Social Integration: Includes a leaderboard and public profiles for users to share and compare their token usage.
Sources
- undefinedjunhoyeo/tokscale