CodeBurn: Monitor Claude Code Token Spending by Task
New open-source tool gives developers granular visibility into token consumption across Claude Code agents, solving cost tracking problems for teams spending $1400+ weekly on AI-powered coding.
April 20, 2026
Claude Code agents are hemorrhaging tokens, and nobody knows why
Teams running Claude Code agents are burning through $1400 weekly with almost zero visibility into which tasks caused the damage. API dashboards show cumulative token counts. They don't show you which agent workflow ate half your budget or whether that code generation task was worth the credit burn.
CodeBurn is an open-source tool that does something surprisingly missing from the Claude ecosystem: it tracks token consumption at the task level instead of just showing you a total bill that climbs faster than your confidence in the investment.
The visibility problem nobody talks about publicly
Why API metrics aren't enough
Running Claude as a coding agent feels like hiring an expensive contractor without job tracking. You see the weekly invoice. You might even know the hourly rate. But ask which project drained the account and you're making an educated guess.
The problem isn't that Anthropic doesn't give you data. They do. The problem is the granularity. You get total tokens consumed this week. You don't get tokens consumed by the "code review" agent versus the "refactoring" agent. You don't know if your 10-task batch used 50,000 tokens because each task was legitimately complex or because something went wrong and the agent looped endlessly.
What developers actually need to know
CodeBurn instruments your Claude Code calls to surface metrics that matter operationally:
- Token cost per individual task (not per API call, per logical unit of work)
- Breakdown by agent, workflow, or custom grouping you define
- Input versus output token ratios (helps spot when tasks balloon unexpectedly)
- Historical patterns across runs to catch cost drift
Suddenly you're not just watching money leave. You have comparative data. Task A used 8,000 tokens. Task B used 24,000 tokens for similar work. You can ask why and actually investigate instead of guessing.
$1400+
weekly token spend for teams using Claude Code agents without cost visibility
How the GitHub community responded
The gap this fills
The HackerNews thread on CodeBurn revealed something telling: multiple developers mentioned building internal tracking solutions because Anthropic's dashboards don't go deep enough. These weren't people looking for a fancy analytics platform. They were people solving a painful problem with duct tape and custom scripts.
We're using Claude Code heavily and our bill is $2000/week. I have no idea if that's reasonable for what we're doing. This solves that problem.
That comment cuts to the actual value prop. CodeBurn isn't flashy. It's not a competitor to Claude. It's the boring infrastructure layer that should have existed from day one but didn't.
Why this tool exists at all
When first-party platforms don't provide observability, communities build workarounds. It happened with database monitoring tools. It happened with infrastructure metrics. Now it's happening with LLM cost tracking. CodeBurn is the symptom that suggests Anthropic might need cost visibility built deeper into Claude itself before everyone standardizes on third-party solutions.
Technical setup and integration
How CodeBurn intercepts and logs
The tool works by injecting itself into your Claude Code workflow. You point it at your API interactions. It captures token counts, request metadata, task identifiers, and any custom labels you attach. Then it aggregates everything into reports showing cost per task, cost per agent, cost per time period, or whatever segmentation you care about.
The integration is straightforward because Claude's API already exposes token usage data. CodeBurn just organizes that data in a way the dashboard doesn't.
What you actually get out
The output format matters less than the fact that it exists. Dashboards, CSV exports, API endpoints for integration into your own tools. The point isn't prettiness. The point is answering: which specific task or agent is consuming the most credits, and is that reasonable for what it produced?
# Example: querying token usage by task
codeburn --group-by task --time-range last-7-days --format json
You can filter by date range, by agent name, by task type, or by any metadata you included when you logged the request. It's analytical tooling that respects how real teams actually use Claude.
Why this matters right now, not later
Claude Code adoption is accelerating
More teams are shipping agents. They're running them on production workloads. Budgets are scaling from experimental spend to real line items. But cost management has lagged behind the capability growth.
You get high-level metrics or nothing. No middle ground. CodeBurn is the middle ground.
The ecosystem signal
Tools like this typically signal one of two futures. Either the platform eventually builds the feature in-house (good for everyone, bad for the third-party tool). Or the community tool becomes essential infrastructure that everyone depends on. Either way, CodeBurn's existence shows that developers needed this badly enough to build it without waiting for Anthropic.
Important
If you're running Claude agents and your monthly bill is climbing faster than your understanding of its value, spending 20 minutes on the CodeBurn GitHub repo is the ROI math that actually works. It costs nothing. The problem it solves has a dollar amount attached.
Next steps if you're spending serious money on Claude
When to actually implement this
The threshold is roughly: if you're spending over $500 monthly on Claude agents, tracking costs at task granularity saves money faster than it costs to set up. Smaller usage doesn't justify the overhead. Larger usage makes it essential.
Integration points
CodeBurn works with existing Claude implementations. You don't need to restructure your agents or workflows. You add logging. The tool reads the logs and produces reports. It's additive, not disruptive.
If you're already using monitoring infrastructure like CloudWatch or Datadog, CodeBurn can integrate with those platforms rather than requiring its own separate dashboard.
TL;DR
Claude Code agents burn expensive tokens without task-level visibility, and CodeBurn fills that gap with granular cost tracking by task, agent, or workflow. If you're spending over $500 monthly on Claude agents and can't explain where the budget goes, this tool pays for itself in the first week of optimization decisions it enables.
Comments
Some links in this article are affiliate links. Learn more.