v0.4.0 Spend history now outlives log cleanup

A mod for Claude Code

Know what every repo
costs you in Claude Code.

repo-spend puts a live bar above the prompt: the repo's running total, today, the last 7 days, and this session's spend and burn rate. No dashboards to open, no exports to run.

  • Runs locally, sends nothing
  • API keys, Pro and Max
  • Terminal and desktop app
The Claude desktop app. Above the message box, a rounded bar reads: my-app, about $1,284.50 in the last 3 months, $12.30 today, $96.75 in the last 7 days; on the right, $4.12 this session, a small green bar chart, and $6.04 an hour.
Figures are illustrative.

Why you'll want it

Claude Code's /cost tells you about one session. repo-spend tells you about the whole repo, and keeps telling you.

Know where your money goes

A running total for each repo, worktrees included, plus today and the last 7 days. You can see which project is actually expensive.

See the value of your plan

On Pro or Max it shows what your usage would have cost at API prices, so you can tell whether the subscription pays for itself. On an API key, it's the credits you've spent.

Catch a runaway session early

A sparkline of the last 30 minutes turns amber, then red, as the pace climbs. You notice the $40-an-hour session while it's happening, not on the invoice.

History that doesn't vanish

Claude Code deletes logs after 30 days by default. repo-spend keeps weekly totals that never roll off, so the number grows instead of resetting every month. It survives /clear too.

Your logs stay on your machine

It reads the session logs Claude Code already keeps and makes no network calls. What it stores is cost figures and token counts, never your conversations.

Costs you nothing to run

Only changed logs are re-read, so rescanning a busy repo takes about 0.1 s. It fits any width and stacks neatly with other mods' bars.

Everything on one line

Every part of the bar answers one question. At narrower widths it drops the least important parts instead of cutting the line off.

โ—† my-app
The repo this session runs in. Worktree sessions count toward the main checkout.
$1,284.50 last 3 months
Every session in the repo, labelled with how far back it really reaches. โ‰ˆ means part of it is estimated from token counts.
$12.30 today ยท $96.75 last 7d
The same total for today and for the past week.
$4.12 this session
The live session's cost, the same figure /cost shows, subagents included.
sparkline
This session's spend in 3-minute slices over the last 30 minutes.
$6.04/hr
The pace over those 30 minutes: grey when idle, green under $15/hr, amber under $40/hr, red above.

Install in under a minute

  1. In a Claude Code terminal session, type this at the prompt:

    /plugin install repo-spend --marketplace aseem-upadhyay/qol-mods
  2. Answer y to add the marketplace, then pick the user scope so the bar shows up in every session.

  3. That's it. It also loads in the desktop app's Code tab. Type /repo-spend any time to hide or show it.

Needs macOS or Linux and python3 3.9 or newer. Windows isn't supported yet.