Usage Audit
You cannot manage what no client will show you: cross-client, cross-project token consumption, from the logs already on your disk.
Commands
python3 scripts/usage_audit.py # last 30 days, by model
python3 scripts/usage_audit.py --by project # where tokens go
python3 scripts/usage_audit.py --by client --since 7 # which client burns most
python3 scripts/usage_audit.py --budget-tokens 50000000 || notify # tripwire
python3 scripts/usage_audit.py --json # full report, all groupings
Stores read (read-only, local)
| Client | Source |
|---|---|
| Claude Code | ~/.claude/projects/*/*.jsonl per-message usage blocks |
| Codex | ~/.codex/sessions/**/rollout-*.jsonl final token_count totals |
| OpenCode / OMO | opencode.db session token columns |
Missing stores are skipped silently. Cache tokens are tracked separately from input/output so cached-heavy workflows read honestly.
Pairs with
context-budget (why is per-turn cost high) answers the static question;
usage-audit answers the historical one (where did tokens actually go).
session-handoff shares the same store-reading conventions.