Screenshots
Install
cargo (crates.io)
npm
pip (PyPI)
cargo-binstall (prebuilt binary)
Quick Start
# Daily report (default)
# Source-specific
# Date filter
# Weekly / monthly
# Live monitor (tabs: Codex / Claude / Antigravity)
# Real-time per-session viewer (htop for tokens)
# GUI dashboard
# Share image card (for social posting)
Why tokenusage
- Faster feedback loop: native Rust + parallel scan/parsing + incremental cache.
- One dashboard for Codex, Claude, and Antigravity, with merged totals and per-model breakdown.
- Share-ready image card (
tu img) for posting your token/cost trend. - Works in terminal and desktop GUI without sending your logs to a cloud service.
FAQ
Where does the data come from?
From local log directories and IDE probes:
- Claude:
~/.config/claude/projects,~/.claude/projects - Codex:
~/.codex/sessions,~/.config/codex/sessions - Antigravity: probed from running IDE language server (no log files needed)
You can override with --claude-projects-dir and --codex-sessions-dir.
How is cost estimated?
tu uses OpenRouter pricing when available, caches it for 6 hours, and falls back to built-in offline rates when network pricing is unavailable.
Is my data private?
Yes for usage logs: parsing is local. tu only requests pricing metadata unless you run --offline.
Benchmark Details
Setup:
- Machine: Apple M3 Max, macOS 15.6.1
tuversion:1.2.6·ccusageversion:18.0.8·@ccusage/codexversion:18.0.8- Default mode (no date filters, online pricing, network enabled)
Codex — 91 JSONL files, 1.7 GB (~/.codex/sessions)
tu codex |
bunx @ccusage/codex |
Speedup | |
|---|---|---|---|
| Cold (rebuild cache) | 0.92s | 20.76s | 22.6x |
| Warm (best of 5 / avg of 3) | 0.15s | 20.76s | 138x |
Claude — 1 521 JSONL files, 2.2 GB (~/.claude/projects)
tu claude |
bunx ccusage |
Speedup | |
|---|---|---|---|
| Cold (rebuild cache) | 0.73s | 17.15s | 23.5x |
| Warm (best of 5 / avg of 3) | 0.08s | 17.15s | 214x |
Results vary by hardware, filesystem cache state, and log volume.
Command Overview
tu [daily|codex|claude|antigravity|monthly|weekly|img|session|blocks|live|statusline|gui]
Useful commands:
tu daily --tuitu daily --jsontu daily --jq '.rows[0]'tu blocks --activetu blocks --livetu livetu img --output tokenusage-share.png(today, hourly)tu img --period weekly --output tokenusage-week.png(7 days, daily)tu img --logo ./logo.png --brand-url tokenusage.devtu statusline
Config File
Config search order:
./.tu/tu.json~/.config/tu/tu.json~/.config/tokenusage/tokenusage.json
Use an explicit config file:
Example:
Pricing
Offline-only mode:
Demo Dataset (No Real Data)
Development
License
MIT. See LICENSE.