Chuyển đến nội dung
Skillpedia
Tài liệu kỹ thuật101k · #1260

Agent Cost Report

Skill này làm gì

Agent này tạo báo cáo chi tiết về chi phí sử dụng các công cụ AI như Claude Code. Nó ước tính chi tiêu cho token và xác định những chỗ lãng phí.

Khi nào nên dùng

  • ✓Khi lãnh đạo cần biết chi phí của các dự án AI.
  • ✓Khi bạn vừa có một phiên sử dụng cường độ cao và muốn hiểu lợi tức đầu tư (ROI).
  • ✓Khi bạn muốn phân tích lãng phí như lặp lại hoặc lỗi trong các tác vụ AI.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedotmack/claude-mem/blob/main/claude-mem-cursor/skills/agent-cost-report/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo báo cáo chi phí cho tuần qua, tập trung vào các chỗ lãng phí.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent phân tích nhật ký sử dụng AI, tính chi phí dựa trên giá công khai và sắp xếp thông tin thành một báo cáo dễ đọc.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

…

Câu hỏi thường gặp

“Token” là gì?

Token là những đoạn văn bản nhỏ mà AI xử lý. Văn bản càng nhiều thì số token càng lớn và chi phí càng cao.

Chi phí có chính xác không?

Không hoàn toàn. Chi phí được ước tính dựa trên giá công khai của các dịch vụ như OpenRouter. Chi phí thực tế có thể khác.

“Failure types” là gì?

Đây là các loại mô tả điều gì đã sai, như lặp lại (vòng lặp), làm lại công việc (rework) hoặc đi sai hướng.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
101k
Vị trí xếp hạng
#1260
Giấy phép
Apache-2.0
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự