Show and Tell: tokenusage (tu) - fast unified Codex + Claude usage tracker

⚓ Rust    📅 2026-02-28    👤 surdeus    👁️ 1      

surdeus

Hi all - I built tokenusage (tu), a blazing-fast local usage tracker with unified Codex + Claude reporting.

What it focuses on:

  • Speed on large local logs
  • Merged totals/model/cost across providers
  • Multiple views: CLI / TUI / GUI

Implementation summary:

  • Rust-native pipeline
  • parallel file discovery and parsing
  • incremental cache reuse
  • source adapters for Codex/Claude logs
  • merged aggregation for day/week/month outputs

Benchmark method (real local data, Codex-only):

  • Machine: Apple M3 Max, macOS 15.6.1
  • Dataset: ~/.codex/sessions (71 JSONL files, ~537 MB)
  • Date range: 2025-09-01 to 2026-02-28
  • tu 1.1.2 vs @ccusage/codex 18.0.8

Results:

  • Cold: tu 0.19s vs ccusage-codex 6.56s (~34.5x)
  • Warm (avg of 10 runs): tu 0.052s vs ccusage-codex 6.819s (~131.1x)

Install:

cargo install tokenusage --bin tu
npm install -g tokenusage

Links:

Feedback welcome, especially on parsing accuracy and cache strategy.

1 post - 1 participant

Read full topic

🏷️ Rust_feed