pypi agentburnstdioMITupdated 8d ago
โถ Try it in your browser โ no install
What can you do with agentburn?
Claude Code ยท OpenClaw ยท Hermes Agent โ one normalized core, local, read-only, zero dependencies
uvx agentburn
โถ ย Try it in your browser โ no install
You didn't run out on your average day
You ran out inside one window. On this machine that window was 5.4ร the median one โ same person, same week, same subscription.
Your assistant's own logs already know which window it was and what filled it. Nothing else on your machine does: the built-in counter shows a total, your invoice shows a total, and neither says which five hours took you out.
โณ agentburn limits โ claude-code ยท rolling 5-hour windows
PEAK WINDOW Aug 04 12:45โ17:45 ยท 555M weighted
opus 91% ยท sonnet 9% ยท cli 93% ยท subagent 7%
TYPICAL WINDOW 104M median of 83 active 5h slots
PEAK / TYPICAL 5.4ร a wall is hit by the peak, not by the median
WHAT FILLS THE WINDOW
cache reads 64% ยท cache writes 25% ยท output 11%
One command, no account, nothing leaves your computer:
uvx agentburn # where it burns, and what to change
uvx agentburn limits # how fast you fill a usage window
Two ways agents cost you, two questions
| If you payโฆ | what actually runs out | ask |
|---|---|---|
| a subscription (Claude Code Pro/Max) | the rolling usage window โ the invoice is fixed, the wall is not | agentburn limits |
| per token (API keys, OpenClaw, Hermes) | money, mostly while you're asleep | agentburn |
Both read the same local logs. Neither invents a number the data doesn't contain.
agentburn limits โ the subscription view
Optimizing a subscription doesn't change your bill. It changes how far you get before you're cut off. That is a window problem, and windows need intra-session resolution โ a single session routinely spans several of them.
-
Peak vs typical. Your worst rolling 5-hour window against the median of your own active ones. The ratio is the finding: a wall is hit by the peak.
-
What filled it โ by model, by source (you / subagents / scheduled work), and by kind (cache reads vs cache writes vs output).
-
Measured against your own wall. Anthropic doesn't publish the formula behind those allowances, so agentburn refuses to invent a threshold. Tell it when you were actually cut off and the arithmetic becomes yours:
agentburn limits --hit "2026-08-20 14:30" # ceiling 38.4M weighted tokens โ measured from your own cut-off # peak window 107% of your ceiling # last 5h 12% of your ceiling
Weighted tokens = tokens ร published price ratios (cache read 0.1ร, cache write 1.25ร, output per model), normalized to one input token of the reference model. Every ratio is public; none of them is a guess about how the provider counts.
agentburn โ the money view
- Where it burns โ by source:
cron/subagent/gateway:telegram|discord|whatsapp/cli. Always-on โ free. - ๐ While you slept โ the overnight bill, isolated and named (
--night 23-7). - Fixed overhead โ uncached input tokens per API call, per source, calibrated against a public benchmark.
- Subagent rollups โ delegation cost chained back to the session that spawned it.
agentburn whyโ behavioral forensics: re-read loops, retry storms, idle heartbeats, per-cron receipts, context thrash.agentburn fixโ ready-to-paste config patches, dry-run by design.
agentburn fix โ findings become config, not advice
Not "consider a cheaper model" but the exact file and the exact lines. Patch generators exist only for levers verified against the agent's own source or documented configuration:
๐ง agentburn fix โ claude-code ยท DRY-RUN (nothing was changed)
1. Drop 2 MCP server(s) you never called
why : registered but not called once in the last 30d: blender-mcp, pixellab.
Every registered server ships its tool definitions with the context
of every session that loads it.
proposed:
claude mcp remove blender-mcp
2. Trim the always-loaded memory files (2,254 tokens)
why : loaded into every session's context and re-sent whenever the prompt
cache expires or the context is compacted โ at least 3,565ร this window.
| Agent | Verified levers |
|---|---|
| Claude Code | registered MCP servers (~/.claude.json, .mcp.json), always-loaded CLAUDE.md memory files |
| Hermes | per-job model / enabled_toolsets (cron/jobs.py), per-platform toolsets (gateway/run.py) |
| OpenClaw | heartbeat.{every, activeHours, model, lightContext} (config/types.agent-defaults.ts) |
There is no --apply on purpose: it's your agent's config. Paste it yourself, then prove the saving with --save-baseline โ --compare.
Why trust these numbers
Token trackers quietly disagree with each other (2โ91ร in public issue threads). agentburn takes the opposite stance:
- Numbers come from the agent's own accounting, read-only. No scraping, no proxies, no guessing.
- Provider-billed costs are shown as-is; estimates are marked
~; mixed data is labeled mixed. - Where a price doesn't exist, none is invented. Claude Code records no costs and subscription usage has no honest per-token price โ so that adapter reports tokens and windows, never dollars.
- Sessions with messages but zero recorded tokens (known accounting gaps, e.g. hermes-agent #12023) are detected: totals become an explicit lower bound, and fixing the accounting becomes recommendation #1.
- Result weights on agents that don't record them are labeled estimates, and only ever used to rank findings against each other.
Speed
Transcripts are append-only, so they are parsed once. Each file's parse is cached under its size and mtime in ~/.agentburn/cache, and a run reuses every file that hasn't changed:
| 30 days over 3.1 GB of Claude Code logs | |
|---|---|
| first run (parses everything, writes the cache) | ~190 s |
| every run after that | ~3 s |
| cache size | 29 MB (0.9% of the logs) |
A file that grew is re-parsed and re-cached; nothing else is touched. --no-cache (or AGENTBURN_NO_CACHE=1) forces a full re-parse, --clear-cache deletes it. The cache is derived data โ deleting it costs time, nothing else.
Privacy
Everything runs locally and reads your logs read-only. No network calls, no telemetry, no accounts. The report is yours. The only commands that touch the network say so: drift GETs a public trends file, --submit opens a prefilled issue you review and send.
The parse cache in ~/.agentburn/cache (mode 0700) holds the same tool names and truncated argument keys the reports show, derived from logs already on this machine โ never message content. --clear-cache removes it.
Why this exists
Always-on agents bill you around the clock โ and their built-in counters only show totals:
"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
How it compares
| agentburn | ccusage | codeburn | built-in /usage |
|
|---|---|---|---|---|
| Usage windows (peak vs typical, what filled them) | โ | โ | โ | current window only |
| Burn by source (cron ยท heartbeat ยท gateways ยท subagents) | โ | โ | โ | % only, 7 days |
| ๐ the overnight bill, isolated | โ | โ | โ | โ |
Behavioral forensics (why: loops, retry storms, failed-run cost) |
โ | โ | โ | โ |
Ready config patches (fix, verified levers) |
โ | โ | โ | โ |
| MCP server (the agent answers for its own bill) | โ | โ | โ | โ |
| Totals / live blocks / many CLIs | basic | โ best-in-class | โ TUI, 25 providers | totals |
ccusage and codeburn are excellent at what they do โ agentburn deliberately starts where they stop (ccusage scoped per-tool analysis out).
Supported agents
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 |
|---|---|---|---|
| Claude Code | โ | ~/.claude/projects/**.jsonl |
tokens and windows, by design: no local costs, no honest per-token price for a subscription |
| OpenClaw | โ | ~/.openclaw/agents/*/sessions/sessions.json |
heartbeat is its own category โ the famous one |
| Hermes Agent | โ | ~/.hermes/state.db (+ optional request dumps) |
costs from the agent's own accounting |
Adapters are ~150 lines over a shared model. Codex CLI / opencode are natural next targets โ PRs welcome.
Everything else
A zero-dependency MCP stdio server exposing burn_report / burn_limits / burn_why / burn_card. Register it and ask "where do you burn my money?" โ it profiles its own database and explains.
claude mcp add agentburn -- agentburn mcp
# Hermes / OpenClaw: add an stdio MCP server with command `agentburn mcp`
Prefer skills? There's a ready SKILL.md for ~/.claude/skills/agentburn/ (or the Hermes/OpenClaw equivalents).
Categories, models and totals only; session titles, paths and content are excluded by construction. --svg card.svg renders the same card as an image.
๐ฅ my claude-code agent ยท last 30d
3.01B tokens ยท 19,255 API calls
where it burns: cli 77% ยท subagent 23%
โณ my peak 5h window: 555M weighted tokens โ 5.4ร my own median window
๐ while I slept (00โ08): 75.3M tokens โ 3% of everything
โ agentburn ยท local & private
Snapshot your pace, change the config, then agentburn --compare shows the delta โ pace-normalized, so a 7-day baseline compares honestly with a 30-day window. Every recommendation becomes a testable promise.
Are you paying for a model the world is leaving? Your side is computed locally; the world side is one read-only GET of token-history's public trend JSON (archived daily from OpenRouter's rankings). Nothing about you is sent anywhere; --trends FILE works fully offline.
agentburn explain --model llama3.1 # local ollama โ nothing leaves the machine
agentburn explain --llm https://openrouter.ai/api/v1 \
--model deepseek/deepseek-chat --yes-remote --lang ru
The default endpoint is localhost; a remote one requires --yes-remote and receives a redacted summary (titles โ session-N, paths โ basenames, content never present to begin with).
doctor names the broken combinations (provider ร model ร source) behind zero-usage and unpriced sessions, and generates a ready-to-paste upstream bug report โ counters only.
Sentinel mode is a budget guard for server agents:
agentburn --agent openclaw --budget-night 5 --fail-over --no-color \
|| notify-send "๐จ agent is burning money at night"
Anonymous percentiles of efficiency โ the benchmark volume-leaderboards can't be: nothing here rewards burning more. 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. Percentiles need 5+ setups per metric before they mean anything.
Related
token-history โ the macro view: daily archive of which agents the world uses. agentburn is the micro view: where yours burns.
License
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 window's worth of work, a โญ helps the next person find it
Install
Add agentburn to your client. Pick the one you use.
claude mcp add agentburn -- uvx agentburncodex mcp add agentburn -- uvx agentburnamp mcp add agentburn -- uvx agentburn{
"mcpServers": {
"agentburn": {
"command": "uvx",
"args": [
"agentburn"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"agentburn": {
"command": "uvx",
"args": [
"agentburn"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"agentburn","command":"uvx","args":["agentburn"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"agentburn": {
"command": "uvx",
"args": [
"agentburn"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"agentburn": {
"command": "uvx",
"args": [
"agentburn"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"agentburn": {
"command": "uvx",
"args": [
"agentburn"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"agentburn": {
"type": "local",
"command": "uvx",
"args": [
"agentburn"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"agentburn": {
"command": {
"path": "uvx",
"args": [
"agentburn"
]
}
}
}
}Add to your Zed `settings.json`.
uvx agentburnRun `goose configure`, choose **Add Extension โ Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance25/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 0 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint โ no local install
Version history
| Versions | Published |
|---|---|
| 0.13.3Latest | Aug 27, 2026 |
| 0.13.2 | Aug 27, 2026 |
| 0.13.1 | Aug 27, 2026 |
| 0.13.0 | Aug 27, 2026 |
| 0.12.3 | Aug 1, 2026 |
| 0.12.2 | Aug 1, 2026 |
| 0.12.1 | Aug 1, 2026 |
| 0.12.0 | Aug 1, 2026 |
| 0.11.1 | Aug 1, 2026 |
| 0.11.0 | Jun 10, 2026 |
| 0.10.0 | Jun 10, 2026 |
| 0.9.0 | Jun 10, 2026 |