Agent Cost Report
できること
このエージェントは、Claude Codeのような AIツールの利用コストについて、詳しいレポートを作成します。トークンの料金を見積もり、無駄な部分を見つけます。
使う場面
- ✓AI プロジェクトにかかる費用を管理者に報告する必要があるとき。
- ✓集中的に使ったあとに、投資対効果を把握したいとき。
- ✓繰り返しやエラーなど、AI 作業の無駄を分析したいとき。
スキルのリンク
https://github.com/thedotmack/claude-mem/blob/main/claude-mem-cursor/skills/agent-cost-report/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“先週の利用について、無駄に注目したコストレポートを作成してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AI の利用ログを分析し、公開されている料金をもとにコストを計算して、読みやすいレポートにまとめます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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.
…
よくある質問
「トークン」とは何ですか?
トークンとは、AIが処理する小さな文字のまとまりのことです。文章が長いほどトークンが増え、コストも高くなります。
コストは正確な金額ですか?
いいえ。OpenRouter などのサービスの公開料金をもとにした見積もりです。実際の金額とは差が出ることがあります。
「失敗の種類」とは何ですか?
何がうまくいかなかったかを分類したものです。同じ作業の繰り返し(ループ)、やり直し(手戻り)、作業の方向を誤ったケースなどがあります。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 101k
- ランキング
- #1260
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
claude-mem-install
101kエージェントが、さまざまな環境でClaude-Memをセットアップするのを支援します。ローカルのワーカーとリモートのワーカーを選択でき、オブザベーションの設定も行えます。
mem-search
101kエージェントが過去のメモリを検索するのを支援します。以前の解決策や古いセッションでの作業を思い出すのに役立ちます。
host-observer
101kエージェントが、Claude-Memのオブザーバーのタスクに応答するのを支援します。返答は'skip_summary'か、XML形式の完全なオブザベーションのいずれかのみです。
mem-setup
101kエージェントが、ユーザーと一緒にClaude-Memをセットアップするのを支援します。ユーザーのアカウントを接続し、クラウド同期を設定します。
似ているスキル
technical-documentation
394k明確な技術ドキュメントやエージェントの指示ファイルを書いて確認し、人やAIツールが簡単に従えるようエージェントを支援します。
architecture-decision-records
280kエージェントがプロジェクト構成に関する重要な決定を記録できるようにします。選択の理由を把握しやすくし、変更履歴を明確に残すのに役立ちます。
code-tour
280kエージェントが正確なファイル名と行番号を示しながら、コードを段階的に解説できるようにします。紹介、説明、レビューに役立ちます。