Product Introduction
- Definition: CodeBurn is a free, open-source, local-first AI coding cost and token usage tracker. It is a technical analytics tool that operates by parsing the local session log files generated by AI-powered coding assistants and IDEs.
- Core Value Proposition: CodeBurn exists to provide developers and teams with granular, actionable visibility into their AI coding expenditure. It solves the "black box" billing problem by breaking down token consumption and associated costs by model, project, task, and session, enabling data-driven optimization and budget control.
Main Features
- Multi-Tool Session File Analysis: CodeBurn works by reading the native session transcript files already written to disk by over 40 supported AI coding tools, including Claude Code, Cursor, Windsurf, Codex, GitHub Copilot, and Gemini Code Assist. It uses file system watchers and parsers for JSON, SQLite, and other log formats to extract token counts, model identifiers, timestamps, and conversation context without requiring API keys or sending data externally.
- Granular Cost Attribution & Dashboards: The tool provides three primary interfaces. The Menu Bar App (macOS/Linux) offers real-time, glanceable spend monitoring. The Desktop App delivers a detailed GUI for drilling into cost flow from model to specific Git repository and pull request. The Terminal Interface (via
npx codeburn) provides a comprehensive, filterable TUI (Text User Interface) showing breakdowns by project, model, activity type, shell commands, and integrated MCP servers. - Optimization & Waste Detection: The
codeburn optimizecommand performs a static analysis on session histories to identify inefficient patterns. It detects waste like cache bloat (repeated file reads), low edit-to-read ratios, unbounded terminal output, and unused MCP server calls, providing token-level savings estimates and actionable fixes.
Problems Solved
- Pain Point: Developers and engineering teams lack visibility into how their AI coding tool budgets are spent, leading to surprise bills and an inability to optimize for cost-efficiency. Traditional billing dashboards from providers aggregate spend without context for which project, task, or workflow caused it.
- Target Audience: The primary users are software developers, engineering managers, and indie hackers who regularly use AI coding assistants like Claude Code or Cursor for professional work. Secondary users include DevOps engineers and fintech teams needing to audit and control API spend at scale.
- Use Cases: Essential for auditing monthly AI coding bills, comparing the cost-effectiveness of different models (e.g., Claude Opus vs. Sonnet) on the same task, attributing R&D costs to specific client projects, identifying buggy agent behaviors that leak tokens, and setting per-project or per-model spending alerts before limits are hit.
Unique Advantages
- Differentiation: Unlike cloud-based SaaS cost trackers or generic API dashboards, CodeBurn is 100% local, open-source (MIT licensed), and privacy-first. It analyzes existing local data, offering deeper, project-aware insights without the security and privacy concerns of uploading proprietary code session logs to a third party.
- Key Innovation: Its core innovation is the reconciliation of low-level session transcripts with high-level software development context. It classifies each conversational "turn" within a session into categories (e.g., coding, debugging, planning), maps tokens to specific Git repositories and branches, and correlates spend with actual output (like pull requests), moving beyond raw token counts to meaningful cost-per-task metrics.
Frequently Asked Questions (FAQ)
- Is CodeBurn safe to use with proprietary code? Yes. CodeBurn is a local-first, open-source application. It only reads session log files from your local machine that your AI tools have already created. No code, session data, or transcripts are ever uploaded to external servers.
- How does CodeBurn track costs without API access? It calculates costs using published token pricing tables from AI model providers (e.g., Anthropic, OpenAI). By parsing the session logs which contain model names and token counts, it applies the correct per-million-token rate to compute an accurate dollar estimate locally on your machine.
- What AI coding tools does CodeBurn support? CodeBurn supports over 40 tools, including major platforms like Claude Code, Cursor, Windsurf, GitHub Copilot, Codex, Gemini Code Assist, and Goose. It also supports newer or niche agents like OpenCode, Kilo Code, Roo Code, and Antigravity. The full list is maintained in its open-source repository.
- Can CodeBurn set spending limits or alerts? The menu bar app displays real-time spend and can show time remaining against a configured daily or monthly budget, providing a passive alert. It does not currently actively block usage or send push notifications.
- How does the
codeburn optimizefeature work? The optimize command runs a heuristic analysis on your historical session data. It looks for patterns known to waste tokens, such as an agent reading the same file multiple times without editing (cache bloat), generating excessive terminal output, or invoking unused MCP tools, and then suggests specific configuration changes to mitigate them.
