Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

cost-review

БесплатноБез исполняемых скриптовНе проверен

Analyze AI coding spend across harnesses (Amp, Claude Code, Codex) and attribute cost changes with a five-term decomposition.

jellydnот jellydn★ 130 звёзд на GitHub

Об этом скилле

Cost Review

Attribute AI coding spend instead of summing it. A total answers nothing; a per-term decomposition answers "what changed". Follow the Uber software-factory method: decompose cost into five terms and attribute the week-over-week change term by term, with no unexplained residual.

When to Use

Use when the user asks:

  • "How much are we spending on AI tools?"
  • "Why did my usage/cost jump this week?"
  • "Which model tier is worth its cost?"
  • "Set up spend nudges before I burn the budget."

Data Sources

Gather what is locally available. Never call a paid API to answer a cost question unless the user provides the key and asks for it. Cite the source next to every number; if a term cannot be observed, mark it unknown — do not invent it.

Harness Source Command / location
Amp CLI usage report, if the installed version provides one amp usage (fall back to the harness's usage tool, e.g. the MCP get_usage tool, or the Amp web dashboard)
Claude Code Local transcript JSONL npx [email protected] daily (version pinned so every review runs the same release; bump deliberately) reading ~/.claude/projects/**/*.jsonl; raw counts: ~/.claude/projects/**/*.jsonl message.usage fields
Codex Local session logs ~/.codex/sessions/**/*.jsonl token fields, or the OpenAI usage API with a user-provided OPENAI_API_KEY
Any Platform dashboards Ask the user to paste the numbers; record the source and date

Confirm the log schema before aggregating

Local logs differ per harness and per release. Before aggregating any token fields, confirm the schema you are reading and whether the counters are cumulative: where they are (Codex session logs can be), aggregate counter changes inside the reporting window, never a sum of cumulative snapshots. Check whether the input total already includes cached tokens, and price cached and non-cached input separately so nothing is counted twice. When a schema or the applicable rates cannot be confirmed, report that spend as unknown and say what would confirm it.

Method: Five-Term Decomposition

Define one unit of work (a session, a task, a PR — state which you used). Then:

cost = sessions x turns-per-session x requests-per-turn x tokens-per-request x price-per-token

Compute each derived factor as a ratio of the period's totals — turns divided by sessions, requests divided by turns, tokens divided by requests, spend divided by tokens — never as an average of per-unit values. Ratios of totals cancel across the product, so the factors multiply back to each period's total cost exactly, which is what lets the walk reconcile; an average of per-unit values does not.

For each term, compute this period and last period, then attribute the cost delta with sequential substitution: walk the terms in a fixed order — sessions, turns per session, requests per turn, tokens per request, price per token — and for each term recompute the total with that term at its current value, earlier terms at their already-updated values, and later terms at their previous values; give that term the difference from the previous step. State the order in the report, because it affects the allocation when several terms move together.

The walk is required, not cosmetic: cost is a product, so the terms' percentage deltas do not add. Example: sessions 100 → 200 and turns per session 10 → 20, tokens per request fixed. Baseline 100 × 10 = 1,000 units; observed 200 × 20 = 4,000. Substitution attributes +1,000 to sessions (200 × 10 = 2,000) and +2,000 to turns/session (200 × 20 = 4,000): the sums reconcile. Attributing each factor's own +100% to the 1,000-unit baseline would give +1,000 + +1,000 = 2,000, leaving 1,000 unexplained despite perfectly consistent data. The attributed amounts always sum exactly to the observed change; if they do not, the data or arithmetic is wrong — fix it, do not publish a residual. Uber used this to explain a 34% unit-cost dro

Полный SKILL.md на GitHub

Установить cost-review в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

evals/evals.json

FAQ

Что делает скилл cost-review?

Analyze AI coding spend across harnesses (Amp, Claude Code, Codex) and attribute cost changes with a five-term decomposition.

Как установить скилл cost-review?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл cost-review запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить cost-review с