Agent Cost Report
Has your agent generate detailed cost reports for its activities. Shows how much was spent on tokens and services.
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.
Example of what to ask your AI
“Generate a cost report for the last week, focusing on waste.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It analyzes AI usage logs, calculates costs based on public prices, and organizes the information into a readable report.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add thedotmack/claude-mem --skill Agent Cost ReportOr download just the file:
curl -L https://raw.githubusercontent.com/thedotmack/claude-mem/main/claude-mem-cursor/skills/agent-cost-report/SKILL.md -o SKILL.mdTechnical 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
- What work was completed?
- What did each outcome cost?
- What was wasted through looping, hedging, wrong turns, rework, or poor routing?
- Were any unauthorized actions attempted?
- 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--endlater 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.
- Search — get an index of IDs (titles, types, token hints).
- Timeline — only around anchors you care about.
- Observations —
get_observationsfor the filtered IDs you will cite as evidence.
Recipe:
- Resolve scope (default: the last 7 full PT days).
- Search → collect IDs.
- Timeline for thin context only.
- Observations for intended / actual / outcome / waste / rework / blocked / unauthorized / status.
- Group into named work items + failure events.
- Calculate line-item costs.
- Render HTML + optional PDF (+ json/csv/evidence).
- 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
- #800
- License
- Apache-2.0
- Updated
- 10/16/2026
Comments
- …
More skills from this repository
claude-mem-install
Helps your agent set up Claude-Mem in different environments. Allows choosing between local or remote workers and configuring observation.
thedotmack/claude-mem
mem-search
Lets your agent search past memories. Useful for recalling previous solutions or work from old sessions.
thedotmack/claude-mem
host-observer
Helps your agent respond to Claude-Mem observer tasks. It should only reply with 'skip_summary' or a full XML observation.
thedotmack/claude-mem
mem-setup
Lets your agent set up Claude-Mem with the user. It connects the user's account and configures cloud sync.
thedotmack/claude-mem
Similar skills
architecture-decision-records
Has your agent record important project structure decisions. It helps to understand the reasoning behind choices and maintain a clear history of changes.
affaan-m/ECC
code-tour
Lets your agent create step-by-step code walkthroughs with exact file and line anchors. It's useful for project introductions, code explanations, or change reviews. Helps understand how a system works.
affaan-m/ECC
codebase-onboarding
Helps your agent analyze unfamiliar code and create an onboarding guide. It includes an architecture map, entry points, and conventions. Ideal for starting on a new project.
affaan-m/ECC