Free, local tool to track AI coding token usage and cost across 31 tools and agents (Claude Code, Cursor, Codex, Gemini and more), by model, project, and task.
Free, local tool to track AI coding token usage and cost across 31 tools and agents (Claude Code, Cursor, Codex, Gemini and more), by model, project, and task.
See where your AI spend goes.
If CodeBurn shows you something your bill never did, star the repo so other developers find it, and consider sponsoring to keep 41 integrations honest.
|
Desktop |
Webnpx codeburn web
|
Terminalnpx codeburn
|
Menubarcodeburn menubar |
Capacity Dock · macOS menubar and Windows traycodeburn menubar
|
One source of truth: every surface reads the session files already on your disk.
CodeBurn is a free, open-source, local-first tool that tracks AI coding token usage and cost across 41 tools and agents (Claude Code, Cursor, Codex, Gemini, Grok and more), broken down by model, project, and task.
You pay for Claude, Codex, Cursor, and a stack of other AI tools. The bill tells you the total. It never tells you that half of it went to conversation instead of code, or that an expensive model burned your budget on work a cheaper one would have one-shot.
CodeBurn does. It reads the session files your tools already write to disk and breaks down every token and dollar by task, model, tool, and project, across 41 AI tools.
Everything runs locally. No wrapper, no proxy, no API keys, nothing leaves your machine. Pricing comes from LiteLLM, refreshed daily. The optional desktop app can send an anonymous, bucketed usage report if you say yes to it; see Telemetry.
Website · Quick start · Find waste · Apply fixes · Guard · Compare models · Track what shipped · MCP · Supported tools · Commands · Features · How it reads data · Telemetry
Run it instantly, no install needed:
npx codeburnThat opens the interactive dashboard (today by default, or the last 7 days when today has no usage yet). Arrow keys switch periods, q quits. That is the 30-second version. You now know where your AI budget goes.
Install it for a permanent codeburn command:
npm install -g codeburnAlso runs via bunx codeburn or pnpm dlx codeburn, or brew install codeburn on macOS.
Menu bar app for macOS, with your spend always in the menu bar:
codeburn menubarThe same command installs the tray app on Windows; see Windows. On Linux, a GNOME Shell extension gives it in the top panel; see Linux (GNOME).
Requires Node.js 22.13+ and at least one supported tool with session data on disk. For Cursor and OpenCode, better-sqlite3 installs automatically.
codeburn overview # this month, clean tables
codeburn overview --no-color # plain text, ready to paste
codeburn overview --from 2026-06-01 --to 2026-06-15 # any date range
codeburn overview -p all # last 6 months
codeburn overview -p lifetime # full history (uncapped)
codeburn overview --provider claude # one tool onlycodeburn overview prints a copy-pasteable summary of where your AI spend went: totals (cost, tokens, cache hit), a breakdown by tool and by top model, your highest-value days, top projects, a per-day table, and activity and tool usage. Pipe it anywhere (into pbcopy, a PR, Slack, or a tweet); color drops automatically when the output is not a terminal, or pass --no-color.
CodeBurn June 2026
Totals
Cost $2,795.10
Tokens 3.49B in 23.9M / out 20.2M / cache-w 72.5M / cache-r 3.38B
Calls 14,755 sessions 753
Cache hit 99.3%
By tool
┌──────────┬───────────┬────────┬───────┐
│ Tool │ Cost │ Tokens │ Share │
├──────────┼───────────┼────────┼───────┤
│ claude │ $2,662.37 │ 3.34B │ 95% │
│ codex │ $119.12 │ 128.1M │ 4% │
└──────────┴───────────┴────────┴───────┘
(plus Top models, Highest-value days, Top projects, a per-day table, By activity, and Tools)codeburn optimize # scan the last 30 days
codeburn optimize -p today # today only
codeburn optimize -p week # last 7 days
codeburn optimize --provider claude # restrict to one provider
codeburn optimize --format json # setup health + findings as JSONcodeburn optimize scans your sessions and your ~/.claude/ setup for waste patterns:
For Claude Code, the optimize session count, the per-session findings, coaching, and model-default recommendations use user-started (main) sessions. Subagent sidechain transcripts are excluded from that population because their delegated context and delivery behavior are structurally different, and so is the re-read finding, since a subagent starts on a fresh context. Findings about how Claude uses tools (junk reads, read:edit ratio) and every spend, MCP, and configuration-overhead finding keep counting them.
BASH_MAX_OUTPUT_LENGTH, trailing noise)~/.claude/ but never invokedCLAUDE.md files (with @-import expansion counted)git/gh delivery command is observedFindings are grouped into three classes: Fix now (CodeBurn can apply it for you), Habits
(you change how you drive the next session), and FYI (informational, the cost may be justified).
Each one says whether its savings number is measured from provider-counted usage or estimated
from a model. See docs/optimize.md for what is scanned, what --apply may write,
and how to read the health grade.
Each finding shows the estimated token and dollar savings plus a ready-to-paste fix: a CLAUDE.md line, an environment variable, or a mv command to archive unused items. Findings are ranked by urgency (impact weighted against observed waste) and rolled up into an A to F setup health grade. Repeat runs classify each finding as new, improving, or resolved against a 48-hour recent window.
You can also open it inline from the dashboard: press o when a finding count appears in the status bar, b to return.
codeburn optimize --apply # review and apply fixes interactively
codeburn optimize --apply --dry-run # print the plan, change nothing
codeburn optimize --apply --yes # apply every appliable fix without prompting
codeburn act list # every change CodeBurn has made
codeburn act undo --last # roll the most recent change back
codeburn act report # realized vs estimated savings
codeburn optimize --auto-revert # undo the applied fixes that measured no reductioncodeburn optimize finds the waste; --apply fixes the config-class findings for you: settings values, environment variables, archiving unused agents and skills. Every change is backed up and journaled before it lands. codeburn act list shows the history and codeburn act undo <id> restores the original files (it refuses if the files changed since being applied, unless you pass --force).
The loop closes on honesty: once an applied fix is at least 3 days old, codeburn act report compares its estimated savings against what your sessions actually did, and every later codeburn optimize run lists it under Applied fixes with a plain verdict — worked, under its estimate, or did not help, with the undo command for that last case. --auto-revert undoes the ones that did nothing (never CLAUDE.md rules). Estimates get checked against reality, not just claimed.
codeburn guard install # hooks into this project's .claude/settings.json
codeburn guard install --global # or into ~/.claude/settings.json
codeburn guard status # caps, install locations, flagged projects
codeburn guard uninstall # removes cleanly, leaves your own hooks aloneGuard installs opt-in hooks into Claude Code that watch session cost while you work:
codeburn guard allow lifts it for that session only.Caps are edited in ~/.config/codeburn/guard.json (set a value to null to disable it). Add --statusline to show session cost in the Claude Code status line. Installs go through the same journal as everything else, so `
Amp support
Add combined paired-device usage to the GNOME Shell extension
Menubar CLI update runs brew upgrade for npm installs under Homebrew's Node prefix
Epic: quota intelligence (live remaining, burn-rate forecast, pre-flight awareness, invoice reconciliation)
Flatpak install method via FlatPark
Add i18n support: localized CLI output (zh-CN, zh-TW, ja, ko, fr)
doctor: extend probeRoots() beyond 7/42 providers to kill the silent-zero class
gnome: adaptive refresh cadence parity with CLI and macOS menubar
fix: Cursor spend ignores chargedCents and undercounts the dashboard bill
Fix Copilot chatSessions shell-command and prompt extraction