Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
Post image 6
Post image 7
Post image 8
Post image 9
1 / 9
0

I built a Rust replacement for ccusage — 1,742x faster, near-zero overhead

DEV Community·korjwl1·25 days ago
#c6arr4hb
#on#ai#rust#showdev#toki#daemon
Reading 0:00
15s threshold

TL;DR : I built Toki — a Rust daemon that replaces ccusage for Claude Code / Codex token tracking. ~1,742× faster on warm queries, near-zero overhead. Two optional layers sit on top: toki-monitor (macOS menu bar app) and toki-sync (self-hostable sync server). FSL-1.1-Apache-2.0, solo project. The problem: ccusage was making my laptop crawl I'm a Korean dev who burns a lot of tokens in Claude Code and Codex. At my workplace we'd been keeping a half-joking ccusage leaderboard of who was burning the most that week. It was fun — until we wired it into a hook to auto-run on every session, and our laptops started visibly slowing down. Looking at ccusage's design, the cause was clear. Every invocation re-walks ~/.claude and ~/.codex and re-parses every JSONL session file from scratch, single-threaded. The Zig multi-threaded fork that tries to fix this still re-reads every byte and scales memory linearly with input.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More