Dev.to•Jan 31, 2026, 2:44 AM
Ai bills skyrocketing? Dev forges rust beast to parse 3gb of claude and gemini logs at 2 gib/s before bankruptcy hits

Ai bills skyrocketing? Dev forges rust beast to parse 3gb of claude and gemini logs at 2 gib/s before bankruptcy hits

A developer, frustrated with high API bills and slow existing tracking tools, created toktrack, a terminal-native token usage tracker that parses AI token logs at 2 GiB/s. The tool supports Claude Code, Codex CLI, and Gemini CLI, handling their different data formats behind a single trait. By utilizing Rust and simd-json, which leverages SIMD instructions for faster JSON parsing, toktrack achieves a 3.2x improvement over sequential parsing. The developer used rayon for parallelization, distributing files across threads to reach a throughput of ~2 GiB/s. Toktrack features a dashboard with four views, including a 52-week heatmap, and stores daily summaries in a cache, allowing for fast warm starts. Available on GitHub, toktrack can be installed via cargo or run using npx, providing a solution for users of these AI CLIs to track their token usage and costs. This innovation showcases the potential of Rust and simd-json for high-performance parsing applications.

Viral Score: 82%

More Roasted Feeds

No news articles yet. Click "Fetch Latest" to get started!