Audit Claude Code spend

    1

    Where the spend went, per model and per prompt - cross-checked against which model actually answered.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Audit Claude Code spend

    Example session with this skill installed

    Why was this month so expensive, and am I paying for a model I did not ask for?

    • Read your context and instructions
    • Compiled the audit claude code

    Summary

    Total $97.40. 78% of the prompt bill was cache reads — billed at a lower rate, but they dominate volume.

    ModelRequestsCostShare
    claude-sonnet812$61.1062.7%
    claude-opus96$31.8532.7%
    claude-haiku204$4.454.6%

    Substitutions

    3 turns were answered by claude-opus while claude-sonnet was requested. Cost impact: $2.10.

    Where to look next

    The top 5 prompts account for 41% of the bill. The long context is the driver, not the request count.

    Read-only. This is a report, not a bill — the client's own pricing table marks unknown models, and that is surfaced.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A spend total on its own is not actionable. The useful questions are which model ate the budget, and how much of each turn was cache rather than fresh input.

    This skill reports spend per model and per project, cost per prompt, and the cache hit rate - and it cross-checks the model column against the model that actually answered, because a request for one model answered by another is billed as the other.

    Two honest limits, stated in the output rather than buried:

    • The figure is the client's own estimate from its pricing table. It is not a bill. If the client flags a model as unknown-priced, the total is labelled a placeholder, not an estimate.
    • Resumed sessions replay their history into a new file with the same cumulative cost. Files are de-duplicated by session id before anything is summed; on the machine this was built on, that was the difference between ~$397 and $3,562.

    Read-only. Node 20+.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Requires Node.js 20+. Estimates only; does not access live billing APIs. Sessions without cost-state records are excluded from totals.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 2 days ago

    • Free with an Agensi account

    Software
    Node.js

    Permissions

    Terminal / Shell
    Read Files
    Listed2 days ago

    What's inside

    Frequently Asked Questions

    This skill solves the 'black box' problem of API billing by parsing your local Claude Code logs to extract precise, session-level cost estimates and identifying if you were billed for a more expensive model than you requested.

    The skill is designed specifically for Node.js environments (v20+) and interacts with the Claude Code filesystem; it works by executing internal JS scripts via Bash to analyze your local session records.

    Yes, the skill includes a specific 'substitution auditing' feature that compares the model you requested against the model that actually responded to detect costly discrepancies.

    You receive a suite of specialized analysis scripts, including `cf-cost.mjs` for spend aggregation and `cf-analyze.mjs` for substitution detection, along with documentation for integration.

    Because local logs often repeat cost-state records every turn, this tool uses logic to identify only the final, accurate record per session, preventing the double-counting errors common with manual analysis.

    While highly accurate for internal budgeting and workflow optimization, the output is an estimate based on local records and should not be used as a legal or definitive billing statement against a provider.

    New in LLM Ops

    Free