costs

Reports API-equivalent costs for Claude Code usage from session transcripts and a cost ledger.

Updated May 3, 2026
One-click install
npx skills add https://github.com/spikelab/multiplai-cc-mktplace --skill costs-spikelab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: costs
Source: https://github.com/spikelab/multiplai-cc-mktplace/tree/main/plugins/multiplai-context/skills/costs
Command: npx skills add https://github.com/spikelab/multiplai-cc-mktplace --skill costs-spikelab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Claude Code usage across chats, skills, subagents, and projects leaves no consolidated bill, making it impossible to answer questions like what a chat, branch, or pull request actually cost at API list prices. ## Core Features & Use Cases - Incremental cost collection: Scans session transcripts and appends priced records to an append-only ledger, with idempotent backfill and live pricing fetched from the official pricing page. - Flexible reporting: Aggregates the ledger by session, skill, project, model, day, component, git branch, or PR, with JSON output for post-processing. - Outcome-based cost analysis: Computes cost per merged PR or per completed build block, plus cache utilization ratios, so cross-model comparisons use per-outcome figures rather than misleading per-token numbers. - Use Case: After finishing a feature branch, ask what that PR cost; the skill resolves the branch via gh, reports its API-equivalent spend, and notes when multiple PRs share one branch's cost. ## Quick Start Ask the assistant to collect fresh cost data and report what this chat or this month's usage cost at API list prices.

Frequently Asked Questions about costs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find out what a Claude Code chat or session cost?

Run the collector first to scan recent session transcripts, then run costs_report.py with --session followed by the session id prefix found in the transcript filename. The report shows the main and subagent cost split at API list prices.

How do I calculate the cost of a pull request or git branch?

Resolve the PR's branch with gh pr view --json headRefName, then run costs_report.py --branch with that branch name. Note that several PRs cut from one branch share that branch's total cost.

Are these costs the actual amount billed on a subscription?

No, all figures are API-equivalent list prices in USD, meaning what the usage would have billed at published API rates. On a subscription plan nothing was actually billed per call, and the report should state this.

Why do some cost records show pricing_fallback warnings?

Unknown models not present in the pricing table are priced at fallback rates and flagged pricing_fallback: true in the ledger. The collector prints a warning naming them, and those dollar figures should be presented as estimates rather than list prices.

Can I compare costs between different models using per-token numbers?

No, cross-model comparisons must be per-outcome because models tokenize differently and a cheaper per-token model that loops more can cost more overall. Use cost per merged PR or per completed build block instead.