The modern developer's IDE is no longer a single environment but a fragmented ecosystem of AI agents. Between Cursor's predictive editing, Claude Code's terminal-based autonomy, and GitHub Copilot's ubiquitous completions, the cognitive load is shifting from writing code to managing the tools that write it. However, this productivity surge comes with a hidden tax: a scattered trail of token expenditures across multiple platforms and API keys that often remain invisible until the end-of-month invoice arrives.

The Architecture of AI Spend Visibility

CodeBurn enters this space as an open-source solution designed to unify the financial visibility of the AI coding stack. The tool supports 25 different AI coding utilities, including industry staples like Claude Code, Cursor, and Copilot. Rather than acting as a middleware, CodeBurn operates by reading session data stored directly on the local disk to calculate token usage and associated costs. To ensure pricing accuracy across a diverse array of providers, it leverages LiteLLM, a library that standardizes API call pricing across various LLM providers.

Installation is handled via a global npm package:

bash
npm install -g codeburn

The utility is flexible in its deployment, offering a macOS menu bar application for real-time monitoring and an MCP server implementation. By supporting the Model Context Protocol, CodeBurn allows AI agents to interact with spending data directly, effectively letting an AI agent audit its own cost efficiency. Users can execute specific commands to refine their workflow, such as `optimize` to identify wasteful spending patterns or `compare` to evaluate the cost-to-performance ratio between different models. The project is released under the MIT license, ensuring it remains accessible to the community.

The Shift from Proxy to Local Analysis

The critical distinction of CodeBurn lies in its architectural approach to data collection. Most enterprise cost-tracking tools rely on a wrapper or a proxy server that sits between the user and the LLM provider. While effective, these intermediaries introduce a single point of failure, potential latency, and significant security concerns regarding the handling of API keys and sensitive prompts. CodeBurn bypasses this entire layer by treating the local disk as the source of truth.

By analyzing the logs and session files that AI tools already generate, CodeBurn provides a retrospective audit without interfering with the live request-response cycle. This shift from active interception to passive analysis means developers get the granularity of a proxy—breaking down spend by project, model, and task type—without the overhead of managing a separate server or risking the exposure of their environment variables. The tension between the need for financial oversight and the desire for a frictionless development experience is resolved by moving the analysis to the edge.

This approach transforms AI spend from a mysterious monthly bill into a tunable performance metric.