Launch week: use code LAUNCH at checkout for 20% off  ·  First 25 buyers only
Claude Code tool

Branch Cost Report

See which git branches are burning your Claude Code budget. One Python script, zero dependencies, runs against your existing session logs.

Buy — $19 One-time download
No-questions refund if it's not what you expected

The problem

Claude Code bills by token. One number on the invoice. You finish a two-week sprint and have no idea whether the auth refactor cost $8 or $80, or which session blew the budget.

The data is already there. Claude Code writes a JSONL log for every session, and each API call records the token counts and the active git branch. This script reads those logs and turns them into a cost table per branch.

Usage

# All projects, all time
python3 branch-cost-report.py

# Last 7 days
python3 branch-cost-report.py --days 7

# One project
python3 branch-cost-report.py --project /path/to/repo

# Since a date
python3 branch-cost-report.py --since 2026-03-01

# JSON output for scripting
python3 branch-cost-report.py --json

Example output

Scanning /home/user/.claude/projects ...

Branch              Cost   Share  Calls    Input   Output  Sessions
--------------------------------------------------------------------
feature/payments  $12.40  38.2%    423   104.2k    89.1k         3
main              $10.88  33.5%    381    92.4k    78.3k         8
feature/auth       $7.23  22.3%    251    61.0k    52.4k         2
fix/nav-bug        $1.94   6.0%     67    16.3k    14.0k         1
--------------------------------------------------------------------
TOTAL             $32.45  100.0%

What's in the kit

Reading the results

High cost on a feature branch? Check whether that session spawned multiple subagents for simple tasks. Adding Lean Mode to that project cuts 3x token inflation on small fixes.
Most spend on HEAD? Common if you work without feature branches. Cost data is still accurate — you just lose the per-feature breakdown.

Cache tokens are included in the calculation. Cache writes are charged at 1.25x the input rate; cache reads are around 10x cheaper. Long conversations with cold starts account for more of the bill than most people expect.

Pricing reference

Rates the script uses (per million tokens, as of early 2026):

ModelInputOutputCache writeCache read
Claude Opus$15.00$75.00$18.75$1.50
Claude Sonnet$3.00$15.00$3.75$0.30
Claude Haiku$0.25$1.25$0.30$0.03

Requirements

$19
One-time download. Includes script + Claude skill.
Get Branch Cost Report — $19
No-questions refund if it's not what you expected