- 月底要跟财务或团队解释 AI 编码账单:它按项目、模型、任务三个维度拆,比在厂商后台按天看总额更能定位到具体哪类工作在烧钱。自己写脚本解析各工具会话格式,光 Claude Code 和 Codex 的目录结构差异就够折腾半天。
- 多工具混用(Claude Code + Cursor + Codex 同时开):单一厂商的用量页只覆盖自家产品,跨工具汇总只能靠这类本地聚合器。
- 想找出浪费模式:optimize 子命令针对重复读文件、闲置 MCP 这类具体行为给估算,属于事后审计,不是实时拦截。
- 让 agent 在对话里直接回答“这个任务花了多少”:走它的 MCP server,省得切终端。
codeburn
getagentsealMIT活跃维护 有专家点评本地免费统计 Claude Code、Cursor、Codex 等 37 种 AI 编码工具的 token 用量和花费,按模型、项目、任务拆分,帮你看清钱花在哪。
Free, local tool to track AI coding token usage and cost across 37 tools and agents (Claude Code, Cursor, Codex, Gemini and more), by model, project, and task. npx codeburn
专家点评
上手难度:入门更新于 2026-11-11本地读会话文件,把 AI 编码花费按模型/项目/任务拆开,替代自己写脚本扒 JSONL
适用场景
踩坑
- 覆盖面是卖点也是坑:issue 里反复出现 Copilot(IntelliJ、copilot-cli)支持请求,说明 37 个工具的清单里各家深度不一,你主力用的工具很可能只做到“能读个大概”。上之前先确认自己那套工具在支持列表里的实际粒度。
- 订阅制用户会撞上口径问题:issue 里有 Subscription vs API Use 的讨论,以及 macOS menubar 读不到 Claude Team 订阅额度。如果你走的是团队订阅而非 API 计费,金额数字未必对得上你实际付的钱,别直接拿去报销。
- optimize --apply 会改配置文件,guard 会往 Claude Code 注入 hooks。这两个是唯一会写你环境的路径,README 说会备份,但备份不等于可回滚的语义,先跑只读模式看输出再决定。
- Node.js 22.15+ 是硬门槛,低于这个版本直接起不来,CI 或老开发机上的 Node 版本要先确认。
同类对比
如果只要 Claude Code 单工具的用量,官方 /cost 和厂商后台够用,不必引入第三方;如果要的是跨团队的集中式可观测性而非单机本地统计,这类本地读文件的工具不是那个位置。
npx codeburn
npm install -g codeburnREADME 未说明显存或 GPU 要求;需要 Node.js 22.15+,桌面端支持 macOS(Apple Silicon/Intel)、Windows 与 Linux。
项目说明
由 README 自动翻译提炼本地读取各 AI 编码工具的会话文件,按模型、项目、任务拆解 token 用量与花费
本地免费统计 Claude Code、Cursor、Codex 等 37 种 AI 编码工具的 token 用量和花费,按模型、项目、任务拆分,帮你看清钱花在哪。
核心能力
- 读取 Claude Code、Cursor、Codex 等工具已写入磁盘的会话文件
- 按工具、模型、项目、任务四个维度拆解成本
- 用 codeburn optimize 找出重复读文件、闲置 MCP 等浪费并估算节省
- 用 codeburn quota 读取已登录工具的实时额度窗口
- 通过 MCP 服务器让 agent 在对话内回答花费问题
容易踩的坑
需 Node.js 22.15+,版本过低无法运行;optimize --apply 会改动配置文件,虽会先备份但需先审阅;guard 为可选安装,会向 Claude Code 注入 hooks,需用 guard uninstall 移除。
- desktop-v0.9.28CodeBurn Desktop 0.9.282026-11-08 · 2026-11-08 02:28 UTC
查看更新说明
0.9.28 - 2026-11-07
Added
-
The macOS menu bar forecasts when a quota window runs out. The forecast uses the pace of the last hour on short windows and the last six hours on long ones, waits for two readings ten minutes apart, and covers the five-hour window too. It shows as "· out 15:40" in the second row and under the heatmap, or "lasts until reset" when the pace reaches the reset first. When the forecast lands before the reset, a second alert fires once per cycle, and the 80% alert threshold is now a picker with 70, 80 and 90.
-
The guard stops loops while they run. An identical tool call repeated 4 times in a row gets a warning and the 8th is denied; a shell command that failed 3 times in the session gets a warning and the 5th try is denied. The reason names the call, the count and the session cost so far, and the end-of-session note says what the calls after the first warning cost. The four limits are in the guard settings (
nullturns one off),codeburn guard statusprints them, andcodeburn guard allowlifts the stops for the session. -
Three new Optimize findings for premium spend.
one-hour-cache-unusedprices one-hour prompt-cache writes that no pause over five minutes ever needed.fast-mode-backgroundprices fast mode on subagent calls, where nobody waits for the speed.long-context-premiumprices prompts that crossed a model's long-context tier, with the threshold read from the price data. -
Sessions show their cache hit rate. A Cache column in
codeburn sessions, the interactive table and the desktop Sessions page (sortable), andcacheHitPercenton each--format jsonrow. Every view now uses one formula, cache reads over input plus reads plus writes, so the session drawer, Compare and the menu bar can read lower than before where cache writes are large. A session with no cache data shows a dash, not 0%. -
Exports say where every dollar comes from. Each call carries
costBasis:recorded(the tool's own bill),calculated(tokens at list price),estimated(the calls the~marks),included(subscription usage at $0) orunpriced. Sessions, days and the menu bar's current period carry the recorded, calculated and estimated shares of their cost. It appears incodeburn export(JSON and a CSV column),sessions --format json, the menu bar JSON and the MCPget_usagetotals. -
A one-time GitHub star request on desktop, menu bar and Windows tray. From the third launch or popover open, a small prompt asks for a star with Star on GitHub and Not now; either button ends it for good. On the menu bar and the tray it replaces the star strip that showed from the first launch, and anyone who closed that strip is not asked again.
-
CodeBurn as a Claude Code plugin.
/plugin install codeburn --marketplace getagentseal/codeburnadds the MCP server (get_usage,get_savings) and a/codeburn:costskill that summarizes today's spend. The plugin pins the CodeBurn version it runs and links the privacy page, which the README now links too. The server is also listed in the official MCP Registry asio.github.getagentseal/codeburn. -
codeburn webworks behind an authenticating reverse proxy.--hostsets the listen address and--allowed-host(repeatable) admits exact hostnames in theHostandOriginheaders. Without the flags nothing changes, and any other host still gets a 403. The dashboard has no login of its own, so keep the port reachable only from the proxy. Thanks @MarcelRoozekrans. -
The desktop session view has three screens. Inspect shows a prompt as request cards with an insights strip, Agents shows each subagent's lifecycle and cost, and Story tells a prompt in plain sentences.
-
Claude usage is split by the account that was active. A machine that switches between a personal and a team organization stops reading as one blended total, and the macOS menu bar shows one row per account once two have been seen.
-
**Contracted-rat
-
- windows-v0.9.28Windows Menubar v0.9.282026-11-08 · 2026-11-08 02:00 UTC
查看更新说明
Download the
.msibelow and run it. The tray app reads everything through the CodeBurn CLI, so install that first:npm install -g codeburnRequires codeburn 0.9.9 or newer and the WebView2 Runtime (preinstalled on Windows 11 and recent Windows 10 updates; installed on demand otherwise).
The bundle is unsigned, so Windows SmartScreen warns on first run: click "More info", then "Run anyway". Signing is planned.
This
.msiis a developer preview. The recommended install is the Microsoft Store (https://apps.microsoft.com/detail/9P0R4ZL5XMB8), which is signed and updates itself. Previews built with the updater key install newer previews from the tray in one click, after checking their signature. Older previews link to the release instead: take it by re-runningcodeburn menubar --forceor downloading the new.msihere. - mac-v0.9.28Menubar v0.9.282026-11-08 · 2026-11-08 01:57 UTC
查看更新说明
Install with:
npm install -g codeburn codeburn menubarThat command drops the app into
~/Applications, records the persistentcodeburnCLI path used by the menubar, verifies the checksum and the AgentSeal Developer ID signature, and launches it. The app is notarized, so the zip from this page also opens directly. - v0.9.28最新正式版2026-11-08 · 2026-11-08 01:40 UTC
0.9.28 - 2026-11-07
Added
-
The macOS menu bar forecasts when a quota window runs out. The forecast uses the pace of the last hour on short windows and the last six hours on long ones, waits for two readings ten minutes apart, and covers the five-hour window too. It shows as "· out 15:40" in the second row and under the heatmap, or "lasts until reset" when the pace reaches the reset first. When the forecast lands before the reset, a second alert fires once per cycle, and the 80% alert threshold is now a picker with 70, 80 and 90.
-
The guard stops loops while they run. An identical tool call repeated 4 times in a row gets a warning and the 8th is denied; a shell command that failed 3 times in the session gets a warning and the 5th try is denied. The reason names the call, the count and the session cost so far, and the end-of-session note says what the calls after the first warning cost. The four limits are in the guard settings (
nullturns one off),codeburn guard statusprints them, andcodeburn guard allowlifts the stops for the session. -
Three new Optimize findings for premium spend.
one-hour-cache-unusedprices one-hour prompt-cache writes that no pause over five minutes ever needed.fast-mode-backgroundprices fast mode on subagent calls, where nobody waits for the speed.long-context-premiumprices prompts that crossed a model's long-context tier, with the threshold read from the price data. -
Sessions show their cache hit rate. A Cache column in
codeburn sessions, the interactive table and the desktop Sessions page (sortable), andcacheHitPercenton each--format jsonrow. Every view now uses one formula, cache reads over input plus reads plus writes, so the session drawer, Compare and the menu bar can read lower than before where cache writes are large. A session with no cache data shows a dash, not 0%. -
Exports say where every dollar comes from. Each call carries
costBasis:recorded(the tool's own bill),calculated(tokens at list price),estimated(the calls the~marks),included(subscription usage at $0) orunpriced. Sessions, days and the menu bar's current period carry the recorded, calculated and estimated shares of their cost. It appears incodeburn export(JSON and a CSV column),sessions --format json, the menu bar JSON and the MCPget_usagetotals. -
A one-time GitHub star request on desktop, menu bar and Windows tray. From the third launch or popover open, a small prompt asks for a star with Star on GitHub and Not now; either button ends it for good. On the menu bar and the tray it replaces the star strip that showed from the first launch, and anyone who closed that strip is not asked again.
-
CodeBurn as a Claude Code plugin.
/plugin install codeburn --marketplace getagentseal/codeburnadds the MCP server (get_usage,get_savings) and a/codeburn:costskill that summarizes today's spend. The plugin pins the CodeBurn version it runs and links the privacy page, which the README now links too. The server is also listed in the official MCP Registry asio.github.getagentseal/codeburn. -
codeburn webworks behind an authenticating reverse proxy.--hostsets the listen address and--allowed-host(repeatable) admits exact hostnames in theHostandOriginheaders. Without the flags nothing changes, and any other host still gets a 403. The dashboard has no login of its own, so keep the port reachable only from the proxy. Thanks @MarcelRoozekrans. -
The desktop session view has three screens. Inspect shows a prompt as request cards with an insights strip, Agents shows each subagent's lifecycle and cost, and Story tells a prompt in plain sentences.
-
Claude usage is split by the account that was active. A machine that switches between a personal and a team organization stops reading as one blended total, and the macOS menu bar shows one row per account once two have been seen.
-
**Contracted-rate discounts, o
-
- desktop-v0.9.27CodeBurn Desktop 0.9.272026-10-11 · 2026-10-11 08:19 UTC
查看更新说明
0.9.27
One click updates every installed surface: the CLI, the menu bar app and the desktop app, with no Terminal. New installs always get the latest version.
Added
- One-click updates on every surface.
codeburn updateupdates the CLI, the menu bar app and the desktop app in one go.--checklists what is out of date, and--jsongives a stable result for scripts. (#1740) - The desktop app updates itself and its companions. Click Update: it downloads and restarts on its own, and after the restart the CLI and the menu bar follow. Replacing the app by hand does the same. (#1741)
- The menu bar update pill updates everything through
codeburn update, and checks every 6 hours. (#1742) - The Windows tray updates the CLI through
codeburn update, for Store and installer installs. (#1743) - Download links always point at the latest release. (#1740)
Fixed
- A menu bar download could crash the desktop app's update when the server closed the connection mid-download. (#1745)
- Releases publish npm first, so an update never points at a CLI version npm does not serve yet. (#1740)
- One-click updates on every surface.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
The problem
Your bill gives you a month total. It does not break that down by project, by model or by task, and it does not show which part of it was wasted.
Claude Code, Codex, Cursor and the rest each write a session file every time you use them, and those files hold every token and every model call. CodeBurn reads those files and produces the breakdown.
Sixty seconds
npx codeburn
There is no account and no sign-up. CodeBurn looks in the folders your tools already write to, prices every token, and prints what you spent.
Under the total are the tables: cost by tool, by model, by project and by task. Task means what the agent was doing, such as coding, debugging or planning, worked out from the session itself.
Arrow keys move the period, from today out to your whole history. Press p to switch between tools. Press q to quit.
See it
The desktop app is the same data with room to move around in. It opens on today: what you have spent, what the month is on pace to cost, and the last thirty days day by day.
One click from the clock, the menu bar popover shows the short version of that page. The Capacity Dock adds a ring per provider at the screen edge. Hover a ring and a glance card tells you what is running right now and which limits are filling up.
All four read the same files on your disk, so they show the same numbers, allowing for when each one last refreshed.
The same numbers are in your browser with codeburn web, and in the terminal with codeburn.
Understand it
Every number in the app is clickable. Click today's total and you land on Sessions, one row per session with its project, its model, its tokens and its cost. Click a row and you get the turns inside it, so you can see which part of the work was expensive.
On the Spend page the same money is cut four ways, by project, by git branch, by model and by task. The branch view adds up every session you ran while you were on that branch, so you get the cost of a feature.
Compare periods puts two date ranges side by side and shows the difference. Use it after you change something, a model or a workflow or a prompt, to find out whether the change actually cost less.
The Pull requests page matches spend against the pull requests your sessions recorded, so you can see which spend shipped (Yield).
Fix it
codeburn optimize
Optimize reads your sessions and your config, then lists what costs tokens without earning them. A file the agent re-reads on every turn. An MCP server you installed months ago and never call. A CLAUDE.md that grew long enough to ride along in every single request.
Each finding comes with a grade, the fix, and what that fix should save you over the period it scanned.
CodeBurn can make the config changes for you, and take them back:
codeburn optimize --apply # review and apply
codeburn act undo --last # put it back
Files are backed up before they are changed, and you see the change before anything is applied. A few days later, codeburn act report checks what each fix promised against what your sessions actually did, including the fixes that changed nothing.
Stay ahead
codeburn plan set claude-max # the plan you pay for
codeburn quota # how much of it is left
codeburn guard install # spending caps for Claude Code
Tell CodeBurn which subscription you pay for and it stops showing only what you spent. It shows how much of the plan you have used, and whether the month is on pace to run past it.
codeburn quota reads the live limits out of the tools you are already signed in to. That is where the five-hour and weekly windows come from. Check it before a long run.
Guard is opt-in and local. codeburn guard install adds Claude Code hooks that warn a session once it passes $5 and stop it at $15, and do the same for a tool call stuck in a loop or a failing command retried over and over. All the limits are yours to change, codeburn guard status shows where the hooks live, and codeburn guard uninstall takes them out again.
Always in view
Today's spend sits in the macOS menu bar, beside the clock. Click it and the popover opens on the same figures as the app, with today, the period switcher, the trend and the per-model breakdown.
The Capacity Dock docks a thin rail to any edge of your screen, with one ring per provider showing how much of that plan is left. It shows what is left before you start a run, not after.
Turn either on from the desktop app's Plugins page in one click, or from the command line:
codeburn menubar
On Linux the same view lives in the top panel, as a GNOME Shell extension.
The desktop app runs on Windows. Install it from the Microsoft Store, which is the recommended way and keeps itself up to date, or take the direct installer. The Windows tray app shows today's cost next to the clock, the same way the macOS menu bar does, and clicking it opens the same popover. The Capacity Dock is there too, from the tray menu or the app's Plugins page. If you run your agents inside WSL, CodeBurn reads the distro's home directory as well as your Windows profile, so sessions you ran in Linux are counted without you installing anything twice.
Setup for all three platforms, including WSL, is in Menu bar and tray.
Inside your agent
In Claude Code, install the plugin. It sets up the MCP server below and adds /codeburn:cost, which summarizes today's spend:
/plugin install codeburn --marketplace getagentseal/codeburn
Or register only the MCP server:
claude mcp add codeburn -- npx -y codeburn mcp
That registers a local MCP server over stdio. Your agent can then answer "where did my tokens go this week" or "what should I change to spend less" without you leaving the conversation.
It reads the same files on disk that the CLI reads. The server answers from that local data and makes no network call of its own, and project names are pseudonymized unless the agent asks for them.
Works with 42 tools
CodeBurn detects the tools you already use. There is nothing to configure and no folder to point it at. If a tool is installed and has sessions on disk, it shows up. Each logo links to that tool's page.
Each page lists where that tool keeps its data, the format it uses, and the quirks CodeBurn works around.
Amp · Antigravity · Claude Code · Cline · Cline CLI · Codebuff · Codex · CodeWhale · Command Code · 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
CodeBurn also reads the Vercel AI Gateway reporting API, which is a gateway rather than a tool, so its spend is shown on its own row and left out of your totals by default.
If several of these have sessions on disk, press p in the dashboard to move between them. A path that has changed is worth an issue. Adding a tool is a single file: see src/providers/codex.ts.
Private by design
CodeBurn reads files that are already on your disk. There is no account, no API key and no proxy in front of your agent.
Your prompts, your code and your project names stay on your computer. CodeBurn does not sit between you and your agent, so if it stopped working tomorrow your tools would not notice.
Prices come from LiteLLM and refresh once a day.
Everything that does leave your machine is listed in Privacy.
Built in the open
MIT licensed. Development happens in this repo.
The manual
| Page | What is in it |
|---|---|
| Commands | Every command, every flag, every keyboard shortcut |
| How it works | Pricing, task categories, and where each tool keeps its data |
| Optimize | What is scanned, what --apply writes, how to read the grade |
| Menu bar and tray | macOS, Windows (including WSL), and the Linux GNOME extension |
| VS Code extension | Status bar, summary and dashboard in VS Code, Cursor, Windsurf, Antigravity and VSCodium |
| Plans and quota | Subscription tracking and live provider limits |
| Guard | Budget caps for Claude Code |
| Web dashboard | The browser view, and combining usage across your devices |
| Yield | Which spend actually shipped, correlated against git |
| MCP | The local MCP server and its two tools |
| Configuration | Currency, model aliases, price overrides, environment variables |
| Tools | One page per tool: data location, format, known quirks |
| All docs | The full index |
Questions
My spend
Run codeburn optimize. It reads the last 30 days of sessions and your ~/.claude/ config, lists what cost tokens without earning them, and prints a Potential savings line in tokens and dollars for the period it scanned. Findings come in three groups: Fix now, which CodeBurn can apply for you, Habits, which is how you drive the next session, and FYI, which may well be money well spent. Each finding says whether its number is measured from your own token counts or modelled from an average. The setup gets a grade from A to F, and that grade rates the config, not the spending, so an expensive month with a clean setup still scores an A. See Optimize.
The desktop Overview and the terminal dashboard both list the five most expensive sessions. Click one in the app and you land on Sessions with the drawer open on it: project, models, tokens, and the per-model, per-category, per-branch and per-day split of that one session. codeburn sessions is the same list in the terminal. codeburn optimize flags sessions that cost more than twice their own project's average. The drawer usually shows the cause, such as one model doing most of the work or one category taking most of the turns. See Drill-through.
Open that session in the Sessions drawer for the per-turn cost, then run codeburn context and pick it from the list. codeburn context prints what filled the context window: assistant split into text, reasoning and tool calls with a row per tool, user split into text, images and compaction summaries, and tool with the tool-result total, which is usually the biggest line. It also counts how many compactions happened, which is the usual sign of an hour spent re-reading. The block sizes are estimated from character counts. The exact context figure comes from the last call's reported usage, and the output labels it as such.
Run codeburn compare, or press c in the dashboard, to put two models side by side on your own history: one-shot rate, retry rate, self-correction, cost per call, cost per edit, cache hit rate. Cohorts mode narrows that to the same kind of work, one row per edit turn, with median and P90 cost per edit turn and the sample list you can read yourself. Turns that mixed two models are excluded and counted, never assigned to one. codeburn optimize goes further and prints a Model defaults recommendation when a project has enough edit turns to judge: a cheaper model you already used there whose one-shot rate held up, applied with codeburn act apply-model <project>. See Cohort comparison.
Open the Spend page and pick a project in the By branch panel. Each branch row shows its cost, calls, tokens, distinct sessions and activity window, attributed turn by turn, so a session that switched branches lands on both rows with its own slice instead of counting twice. From the terminal the same report is codeburn spend --format branch-json. Branch is recorded per turn by Claude Code and by almost nothing else, so the coverage note under the rows splits the project three ways: spend on named branches, spend before a branch was recorded, and spend from tools that carry no branch at all. See Spend by branch.
codeburn sessions --by-work-unit gives one row per orchestration root with its delegated children folded underneath, so the parent and its fan-out read as one number. codeburn models --by-agent splits each model's spend by the Claude subagent that drove it, with main sessions and other tools bucketed under main. The dashboard has a Claude Agent Types panel with calls and cost per agent type, and Delegation is one of the task categories. CodeBurn tells you what the fan-out cost. Whether the same work would have been cheaper in one long session is not something it can measure.
The app has a Pull requests page, and codeburn sessions --by-pr is the same report in the terminal. It groups spend by the PR links your sessions recorded, and expanding a row takes you to the sessions behind it. Turns that touched more than one PR contribute their share to each, so the rows are not an exclusive split, and spend tied to no PR is labeled rather than hidden. The links come from what the session wrote down, so CodeBurn never calls GitHub and never checks whether the PR merged. For that part, codeburn yield correlates sessions with commits and sorts the spend into productive, reverted and abandoned, and the Overview's Cost per outcome panel shows cost per commit and cost per productive session. See Yield.
Subscriptions and limits
The dollar figure is what your tokens would have cost at API rates. It is not an invoice. The card labels it API-equivalent, not a live provider window. It is still the only per-session, per-project, per-model number you can get on a subscription, because a subscription gives you one price and no breakdown. Run codeburn plan set claude-max and the Plans page then shows what you have spent this cycle as a share of the plan, and whether you are on track or on pace to exceed it. See Plans and quota.
codeburn quota asks each provider how much of your plan is left, signing the request with the credential that tool already stores on your machine. For Claude that is a 5-hour row and a weekly row, each with a percentage used and a reset time, shown as 42% used · resets in 3h 20m on the Plans page's Live quota panel. The Capacity Dock carries the same reading, and the macOS menu bar can carry a second line with quota remaining and its countdown. CodeBurn does not predict the hour you will run out. What you get is how full the window is and when it clears.
Set what you pay for with codeburn plan set claude-max, or claude-pro, cursor-pro, copilot-pro, google-ai-pro, or custom --monthly-usd 200 --provider codex. The Plans page then shows spend this cycle against that budget with a pacing line, either On track or on pace to exceed with the projected figure and the date. After two or three cycles the pattern is clear. Consistently under a quarter of the plan means you are buying capacity you do not use, and consistently over means the cheaper plan is costing you. CodeBurn shows the share and the pace, and leaves the choice of plan to you.
Plans are stored per provider, so codeburn plan set claude-max, codeburn plan set cursor-pro and a custom Codex plan sit side by side rather than blending into one figure. codeburn plan prints them all, and the app carries one card per active plan with its own spent, percentage and overage. The spend tables stay per tool underneath, so you can see which subscription is carrying the work and which one is idle. Copilot is tracked in AI credits rather than dollars, because credits are what Copilot actually meters.
How my agent works
codeburn optimize has a detector for exactly this, reported as "Claude is re-reading the same files" with the files and what the re-reads cost. Next to it sit reads into node_modules, .git and dist, and sessions that edit far more than they read first. Those two are the ones a written rule can fix: codeburn optimize --apply appends a marker block to the current project's CLAUDE.md, shows you the file before it writes, and backs it up under ~/.config/codeburn/actions/. codeburn act undo --last puts it back. The re-read finding itself has no file to edit, so the fix there is how you open the next session.
Run codeburn context and pick a session. It works for Claude Code and Codex, and gives you a tree: assistant split into text, reasoning and tool calls with a row per tool, user split into text, images, compaction summaries and meta, then tool with the tool-result line, and system. The headline shows the exact context size from the last call's usage next to the model's window. The tree counts tokens rather than dollars, because that context is re-sent every turn and its price depends on how much of it came from cache. For the dollars over a period, codeburn models prices the same sessions.
codeburn optimize compares what is configured against what was actually invoked. It names MCP servers configured but never called, servers with many tools and almost none used, and skills, agents and slash commands that are defined and never invoked. An MCP server's tool schemas ride along in the prompt whether you call it or not, so an unused one costs tokens on every turn. codeburn optimize --apply removes the server entry from ~/.claude.json or the project's .mcp.json, and moves unused skills into ~/.claude/skills/.archived/ rather than deleting them.
The one-shot rate. It is the One-shot figure on the app's Overview, a column in the dashboard's activity table, and a per-model row in codeburn compare. A retry is counted when the same file is edited again after a shell command ran in between, which is the shape of an edit that did not work. Editing a different file after a shell step is not a retry. Coding at 90% means nine edit turns in ten needed no second pass. File-level tracking works for Claude, Codex and Goose. Other tools fall back to tool names, so their figure is rougher. See How it works.
From the tools the session used and the words in your own messages, with no model call anywhere. Edit and Write make it Coding. Error and fix words alongside tool use make it Debugging. pytest or vitest in a shell command makes it Testing. Read and Grep with no edits make it Exploration, and the Agent tool makes it Delegation. There are 13 categories and the rules are deterministic, so the same session always lands in the same category. The full table is in How it works.
Trust the numbers
The tokens are measured for most tools. Claude Code, Codex, Gemini, Zed, OpenCode and others write real per-call input, output and cache counts into their own session files, and CodeBurn reads those rather than guessing. The price applied to them is published API pricing, so the dollar figure is arithmetic on measured tokens, not a guess about your bill. A few tools record no counts at all, so Cursor, Kiro and some Copilot sessions are estimated from content length, and those are marked estimated in the tables. Claude Code also bills some calls it does not write to its transcripts: some advisor calls, and subagent replies that keep only part of their usage. For those, CodeBurn can show less than Claude Code's own cost counter. codeburn audit prints a row per provider and model saying where every number came from.
The JSON outputs say it per call. export -f json gives every record a costBasis of recorded (the tool's own figure), calculated (measured tokens at published prices), estimated (guessed tokens), included (covered by a subscription, $0) or unpriced (no known price, $0), and sessions, days, sessions --format json and MCP get_usage carry the share of cost from each of the first three. Since codeburn.export.v3 the JSON uses fixed camelCase keys (cost, apiCalls, inputTokens, ...) with the currency stated once in currency.code; CSV headers are unchanged. New keys like this can still appear under v3.
From LiteLLM, fetched and cached for 24 hours under ~/.cache/codeburn/, so a change reaches you within a day of LiteLLM picking it up. The common Claude and GPT models also carry bundled fallback prices, so a lookup miss falls back to a known rate for those. Anything else shows as unpriced rather than guessed. If a model shows $0 its name matched no price row. codeburn models --unpriced lists those ids, codeburn model-alias points a proxy-rewritten name at the real model, and codeburn price-override sets exact rates yourself. On an enterprise agreement, codeburn price-discount set <provider|model|model:kind> <percent> takes your contracted percentage off calculated costs, while recorded costs stay as the tool billed them. A session is priced with today's rates when it is read, not with the rates of the day it ran. See Configuration.
The daily numbers do not. CodeBurn keeps a durable daily history under ~/.cache/codeburn/, holding each day's cost, tokens and per-project and per-model split for ten years, so codeburn report and codeburn status keep answering for days whose transcripts are gone. The per-session detail does go, because it only ever lived in the transcript. So anything that reads sessions, codeburn sessions, models, spend and compare-periods, will show less for an old range than report does for the same range. Compare periods lists those days by name with their unexplained amount instead of quietly folding them into the totals.
Model prices are fetched from LiteLLM and cached for 24 hours, so that call happens at most once a day. codeburn quota asks each provider you are signed in to how much of your plan is left, using the credential that tool already stores on your machine. If you set a non-USD currency, exchange rates come from Frankfurter, cached the same way. If you use Cursor, CodeBurn downloads your own usage export from cursor.com with the Cursor app's login, at most about once an hour, so Cursor figures match your bill; nothing is uploaded, and CODEBURN_CURSOR_SYNC=0 or "cursorSync": false in ~/.config/codeburn/config.json turns it off. Commands that install something, such as codeburn menubar, reach GitHub releases, which is the point of them. Your prompts, your code, your file names and your project names are read on disk and never sent anywhere, and nothing else leaves unless you point CodeBurn at a destination yourself. It is not a proxy, so no traffic of yours passes through it. You can watch what does leave with a network monitor.
Everything else
Yes, on the same local network. On the second machine run codeburn share --pair, which opens a pairing window and prints a PIN. On your main machine run codeburn devices add to find it and pair with that PIN, then codeburn devices shows combined totals by machine. codeburn devices rm <name> forgets one again. Sharing stops after ten minutes idle unless you pass --always, and pairing never leaves your network. You can also discover and pair from the browser dashboard at codeburn web. See Web dashboard.
Register the local MCP server with claude mcp add codeburn -- npx -y codeburn mcp. It runs over stdio and exposes two tools: get_usage for spend and usage broken down by tool, model, project and task, and get_savings for the waste findings, retry tax and routing waste, which is the slower of the two. Any MCP client works, with command npx and args -y codeburn mcp. It reads the same files on disk the CLI reads, and project names are pseudonymized unless the agent asks for the real ones. See MCP.
CodeBurn is MIT licensed and all of it is in this repository: the CLI, the desktop app, the menu bar and tray apps, the GNOME extension. There is no account, no paid tier and no feature held back for one. It is free because it reads files you already have, which costs nothing to run. What it does cost is time, because 42 integrations sit on top of tools that change their config paths and data formats without warning. Sponsorship is what pays for keeping up with them.
Telemetry
The CLI sends nothing. No wrapper, no proxy, no phoning home.
The desktop app, the macOS menu bar and the Windows tray can send an anonymous usage report. Telemetry is on by default in every region. The Windows tray asks once, with Accept and Decline. The desktop app and the macOS menu bar start with it on, and Settings turns it off at any time (on desktop: Settings > Privacy & data > Anonymous telemetry). A choice you already made is kept. Turning it off stops all sending, clears anything queued, and mints a fresh install id so past and future reports cannot be linked. What is sent is listed below.
The only identifier is a random id generated on your machine. Events carry the calendar day, never a clock time. Alongside each batch go the app version, platform, architecture and country.
usage_snapshot goes out at most once per calendar day. It is computed by the CLI so the app
and the tray report the identical shape, and every magnitude in it is a bucket, never an exact
figure. The daily report includes the names of the models, tools, skills and MCP servers you use,
alongside those bucketed counts.
| Field | What it carries |
|---|---|
schema, period | Snapshot version, and the period label you were looking at (for example 30 Days) |
providerCount, costBucket | How many providers had usage, and total spend as a range: <1, 1-10, 10-50, 50-200, 200-1k, 1k+ USD |
models | Up to 8 model names, each with its cost bucket, turn-count bucket, one-shot rate, and up to 6 task categories with a turn bucket and share of that model's turns |
categories | Up to 12 task category names (Coding, Debugging, Planning, …) with a turn bucket, one-shot rate, and up to 3 model names |
providers | Up to 8 provider names with a cost bucket each |
mcpServers, skills, tools | Up to 12 names each with a call-count bucket: 0, 1-10, 10-100, 100-1k, 1k+ |
sessions | Session count bucket, and median session length as a bucket: <5, 5-15, 15-60, 60-240, 240+ minutes |
efficiency | Cache hit rate and retry tax as shares of the total, to two decimals |
The other events are name-only:
| Event | Fields |
|---|---|
app_open, app_close | Session length in whole minutes |
section_view | Which section you opened (overview, spend, …) |
cold_start | Milliseconds to the first painted overview, and whether it timed out |
cli_error | Error kind, the command name, how long it ran as a range (<1s to 120s+), the exit code or signal, a reason label (lock-busy, oom, eacces, enoent, network, parse, shutdown, serve, other) picked on your machine from the error text, which is never sent, and the provider when the read was for one provider. Capped at 20 per kind per day |
provider_read_fail | A provider whose data could not be read: its name, the stage (locate or parse) and the error kind (eacces, busy, enoent, malformed, error). Once a day per provider, stage and kind |
update_result | How a one-click update went: the version before and after, and ok, download_fail, verify_fail or install_fail. Also sent by the macOS menu bar app and the Windows tray |
optimize_apply | The finding id you took a fix for (unused-mcp, claude-md-too-long, …) and the fix type |
plan_set | Provider and plan preset id |
export | Format (csv or json) and provider |
compare_view | The two model names being compared |
settings_change | Setting name and its new boolean or enum value |
Never collected: prompts, code, file contents, file or folder names, project names, branch names, working directories, session titles, PR links, API keys, exact dollar amounts, exact counts, clock times, or IP-based location beyond the country. The names of the models, tools, skills and MCP servers you use are collected, as the table above sets out, and a whitelist sanitizer drops anything that is not a short string, a finite number or a boolean before it leaves the machine.
To turn it off: press Decline on the Windows tray's notice, or open Settings > Privacy & data and switch Anonymous telemetry off.
License
MIT.
CodeBurn is an AgentSeal open-source project and is not affiliated with CodeBurn Bt. or codeburn.hu.
Credits
Pricing data from LiteLLM. Exchange rates from Frankfurter.
Built by AgentSeal.
The Capacity Dock's provider-usage tracking was informed by CodexBar by Peter Steinberger (@steipete), an MIT-licensed menubar app for AI provider usage. Thanks.