Skip to main content
command CX Codex

burn-rate command for Claude Code: 7-day spend trend

burn-rate adds up what you spend on Claude: last week against the week before, plus an average daily figure in USD.

MIT ★ 1,198 updated 2026-10-23

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-analytics@claude-code-agent-monitor-plugins
Open on GitHub

What burn-rate does

The command reads numbers from the local Agent Monitor dashboard and prints a short spend summary. You get three blocks: the past seven days next to the seven before it with a percent change and an up or down arrow, an average daily figure in USD to four decimals with a 30-day projection, and one line per day for the week.

It starts with curl -s http://localhost:4820/api/analytics, which returns a 365-day daily_sessions series. When that series carries no cost, the command pulls curl -s "http://localhost:4820/api/sessions?limit=200" and matches prices to dates itself.

The dashboard has to be running. With nothing listening on localhost:4820 the command asks you to start the server with npm start from the repo root. If dates and costs refuse to line up, it says so in one line instead of inventing daily numbers.

What it helps with

  • see what Claude cost you over the past week
  • compare this week's spend with the week before
  • estimate a monthly figure from the daily average
  • spot the day your spending jumped
  • get a plain per-day breakdown without charts

Example prompts for the agent

  • Run /burn-rate and tell me what I spent over the last 7 days.
  • /burn-rate: compare last week with the one before and give me a 30-day projection.
  • Use /burn-rate to show which day had the biggest jump in spend.

How to install burn-rate

1Plugin marketplace

/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-analytics@claude-code-agent-monitor-plugins

2Manually: put the files in place

.claude/commands/burn-rate.md

Call it with /burn-rate. For all projects use ~/.claude/commands/

Questions about burn-rate

How do I install burn-rate in Claude Code?

Add the marketplace with /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor, then install the plugin: /plugin install ccam-analytics@claude-code-agent-monitor-plugins.

What does burn-rate do?

It works out your spending pace from Agent Monitor data: two weeks side by side, an average daily cost in USD and a 30-day projection. Output stops at those three blocks.

Does the dashboard need to be running?

Yes. The command queries http://localhost:4820/api/analytics, so start the server with npm start from the repo root if it is not up.

Source text

burn-rate.md · MIT
---
description: Compute the recent 7-day spend trend (burn rate) from daily sessions and per-session cost.
argument-hint: ""
---

Estimate the recent daily spend trend (burn rate) for Claude Code usage from the Agent Monitor dashboard.

Fetch analytics, which includes the 365-day daily series and token totals:

```
curl -s http://localhost:4820/api/analytics
```

Use `daily_sessions` (365 days of `{ date, count }`) together with per-session cost to estimate daily spend. If `daily_sessions` does not carry cost directly, fetch the session list to map cost to dates:

```
curl -s "http://localhost:4820/api/sessions?limit=200"
```

Then compute and print:

1. **Last 7 days vs. prior 7 days** — total spend in each window, and the change as a percent with ▲ (up) / ▼ (down).
2. **7-day burn rate** — average daily spend over the last 7 days, as USD to 4 decimal places, plus a simple 30-day projection (`avg_daily × 30`).
3. **Per-day mini-trend** — one line per day for the last 7 days: `<date> — $<spend to 4dp>` with a ▲/▼ vs. the prior day.

Currency as USD to 4 decimal places. Keep it to these three blocks — no long analysis.

If session dates and costs cannot be aligned precisely, state the approximation you made in one line rather than fabricating exact daily figures. If the dashboard is unreachable, tell the user to start it with `npm start` from the repo root.

© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set155

The whole set →

Project sponsors

Companies that keep this analytics open