Skip to content

Back to the catalog

github.comrepo

CodeBurn

CodeBurn is a free, open-source CLI/desktop tool that reads the local session files written by 41 AI coding tools and agents (Claude Code, Cursor, Codex, Gemini, Grok, etc.) to break down token usage and dollar cost by model, project, and task. It adds an 'optimize' scanner that detects waste patterns (re-reads, low read:edit ratios, unused MCP servers, bloated CLAUDE.md files) with auto-applicable fixes, a 'guard' feature for per-session cost caps via Claude Code hooks, and a 'yield' command that correlates spend with actual shipped commits.

TL;DR Local-first CLI/desktop tool that tracks and optimizes AI coding token spend across 41 tools including Claude Code, Cursor, and Codex.
Document

How to use it

Zero-config: it reads session files your tools already write on disk—no account, no API key, no proxy. Requires Node.js 22.13+.

npx codeburn                    # terminal dashboard
npm install -g codeburn         # or: brew install codeburn
codeburn optimize --apply       # review and apply config fixes
codeburn act undo --last        # revert them
codeburn guard install          # Claude Code spend caps (warn $5, stop $15; both editable)
codeburn plan set claude-max    # then codeburn quota for live 5h/weekly limits

Register it as a local MCP server so the agent can query its own spend in-conversation:

claude mcp add codeburn -- npx -y codeburn mcp

That exposes two tools (get_usage, get_savings), makes no network call, and pseudonymizes project names unless asked. Desktop apps exist for macOS (menu bar, signed/notarized), Windows (Microsoft Store or installer; tray app; reads WSL home dirs too), and Linux (GNOME Shell extension). Cross-machine totals via codeburn share --pair / codeburn devices, LAN-only, no cloud. MIT licensed.

What the summary omits that affects trust

Measured vs. estimated is not uniform. Claude Code, Codex, Gemini, Zed, OpenCode and others write real per-call input/output/cache token counts, so their dollar figure is arithmetic on measured tokens at published API rates. Cursor, Kiro and some Copilot sessions record no counts and are estimated from content length—flagged as such in tables. codeburn audit prints per-provider provenance. Prices come from LiteLLM, cached 24h, with bundled fallbacks for common Claude/GPT models; anything unmatched shows as unpriced, not guessed.

On subscriptions the dollars are API-equivalent, not your bill. A flat-fee Max/Pro plan has no per-session price; CodeBurn shows what those tokens would cost at API rates, labeled as such.

History retention has a gap. CodeBurn keeps a durable daily rollup (cost, tokens, per-project/model split) for ten years, so report/status survive Claude Code's 30-day transcript deletion. But per-session detail (sessions, models, spend, compare) lives only in transcripts, so those commands show less for old ranges than report does.

Limits

  • One-shot/retry tracking is file-level only for Claude, Codex and Goose; other tools fall back to tool names, giving a rougher figure. codeburn context works only for Claude Code and Codex.
  • Branch attribution is recorded per-turn by Claude Code "and almost nothing else"—spend from other tools carries no branch.
  • It measures fan-out cost of subagents but explicitly cannot tell you whether one long session would have been cheaper.
  • CLI sends nothing; the desktop/tray app can send anonymous telemetry (bucketed magnitudes plus model/tool/skill/MCP names), defaulting off in EU/EEA/UK/CH and unknown regions, on elsewhere—toggleable in Settings.

Organisations named here

  • AgentSeal
  • Apple
  • Microsoft
  • GitHub
  • Vercel
  • LiteLLM
  • Frankfurter
  • Claude Code
  • Cursor
  • Grok
  • OpenCode

Technologies named here

  • CodeBurn
  • Claude
  • GPT
  • codeburn optimize / codeburn act
  • codeburn guard
  • Opus
  • Sonnet
  • codeburn quota / codeburn plan
  • codeburn context
  • codeburn compare / cohorts mode
  • codeburn yield
  • codeburn share / codeburn devices
  • codeburn mcp
  • Capacity Dock
  • codeburn web
  • GNOME Shell extension
  • Antigravity
  • Claude Code
  • Cline
  • Cline CLI
  • Codebuff
  • Codex
  • CodeWhale
  • Copilot
  • Crush
  • Cursor
  • Cursor Agent
  • DeepSeek Harness
  • Devin
  • Droid
  • Forge
  • Gemini CLI
  • Goose
  • Grok Bot
  • Grok Build
  • Hermes Agent
  • IBM Bob
  • KiloCode
  • Kimi
  • Kimi Code
  • Kiro
  • LingTai TUI
  • Mistral Vibe
  • Mux
  • omp
  • Open Design
  • OpenClaude
  • OpenClaw
  • OpenCode
  • pi
  • Qwen
  • Quick Desktop
  • Warp
  • ZCode
  • Zed
  • Zerostack
  • Vercel AI Gateway
  • MCP
  • Model Context Protocol
  • LiteLLM
  • Gemini

Techniques named here

  • One-shot rate
  • Task categorization
  • Context breakdown
  • Compare periods
  • Cohort comparison
  • Spend by branch
  • Yield correlation
  • Config optimization findings
  • Guard spending caps
  • Work-unit / subagent rollup