Noureddine RAMDI / CodeBurn: local-first CLI for multi-provider AI coding session cost and productivity tracking

Created Tue, 05 May 2026 13:37:39 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

getagentseal/codeburn

CodeBurn does something that many AI coding users have struggled with: it provides clear, local visibility into token costs and productivity across multiple AI coding assistants without relying on proxies or cloud APIs. Instead of guessing API usage or paying for external services, CodeBurn parses session files directly on your disk, categorizes your work deterministically, and tracks success rates — all accessible via an interactive terminal dashboard or exportable reports.

How CodeBurn reads and tracks AI coding session data

CodeBurn is a TypeScript CLI tool designed for developers who use AI coding assistants like Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, and others. It supports 18 different AI coding tools by reading their session data directly from disk. These session files come in various formats including JSON, JSONL, SQLite databases, and VS Code storage files.

The core architectural idea is a local-first design: no API keys, no proxies, no cloud dependencies. It scans platform-specific disk locations where these AI coding tools store their session data, and automatically detects installed providers. Each provider is implemented as a single TypeScript module (for example, src/providers/codex.ts), making it modular and easy to extend.

Once the session data is loaded, CodeBurn uses LiteLLM locally to price every API call, caching these prices for 24 hours to avoid redundant computations. It categorizes user activity into 13 deterministic task types based on tool usage patterns and keyword matching — notably, it does this classification without invoking any language model calls, which keeps it lightweight and predictable.

Beyond cost tracking, CodeBurn also tracks “one-shot” success rates by detecting edit-test-fix retry cycles. This means it can tell you how often you get the desired result from your AI coding assistant on the first try versus needing to iterate.

The tool supports multiple output modes: an interactive TUI dashboard, JSON exports, and CSV reports. It includes commands for optimizing workflows, comparing sessions, and analyzing yield — all refreshing automatically every 30 seconds by default, adjustable via configuration.

What sets CodeBurn apart technically and the tradeoffs involved

The provider architecture is CodeBurn’s standout feature. Each AI coding tool is handled by a dedicated provider file that knows how to parse that tool’s session storage format. This modular design keeps the codebase clean and allows new providers to be added with minimal effort. The automatic detection of installed providers by scanning disk paths is a practical touch that improves the developer experience.

A clever engineering decision is the deterministic task categorization. Instead of querying an LLM to classify tasks — which would add latency, cost, and nondeterminism — CodeBurn uses fixed rules based on usage patterns and keywords. This approach trades off some nuanced classification accuracy for speed, predictability, and offline capability, which aligns with the local-first philosophy.

Similarly, the one-shot rate tracking is done by detecting edit-test-fix cycles in the session data rather than relying on semantic analysis. This pragmatic approach gives actionable metrics about AI coding effectiveness without complex AI calls.

The pricing integration via LiteLLM with a 24-hour local cache ensures accurate and up-to-date cost estimations without external queries after the initial cache. This balances correctness with offline usability.

On the downside, this local parsing approach depends on the session data formats staying consistent across provider updates. If an AI coding tool changes how it stores session data, the corresponding provider module needs updates.

Also, because the task categorization is rule-based, it can miss subtle context or misclassify edge cases. For usage scenarios needing deeper semantic understanding, this might be limiting.

Nonetheless, the code quality is surprisingly clean for a multi-provider parser, with clear separation of concerns and well-documented provider modules.

Quick start with CodeBurn

CodeBurn requires Node.js 20+ and at least one supported AI coding tool installed with session data stored locally. For Cursor and OpenCode support, it automatically installs better-sqlite3 as an optional dependency.

You can install CodeBurn globally with npm:

npm install -g codeburn

Alternatively, on macOS you can use Homebrew:

brew tap getagentseal/codeburn
brew install codeburn

If you prefer not to install, you can run it directly using npx or similar tools:

npx codeburn
bunx codeburn
 dx codeburn

Once started, CodeBurn scans your disk for session data, processes it, and presents an interactive terminal UI showing token costs, task types, success rates, and more. You can filter by date range, provider, and output format.

Who should consider using CodeBurn and what to keep in mind

CodeBurn is aimed at developers who interact heavily with multiple AI coding assistants and want transparent, local visibility into their token usage and workflow effectiveness. If you’re frustrated by opaque API billing or want to understand your AI coding productivity without sending data to the cloud, CodeBurn offers a practical solution.

It’s particularly useful for privacy-conscious developers, teams with multiple AI tools, or anyone running AI coding tools in environments without reliable internet.

The tradeoff is that CodeBurn requires your AI coding tools to store session data locally and in recognizable formats. If you use cloud-only or ephemeral AI coding sessions, CodeBurn won’t have data to parse.

Also, the deterministic task categorization may not capture every nuance of your workflows. If you want deep semantic analysis or integration with advanced LLM-based session analytics, you’ll need to look elsewhere.

In practice, CodeBurn’s modular provider design and local pricing cache make it a solid tool to integrate into your developer toolkit for AI coding observability. The interactive TUI dashboard is well-done and keeps you informed without extra dependencies or API keys.

If you use AI coding assistants seriously and want to understand your usage patterns and costs without cloud dependencies, CodeBurn is worth a look.


→ GitHub Repo: getagentseal/codeburn ⭐ 5,174 · TypeScript