Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
← Back to list

Agent Cost Report

Turns Claude Code transcript tokens into a manager-readable dollar report with cost per completed outcome, waste, and labeled estimates.

Data & AnalyticsAdvanced★ 94,740⑂ 8,379AI score 7/10Last updated: Sep 26, 2026

What it does

  • Parses ~/.claude/projects/**/*.jsonl transcripts, dedupes assistant replies, sums real token usage (input, output, cache write 5m/1h, cache read) and prices it with OpenRouter public list prices fetched at run time.
  • Labels every figure as Measured / Estimated / Extrapolated / Unavailable — never reports "$0 spent" for unknown data, and keeps the note-taker (observer) cost out of the headline.
  • Groups sessions into work items, assigns one of six work categories and a separate failure_type (Looping, Hedging, Rework, Regression, Unauthorized action, …), then computes waste rate, recovery share and cost per completed outcome.
  • Emits a run directory with a self-contained report.html, report.pdf, report.json, line-items.csv, evidence.json and labels.review.json for a human/LLM review pass.
  • Default window is the last 7 full PT days, excluding today; override with --session, --project, or --start/--end.

Who it's for

  • Team leads running Claude Code with the claude-mem plugin who must report weekly AI spend upward.
  • Engineers who want hard numbers on where agent turns were wasted (looping, rework, wrong model).
  • Anyone building a reporting pipeline with only the Python 3.9+ standard library (no pip installs).

Example uses

  1. "Give me this week's agent cost report" → runs prices → collect → rollup → render on the default 7-day PT window and returns the HTML/PDF paths.
  2. "Only the claude-mem project, Sep 1–8" → collect --project claude-mem --start 2026-09-01 --end 2026-09-08 and a scoped report.
  3. "Was this session worth it?" → --session <id> produces the session's estimated cost, wasted turns and any blocked unauthorized actions with evidence IDs.

· · · 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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude 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/

⚠ This is a third-party skill. Check the source repository before installing.

  1. Open a terminal in a working directory.
  2. Clone the repo: git clone https://github.com/thedotmack/claude-mem.git
  3. Copy the skill into place: mkdir -p ~/.claude/skills && cp -r claude-mem/claude-mem-grok-bot/skills/agent-cost-report ~/.claude/skills/
  4. Verify python3 --version is 3.9 or newer — no extra packages are required.
  5. For PDF output, make sure headless google-chrome is installed; without it you still get the canonical HTML.
  6. Enable the claude-mem plugin and its mem-search MCP tools so the evidence review step can run.
  7. Restart Claude Code and ask for "an agent cost report".
  8. Optional: to show measured provider spend, pass a plain inference OPENROUTER_API_KEY as an environment variable only (never in a settings file). Without it the report simply reads "measured spend unavailable".
View source on GitHub ↗License: Apache-2.0