Skip to content
Skillpedia
Documentation101k Β· #1260

Agent Cost Report

What it does

This agent creates detailed reports on the costs of using AI tools like Claude Code. It estimates spending on tokens and identifies waste.

When to use it

  • βœ“When leadership needs to know the cost of AI projects.
  • βœ“After an intensive usage session to understand ROI.
  • βœ“To analyze waste like repetitions or errors in AI tasks.

Skill link

https://github.com/thedotmack/claude-mem/blob/main/claude-mem-cursor/skills/agent-cost-report/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedotmack/claude-mem/blob/main/claude-mem-cursor/skills/agent-cost-report/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œGenerate a cost report for the last week, focusing on waste.”

5 new skills a week. 1 minute to read.

Agent Cost Report: full guide

Agent bills are hard to read. Your usage is spread over many sessions, models and days, and the provider dashboard does not tell you which work shipped or which part was wasted. This skill reads your Claude Code transcripts, counts the tokens of every reply, prices them at OpenRouter list prices and writes a report you can hand to a manager.

Dollars are labeled estimated, measured or extrapolated, so nobody mistakes a guess for an invoice. The report also shows what looping, rework and wrong turns cost, next to what shipped, on one time axis. It is for people who run agents every day and must explain the spend without being able to read raw logs.

Use cases

Weekly spend review

Every Monday your lead asks what the agents cost. You run the default window, the last 7 full days in Pacific Time without today, and send report.pdf. The first page gives the estimated dollars, the number of finished items and the cost of each.

Check one expensive session

A long debugging session ran overnight and you suspect it went in circles. You pass its session id with --session. The report shows its cost, the part marked as waste and the evidence IDs, so you can check the claim yourself.

Cost of one project over a month

A client project ran from the 1st to the 28th. You give the project name and a start and end date. Worktrees of that project are included, so the total and the line items match what the client paid for.

Step by step

  1. 1Install the skill in ~/.claude/skills/agent-cost-report/ (or the project's .claude/skills/). It needs Python 3.9 or newer and nothing else, except tzdata on Windows if the script asks for it.
  2. 2Ask your agent for a cost report. Without other details it uses the last 7 full days in Pacific Time, not counting today. Add --start and --end, --session or --project to change the scope.
  3. 3Let it run the scripts. It reads your Claude Code transcripts, fetches OpenRouter list prices, writes the output folder and drafts labels from keywords.
  4. 4Let it do the review pass. It checks each work item's category and failure type against the cited Claude-Mem observations and applies the changes. Unreviewed items keep a draft label mark.
  5. 5Open report.html, or report.pdf if Chrome is installed. Read the hero dollars first, then the cost of mistakes and the list of what got done.

Example

What to ask

β€œRun an agent cost report for last week. I want to know what we wasted and which finished items were the most expensive.”

What you get

You get a folder with report.html, report.json, line-items.csv, evidence.json and a PDF when Chrome is found. The top shows the estimated dollars, the finished items and the cost of each. The cost of mistakes is a separate line. Work items are listed most expensive first.

Tips

  • βœ“Read the label next to every dollar figure. Estimated means list price times measured tokens. It is not your invoice. Measured provider spend appears only when a sanctioned source exists, and otherwise the report says it is unavailable.
  • βœ“Sessions with no transcript on this machine are extrapolated, with low confidence. Run the report on the machine where the work happened, or read that line with caution.
  • βœ“Behavior counts such as hedging or invented gates are heuristic until reviewed. Do not quote them to others as fact. The optional --classify pass is off by default and has a $2.00 cap per run.

Alternatives

  • documentation-and-adrs

    Pick it when you need a written record of why a project decision was made, not a cost and waste breakdown.

  • diagram

    Pick it when you want a shareable diagram from a plain description, for example to explain a workflow next to your report.

  • technical-documentation

    Pick it when the job is writing or reviewing clear docs and agent instruction files rather than reporting spend.

Questions and answers

Does the report include today's usage?

Not by default. The default window is the last 7 full days in Pacific Time, so it never holds a partial day. If you set an end date later than today, the last day is marked partial.

Which files does it create?

One folder with report.html, report.json, line-items.csv, evidence.json and labels.review.json. A report.pdf is added when Chrome is available. Without Chrome the run says the PDF was skipped and HTML is the main file.

Is the note-taker cost part of the total?

No. Note-taker (observer) tokens are priced separately at the input list price. They are never counted as agent cost and never added to the headline dollars. They appear in the details.

How it works

It analyzes AI usage logs, calculates costs based on public prices, and organizes the information into a readable report.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Agent Cost Report

Claude-Mem / Claude Code skill. Runtime is the scripts/ pipeline (transcripts β†’ tokens β†’ dollars β†’ Timing-style report) plus a progressive Mem Search review pass that confirms the drafted labels. The Notion draft is SPEC history only β€” never the product, never the runtime, never the ship vehicle.

Resolve the absolute directory containing this SKILL.md; all helper paths are relative to that directory. ${CLAUDE_SKILL_DIR} is the shortcut: python3 "${CLAUDE_SKILL_DIR}/scripts/acr.py" …. Python 3.9+ standard library only, with IANA timezone data for America/Los_Angeles; no pip installs. tzdata is the only exception to the no-pip-installs rule, and only when acr.py exits saying that timezone data is unavailable (stock Windows Python ships none): show the user the lines it printed and ask (AskUserQuestion) before installing it. On a yes, run the line for your shell (the plain quoted line in Bash or cmd, the PowerShell: line in PowerShell), then rerun the failed command. Setting PYTHONTZPATH instead needs no install. The look lives in scripts/acr/render.py, never here.

Purpose

Turn Claude-Mem activity into a manager-readable cost and failure report.

Product idea: a reusable skill that searches Claude-Mem via Mem Search, reconstructs real units of work, assigns cost and failure categories, and renders a printable report.

Insight north star

The headline is dollars, to two decimals, labeled. The dollars come from Claude Code transcripts (exact per-reply token usage) priced at OpenRouter public list prices, so they are ESTIMATED. Measured provider spend appears only when a sanctioned source gives it. Directly under the dollars: what the mistakes cost, what shipped, and both on one time axis.

Questions the report must answer

  1. What work was completed?
  2. What did each outcome cost?
  3. What was wasted through looping, hedging, wrong turns, rework, or poor routing?
  4. Were any unauthorized actions attempted?
  5. What should the manager change next?

Primary unit = cost per completed outcome (not cost per observation).

When to use

  • "Agent cost report" / "cost per outcome" / "failure economics" / "was this session worth it" / "what did the agents cost this week"
  • After a real Mem session dig when leadership needs outcome economics
  • Sample / ship packs that need self-contained HTML + JSON + CSV + evidence

Memory dig mechanics: the claude-mem mem-search skill (progressive recall).

Default scope (ALWAYS)

  • Unless the user names a specific session / range / project, the window is the last 7 full days in PT, not counting today: end = the PT midnight that started today (exclusive), start = end βˆ’ 7 days. The default window never contains a partial day (G3, Alex 2026-09-25).
  • Explicit windows: --start YYYY-MM-DD --end YYYY-MM-DD (PT calendar days, end exclusive). An explicit --end later than today marks the last day "partial, generated HH:MM PT".
  • One session: --session <content_session_id>. One project plus a period: --project <name> --start … --end … (worktrees of the project are included).
  • The report Scope strip shows the PT range, and Details list every session id in scope.

Progressive Mem Search (ALWAYS)

Follow the claude-mem mem-search three layers. Keep spend light.

  1. Search β€” get an index of IDs (titles, types, token hints).
  2. Timeline β€” only around anchors you care about.
  3. Observations β€” get_observations for the filtered IDs you will cite as evidence.

Recipe:

  1. Resolve scope (default: the last 7 full PT days).
  2. Search β†’ collect IDs.
  3. Timeline for thin context only.
  4. Observations for intended / actual / outcome / waste / rework / blocked / unauthorized / status.
  5. Group into named work items + failure events.
  6. Calculate line-item costs.
  7. Render HTML + optional PDF (+ json/csv/evidence).
  8. Keep evidence IDs in the appendix β€” do not dump entire timelines into the main report.

ADHD process bullets:

  • Search first β†’ pick IDs β†’ timeline only if context is thin β†’ fetch only needed obs.
  • Work-item titles are invented for managers ("Restore search after Chroma crash-loop"); observation titles stay evidence-only.
  • Evidence appendix lists obs IDs + short titles; main sections stay outcome-first.

…

FAQ

What are 'tokens'?

Tokens are small pieces of text that the AI processes. More text means more tokens and higher cost.

Are the costs exact?

No, costs are estimated based on public prices from services like OpenRouter. Actual costs may vary.

What are 'failure types'?

These are categories describing what went wrong, such as repetitions (looping), redoing work (rework), or wrong turns.

Details

Original description by the author

Believable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.

repo: thedotmack/claude-mem

Popularity

GitHub stars
101k
Ranking position
#1260
License
Apache-2.0
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills