AI Deck

Wattage — An OpenTelemetry-Compatible Cost Analysis CLI That Puts a Dollar Figure on Wasted Agent Tokens

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), and reasoning_overspend (heavy reasoning-token spend on simple steps) — each finding comes with a concrete fix.
  • A convergence engine that catches non-convergence: The nonconvergence detector 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 --html option emits a self-contained interactive “burn map” (a flame graph showing which steps got expensive). wattage badge generates 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

PlanPriceWhat’s included
Open source (Apache 2.0)$0All 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

CriteriaWattageLangfuseHeliconeAgentOps
DeliveryCLI (fully local)SaaS + self-hostSaaS + self-hostSaaS
FocusDetecting waste and blocking cost regressionsTrace observability, evals, prompt managementProxy-based logging and cost aggregationAgent run monitoring and replay
Automatic waste diagnosisNamed explicitly by ten detectorsRead off a dashboard by a humanRead off a dashboard by a humanFocused on run visualization
CI cost-regression gateShips a GitHub ActionBuild it yourselfBuild it yourselfBuild it yourself
Account / API keyNot required (offline)RequiredRequiredRequired
LicenseApache 2.0Open source edition availableOpen source edition availablePrimarily 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.

← Blog