When you run AI agents, the bill grows while the question of “where exactly is the waste?” goes unanswered. Wattage is a command-line tool for reading that answer straight out of your own data. It ingests Claude Code session logs or OpenTelemetry GenAI traces, runs ten detectors to surface wasteful token-spending patterns, and puts a dollar figure on each one. It is built by Muhammad Faizan Raza (US) and released under the Apache 2.0 open source license. No API key, no config file, and it runs fully offline.
Key Features
- Reads traces and prices them in dollars: It parses Claude Code / Claude Agent SDK session logs (
.jsonl) and OpenTelemetry GenAI semantic-convention traces, applying verified pricing data to every API call to reconstruct what was actually billed. OpenLLMetry (Traceloop) and OpenInference attribute names, plus JSON Lines format, are auto-detected. - Ten waste detectors:
prefix_churn(stable context resent instead of cached),cache_gap(caching attempted but under-redeemed later),retry_storm(the same request re-sent back to back),tool_result_bloat(oversized tool results re-fed into later calls),verbosity(output far exceeding what the step needed),redundant_tool_calls(identical or fuzzy-matched duplicate calls),retrieval_thrash(repeated retrieval yielding no new evidence),model_mismatch(an expensive model doing work a cheaper one could handle), andreasoning_overspend(heavy reasoning-token spend on simple steps) — each finding comes with a concrete fix. - A convergence engine that catches non-convergence: The
nonconvergencedetector flags loops that thrash, oscillate, or stall without making progress. Catching this agent-specific form of waste — hard to see from tool-call counts alone — is what sets Wattage apart from other cost-measurement tools. - Efficiency scores and burn maps: It computes a token efficiency score from 0 to 100, and the
--htmloption emits a self-contained interactive “burn map” (a flame graph showing which steps got expensive).wattage badgegenerates an SVG badge as well. - A cost-regression gate for CI: A GitHub Action is provided. Compare against a baseline file and fail the build on conditions such as “score below 80” or “cost up more than 5%.” It posts a sticky PR comment with per-detector deltas and can emit SARIF and JUnit XML.
- Designed not to guess: If a model with no pricing data appears, it refuses to invent a rate and fails loudly with exit code 4. Traces with no captured usage are refused rather than graded. Pricing snapshots are dated and source-cited.
Pricing
| Plan | Price | What’s included |
|---|---|---|
| Open source (Apache 2.0) | $0 | All features. Distributed on PyPI (wattage) and npm (wattage-cli) |
You can start with uvx wattage demo for a sample report. For real data, uvx wattage report --claude-code analyzes your most recent Claude Code session, and uvx wattage report trace.json handles any OTLP trace export.
Pricing is current as of August 2026. Check the official repository for the latest information.
Pros & Cons
✅ Pros
- Completely free and open source, with no account signup or API key issuance
- Runs offline, so agent traces (which may contain prompt content) never leave your machine
- Expresses waste in dollars rather than abstract metrics, making savings easy to explain
- Every finding ships with a concrete fix, so the next step is clear
- Wired into CI, it catches cost increases caused by code changes before release
⚠️ Cons
- It is a CLI tool: there is no web dashboard or hosted team-sharing layer
- You need traces already captured (outside Claude Code, that means OpenTelemetry instrumentation)
- At v0.2.0 it is an early-stage, individually maintained project, so future update cadence is hard to predict
- Pricing data is a dated snapshot, and analysis halts when an unsupported model appears (a deliberate anti-guessing design, but one that requires keeping up with updates)
- Japanese-language write-ups and case studies are still scarce
Comparison with Similar Services
| Criteria | Wattage | Langfuse | Helicone | AgentOps |
|---|---|---|---|---|
| Delivery | CLI (fully local) | SaaS + self-host | SaaS + self-host | SaaS |
| Focus | Detecting waste and blocking cost regressions | Trace observability, evals, prompt management | Proxy-based logging and cost aggregation | Agent run monitoring and replay |
| Automatic waste diagnosis | Named explicitly by ten detectors | Read off a dashboard by a human | Read off a dashboard by a human | Focused on run visualization |
| CI cost-regression gate | Ships a GitHub Action | Build it yourself | Build it yourself | Build it yourself |
| Account / API key | Not required (offline) | Required | Required | Required |
| License | Apache 2.0 | Open source edition available | Open source edition available | Primarily commercial |
As an observability platform it does not match the breadth of established LLM observability services, but Wattage narrows in on one thing: naming the waste in traces you already have and telling you how to fix it. The intended pattern is complementary — collect traces with Langfuse or OpenLLMetry, then feed them to Wattage.
Who Is It For
- Developers who use Claude Code daily and want one honest look at where their tokens go
- Teams running homegrown AI agents in production who want release-over-release cost increases stopped automatically
- Anyone who added prompt caching but is not certain it is actually working
- Environments where traces contain business data and shipping logs to an external observability SaaS is difficult
- Anyone whose AI bill is “vaguely high” and who wants a concrete plan to bring it down
Summary
Wattage is an open source command-line tool that reads AI agent traces, names wasteful token spend in dollar terms, and prescribes fixes. Among its ten detectors, the convergence engine that catches non-converging loops fills a gap that existing cost-visualization tools rarely cover. Offline operation with no API key makes it easy to try: start with uvx wattage demo to see the shape of the output, then analyze one of your own Claude Code sessions. If it proves useful, you can go straight on to a cost-regression gate in GitHub Actions.