A small CLI that visualizes token and cost usage for Charm's Crush CLI — daily/weekly/monthly breakdowns and a per-model distribution, similar in spirit to ccusage.
$ crushusage
Crush usage — Daily
┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Date ┃ Sessions ┃ Input ┃ Output ┃ Total ┃ Cost ┃ ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 2026-07-24 │ 9 │ 253.0k │ 6.3k │ 259.3k │ $0.3713 │ ████░░░░░░░░░░░░░░░░ │
│ 2026-07-25 │ 5 │ 324.6k │ 6.2k │ 330.9k │ $1.1265 │ ██████░░░░░░░░░░░░░░ │
└────────────┴──────────┴────────┴────────┴────────┴──────────┴────────────────────────┘
Crush usage by model
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Model ┃ Share ┃ Cost ┃ ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━┩
│ xai/grok-4.5 │ 68.9% │ $54.8569 │ ██████████████░░░░░░ │
│ opencode-zen/deepseek-v4-flash-free │ 19.1% │ $0.1231 │ ████░░░░░░░░░░░░░░░░ │
└─────────────────────────────────────┴───────┴──────────┴────────────────────────┘
Crush keeps a per-project SQLite database (crush.db) with a sessions table (cumulative prompt_tokens, completion_tokens, cost per session) and a messages table (which model/provider produced each reply). This tool:
- Reads
$XDG_DATA_HOME/crush/projects.jsonto find every project Crush has ever touched, and opens each project'scrush.dbread-only. - For each session, if more than one model was used, splits that session's token/cost totals across the models proportionally to how many assistant replies each model produced in that session.
- Aggregates the result by day/week/month and by model.
Caveat: Crush stores usage per session, not per message. In a session that only ever used one model, the numbers are exact. In a session where you switched models mid-conversation, the split above is an approximation (weighted by reply count) — there's no way around this without Crush itself logging per-call token usage.
uv— the script is a self-containeduv run --scriptfile with inline PEP 723 dependencies (justrich);uvfetches them into an isolated cache on first run.- Crush itself, obviously, with some usage history.
curl -fsSL https://raw.githubusercontent.com/XBoy-352/crush-usage/main/crushusage -o ~/.local/bin/crushusage
chmod +x ~/.local/bin/crushusage(Make sure ~/.local/bin is on your PATH.)
Or just clone the repo and symlink/copy crushusage wherever you like.
crushusage # summary: daily table (last 14 days) + per-model breakdown
crushusage daily [-n N] # daily table, last N days (default 14)
crushusage weekly [-n N] # weekly table, last N weeks (default 8)
crushusage monthly [-n N] # monthly table, last N months (default 6)
crushusage models [-n N] # per-model breakdown only, top N (default 10)
crushusage value --paid N # compare list-price value of usage against what you actually paid
crushusage --model grok # filter to models matching a substring
crushusage --provider hyper # filter to a specific provider (hyper, xai, opencode-zen, ...)
crushusage --project myrepo # filter to projects whose path contains a substring
crushusage --since 2026-07-01 # only usage on/after this date
crushusage --until 2026-07-31 # only usage on/before this date
crushusage --json # dump raw aggregated records as JSONSome providers (e.g. Charm's Hyper) sell a flat-rate subscription against their own
list prices ("$100 of inference for $20/mo"). crushusage value lets you check how
much of that you actually used in a given period, using Crush's own cost tracking
(which already applies each provider's listed per-token rates, cache discounts
included):
crushusage value --provider hyper --paid 20 --since 2026-07-01 --until 2026-07-31This prints the list-price value of what you consumed vs. what you paid, and the resulting multiplier. Note this only tells you what you used against that period's allowance — a multiplier below the advertised ratio just means you didn't use your full allowance, not that the provider is shortchanging you.
On cache tokens: Crush does not persist a cache-read/cache-creation token split
in its local database — it folds cache-creation tokens into the prompt-token count
and only uses cache-read tokens transiently (at call time) to compute cost against
the provider's discounted rate, then discards the raw count. So this tool can't show
a "served from cache" column. It doesn't need to, though: cost (and therefore
value) already nets out whatever cache discount the provider applied.
MIT