Local profiler for AI agents: burn by source, overnight bill, behavioral forensics, config fixes
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Hermes Agent Β· OpenClaw Β· Claude Code β one normalized core, local, read-only, zero dependencies
You run an AI assistant β OpenClaw, Hermes Agent, or Claude Code. It works around the clock: answers you in Telegram, runs scheduled jobs at night, spawns helper agents. Every word it reads and writes costs money β and the bill arrives as one number with no explanation.
agentburn is a free tool that reads your assistant's own diary (log files already sitting on your computer) and turns that number into answers:
| You ask | It answers | Command |
|---|---|---|
| Where does the money actually go? | scheduled jobs 79% Β· chats 7% Β· helpers 5% Β· you 9% | agentburn |
| What happened while I slept? | the overnight bill, isolated and named | agentburn |
| Why is it so expensive? | same file read 14Γ, a broken tool retried 6Γ, wake-ups that did nothing | agentburn why |
| What did it do in Telegram? | every function it called there, with counts and errors | agentburn why --source telegram |
| What exactly do I change? | ready config lines + expected saving in dollars | agentburn fix |
| Am I paying for a dying model? | your spend vs the world's 4-week trend, with a cheaper rising alternative | agentburn drift |
| Can I just ask the assistant? | yes β install the skill/MCP and ask "where do you burn my money?" | agentburn mcp |
No accounts. No cloud. Nothing leaves your computer. One command to try: uvx agentburn.
Always-on agents bill you around the clock β and their built-in counters only show totals. Real threads that made this tool:
"73% of every API call is fixed overhead β ~13.9K tokens of tool definitions and system prompt, resent every time." β hermes-agent #4379
"One entrant wrote about waking up to a $47 surprise bill from an overnight run β that's not an exotic failure, it's the default behavior of an unsupervised loop." β dev.to
"I've seen runs where step 3 costs 4Γ step 1 β no alert, just a bill." β comment, ibid.
agentburn reads the agent's own accounting data (read-only) and answers the question the totals never do: where.
cron / subagent / gateway:telegram|discord|whatsapp / cli. Always-on β free: scheduled jobs and gateways spend without you.--night 23-7).| agentburn | ccusage | codeburn | built-in /usage | |
|---|---|---|---|---|
| Burn by source (cron Β· heartbeat Β· gateways Β· subagents) | β | β | β | % only, 7 days, this machine |
| π the overnight bill, isolated | β | β | β | β |
Behavioral forensics (why: loops, retry storms, failed-run cost) | β | β | β | β |
Ready config patches (fix, source-verified keys) | β | β | β | β |
Accounting-gap detection (doctor, lower-bound honesty) | β | β | β | β |
| MCP server (agent answers for its own bill) | β | β | β | β |
| Totals / live blocks / many CLIs | basic | β best-in-class | β TUI, 25 providers | totals |
As of June 2026; ccusage and codeburn are excellent at what they do β agentburn deliberately starts where they stop (ccusage scoped per-tool analysis out).
Most token trackers quietly disagree with each other (2β91Γ in public issue threads). agentburn takes the opposite stance:
~/.hermes/state.db: per-session token counters and cost fields). No scraping, no proxies, no guessing.~. Mixed data is labeled mixed.Everything runs locally and reads your database read-only. No network calls. No telemetry. The report is yours.
π€ Share your burn (--share). An anonymized card β categories, models and totals only; session titles, paths and content are excluded by construction. Safe to paste into a post; --svg card.svg renders the same card as an image:
--svg card.svg renders it as an image:
π Calibration against public benchmarks. "Is 15k input tokens per call normal?" The report compares your fixed overhead with community-measured references embedded as dated constants (e.g. the Phala always-on-agent benchmark, 2026-03: β8k/call baseline). No network β sources are cited inline.
π Optimize β prove it (--save-baseline / --compare). Snapshot your pace, change the config (cheaper cron model, trimmed toolsets), then agentburn --compare shows the delta in $/month β pace-normalized, so a 7-day baseline compares honestly with a 30-day window. Every recommendation becomes a testable promise.
π¬ agentburn why β behavioral forensics. report says where it burns; why says why, from the agent's own recorded actions and thoughts:
Observations with numbers, not verdicts; only tool names, truncated argument keys and counters β message content never leaves the machine (and never enters the report).
π§ agentburn explain β LLM interpretation, local-first. The numbers, read back to you in plain language with ranked actions:
Privacy rules are hard-coded: the default endpoint is localhost (ollama / LM Studio); a remote endpoint requires --yes-remote and receives a redacted summary only β session titles become session-N, file paths shrink to basenames, message content is never in the payload to begin with. Works with any OpenAI-compatible API, zero new dependencies. (Yes β a cost profiler spending ~3K tokens to explain costs. The payload is compact and the answer capped; the irony is acknowledged.)
π§ agentburn drift β your spend Γ the world's direction. Are you paying for a model the world is leaving?
Your side is computed locally from the agents' own logs; the world side is one read-only GET of token-history's public trend JSON (archived daily from OpenRouter's rankings β deep history unlocks as the archive grows). Nothing about you is sent anywhere; --trends FILE works fully offline. Nobody else joins these two halves.
π©Ί agentburn why additions: CRON RUNS β the per-run receipt for every scheduled job (what openclaw #24636 keeps asking for), and CONTEXT THRASH β compactions counted per session, because every compaction silently re-sends a near-full context window.
π agentburn rank + --submit β the Burn Index (empty so far). Anonymous community percentiles of efficiency β the benchmark volume-leaderboards can't be: nothing here rewards burning more. No submissions yet, so rank currently tells you exactly that and invites you to be the first; percentiles need 5+ setups per metric before they mean anything.
Joining is consent-by-click: agentburn --submit prints the exact anonymized payload (ratios and a coarse spend band β never raw volumes, titles or paths), then a prefilled GitHub-issue link that you open and submit. A weekly Action aggregates submissions with plausibility bounds (junk and flexing get dropped, not ranked) into public quantiles.
π§ agentburn fix β from findings to ready config patches (dry-run by design). Not "consider a cheaper model" but the exact file and the exact lines:
Patch generators exist only for config keys verified against the agents' source code (Hermes cron/jobs.json, OpenClaw agents.defaults.heartbeat incl. activeHours β the night-burn killer β and lightContext). There is no --apply on purpose: paste it yourself, then prove the saving with --save-baseline β --compare.
π agentburn mcp β your agent answers for its own bill. A zero-dependency MCP stdio server exposing burn_report / burn_why / burn_card. Register it and ask the agent "where do you burn my money?" β it calls the profiler on its own database and explains:
Prefer skills? There's a ready SKILL.md β drop it into ~/.hermes/skills/agentburn/, ~/.openclaw/skills/agentburn/ or ~/.claude/skills/agentburn/ and just ask the agent "where do you burn my money?".
π©Ί agentburn doctor. Trackers disagree because the agent's own accounting has gaps. doctor names the broken combinations (provider Γ model Γ source) for zero-usage and unpriced sessions, and generates a ready-to-paste upstream bug report β counters only, no message content.
π¨ Sentinel mode β a budget guard for server agents. Your agent runs 24/7 on a VPS; this watches it:
Drop it in cron next to the agent itself β the one-off check becomes a standing guard.
One normalized model, one adapter per agent. Run agentburn and every agent found on the machine gets its own report.
| Agent | Status | Data source | Notes |
|---|---|---|---|
| Hermes Agent | β | ~/.hermes/state.db (+ optional request dumps) | costs from the agent's own accounting |
| OpenClaw | β | ~/.openclaw/agents/*/sessions/sessions.json | heartbeat is its own category β the famous one; cron / gateways / subagents split out |
| Claude Code | β | ~/.claude/projects/**.jsonl | tokens only, by design: CC doesn't record costs locally and subscription usage has no honest per-token price β we don't invent one |
Adapters are ~150 lines over a shared model. Codex CLI / opencode are natural next targets β PRs welcome.
token-history β the macro view: daily archive of which agents the world uses (OpenRouter rankings). agentburn is the micro view: where yours burns.
MIT
mcp-name: io.github.Socialpranker/agentburn
the token-* family Β· token-history β which agents the world runs Β· agentburn β where yours burns
if this saved you a dinner's worth of tokens, a β helps the next person find it
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/agentburn)<a href="https://allmcps.com/mcp/agentburn"><img src="https://allmcps.com/api/badge/agentburn?style=directory" alt="Agentburn on AllMCPs" /></a>