Agent Cost Report
Turns Claude Code transcript tokens into labeled dollars and renders a manager-ready HTML/PDF report of cost per completed outcome, waste and failures.
Data & AnalyticsAdvanced★ 119,586⑂ 10,393AI score 8/10Last updated: Nov 25, 2026
What it does
- Parses
~/.claude/projects/**/*.jsonltranscripts for exact per-reply token usage, deduped on(message.id, requestId). - Fetches OpenRouter public list prices at run time and converts input/output/cache tokens into USD, always flagged as ESTIMATED.
- Enforces strict money labeling: Measured / Estimated / Extrapolated / Unavailable — never writes "$0 spent" for an unknown.
- Groups sessions into work items with a work category (Feature, Bug fix, Incident, Maintenance, Investigation, Experiment) and failure types (Looping, Hedging, Rework, Unauthorized action, and more).
- Emits one run directory: self-contained
report.html,report.pdf,report.json,line-items.csv,evidence.json,labels.review.json. - Default window is the last 7 full PT days, excluding today; session, project and explicit date ranges are supported.
Who it's for
- Team leads and managers on the claude-mem stack who must justify agent spend.
- Anyone reporting cost per completed outcome, waste rate, and recovery share.
- Teams shipping weekly report packs (HTML + JSON + CSV + evidence).
Examples
- "What did the agents cost this week?" → runs prices → collect → rollup → render → pdf on the default 7-day PT window.
- "Was this session worth it?" →
collect --session <content_session_id>produces a single line item plus cited evidence IDs. - "Project A cost and waste for September" →
--project A --start 2026-09-01 --end 2026-10-01, then confirm the draft keyword labels against Mem Search observations and apply withreview --apply.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/thedotmack/claude-mem/HEAD/claude-mem-grok-bot/skills/agent-cost-report/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on AI Skill Mart. Copy the claude-mem-grok-bot/skills/agent-cost-report folder from the GitHub repo thedotmack/claude-mem into my ~/.claude/skills/thedotmack-agent-cost-report/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/thedotmack/claude-mem.git && mkdir -p ~/.claude/skills && cp -r claude-mem/claude-mem-grok-bot/skills/agent-cost-report ~/.claude/skills/agent-cost-report⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and confirm Python 3.9+ with
python3 --version. - Clone the repo:
git clone https://github.com/thedotmack/claude-mem.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r claude-mem/claude-mem-grok-bot/skills/agent-cost-report ~/.claude/skills/agent-cost-report - Verify
~/.claude/skills/agent-cost-report/scripts/acr.pyexists (other mirror plugins in the repo contain the same skill). - Restart Claude Code and ask for an "agent cost report".
- For PDF output install Chrome (
google-chromeon PATH); otherwise the run says "PDF skipped, HTML is canonical". - Optional: to get measured provider spend, supply a regular inference
OPENROUTER_API_KEYas an environment variable — this step requires your explicit approval. - On Windows, if the script reports missing timezone data, review its printed lines before deciding to install
tzdata(or setPYTHONTZPATHinstead).
View source on GitHub ↗License: Apache-2.0