AI Skill MartBrowse skillsPromptsProgramsLearnWhat is a Skill?
← Back to list

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/**/*.jsonl transcripts 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

  1. "What did the agents cost this week?" → runs prices → collect → rollup → render → pdf on the default 7-day PT window.
  2. "Was this session worth it?" → collect --session <content_session_id> produces a single line item plus cited evidence IDs.
  3. "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 with review --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)
  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 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.

  1. Open a terminal and confirm Python 3.9+ with python3 --version.
  2. Clone the repo: git clone https://github.com/thedotmack/claude-mem.git
  3. Create the skills folder: mkdir -p ~/.claude/skills
  4. Copy the skill: cp -r claude-mem/claude-mem-grok-bot/skills/agent-cost-report ~/.claude/skills/agent-cost-report
  5. Verify ~/.claude/skills/agent-cost-report/scripts/acr.py exists (other mirror plugins in the repo contain the same skill).
  6. Restart Claude Code and ask for an "agent cost report".
  7. For PDF output install Chrome (google-chrome on PATH); otherwise the run says "PDF skipped, HTML is canonical".
  8. Optional: to get measured provider spend, supply a regular inference OPENROUTER_API_KEY as an environment variable — this step requires your explicit approval.
  9. On Windows, if the script reports missing timezone data, review its printed lines before deciding to install tzdata (or set PYTHONTZPATH instead).
View source on GitHub ↗License: Apache-2.0