Spend monitor for Claude Code

Per-project, per-branch budget caps. Phone alerts before you hit the limit. Kills the process when you blow past it.

$ budgetclaw status

PROJECT      BRANCH          TODAY     WEEK      MONTH
myapp        main            $4.85     $28.30    $142.00
myapp        feature/auth    $1.20     $3.20     $3.20
side-proj    main            $0.00     $0.50     $12.10
TOTAL                        $6.05     $32.00    $157.30

$ budgetclaw limit list

#   PROJECT   BRANCH   PERIOD   CAP       ACTION
1   *         *        daily    $10.00    warn
2   myapp     main     daily    $5.00     kill
3   myapp     main     weekly   $30.00    kill

Never sees your API key. Never reads your prompts. Never touches the network.
Parses the JSONL logs Claude Code already writes to ~/.claude/projects/

How it works

01

Tail the session logs

Claude Code writes every tool call to ~/.claude/projects/*.jsonl. BudgetClaw watches those files with fsnotify.

02

Attribute cost per branch

Each log entry has token counts, model ID, and git branch. BudgetClaw prices them and rolls up to SQLite. Per project, per branch, per day.

03

Evaluate budget rules

TOML config defines daily, weekly, or monthly caps with glob patterns. Most-specific match wins. Two actions: warn or kill.

04

Enforce on breach

SIGTERM the Claude process. Write a lockfile that catches relaunches. Push an alert to your phone via ntfy. Lock auto-expires when the period rolls over.

Per-branch tracking

Every tool call attributed to project + git branch. See which feature branch is burning budget.

Hard budget caps

Daily, weekly, monthly. TOML config with glob patterns for project and branch matching.

Phone push via ntfy

Breach alerts on your phone via ntfy.sh or self-hosted. Kill actions bypass Do Not Disturb.

Single static binary

Go. No cgo, no runtime. One curl, one binary. macOS + Linux, Intel + ARM. 5 MB.

Fully local

No data leaves your machine. No account. SQLite you can query directly. MIT license.

Open source

Full source on GitHub. TOML config you can read. XDG directories you control.

Quick start

# install
curl -fsSL roninforge.org/get | sh

# initialize
budgetclaw init

# set caps
budgetclaw limit set --period daily --cap 10 --action warn
budgetclaw limit set --period daily --cap 25 --action kill

# run
budgetclaw watch