LLM Cost Diff — Catch Cost Regressions Before You Deploy
Compare two LLM runs, see cost per task change in one number, and get the biggest driver named in the first line of the report.
$19
LLM Cost Diff — Catch Cost Regressions Before You Deploy
Example session with this skill installed
Compare before.jsonl and after.jsonl using the local pricing.json and tell me why the costs went up in the latest run.
- Read your context and instructions
- Compiled the llm cost diff
I have analyzed the trace files before.jsonl (340 tasks) and after.jsonl (340 tasks). The analysis isolates cost changes per completed task to ensure the comparison is not skewed by volume.
LLM Cost Diff Report
Cost per completed task changed by +42.8% ($0.0142 -> $0.0203).
Biggest driver: Output Tokens — average output tokens per task rose from 410 to 890 following the prompt change.
Cost Summary
| Metric | Before | After | Change |
|---|---|---|---|
| Total Cost | $4.82 | $6.90 | +43.1% |
| Cost / Completed Task | $0.0142 | $0.0203 | +42.8% |
| Success Rate | 98.2% | 97.9% | -0.3% |
| Retry Share | 2.1% | 12.4% | +10.3% |
Top Contributors by Model (After Run)
| Model | Total Cost | % of Total |
|---|---|---|
| gpt-4o | $5.85 | 84.8% |
| gpt-4o-mini | $1.05 | 15.2% |
Analysis
The primary increase is driven by a significant jump in output verbosity. While the success rate remained stable, the new prompt instructions resulted in 2.1x more output tokens. Additionally, the
Retry Share increased to 12.4%, suggesting that the new logic is causing more frequent tool-call failures or timeouts that require a second attempt.
Next steps
- Review the
max_tokensparameter and verbosity instructions in the new prompt to trim unnecessary output. - Inspect the logs for tasks with
retries > 0to identify if a specific tool is failing under the new model instructions. - Update
pricing.jsonif you are using tiered volume discounting not reflected in the default rates.
Connects securely to your tools. The creator never sees your data.
About this skill
Your prompt change looked harmless. Three weeks later the API bill says otherwise. LLM Cost Diff is a local tool + agent skill that compares two recorded runs of the same workload — before and after a prompt, model, or code change — and tells you exactly what the change did to your cost: total cost and cost per completed task, before vs after, with % change; the single biggest driver, named in one sentence at the top of the report (retries, output tokens, input tokens, or call volume); estimated retry cost and retry share — the silent bill-killer; top cost contributors by task and by model, so you fix the right thing. It runs entirely on the buyer's machine: no account, no hosted dashboard, nothing phones home. Traces are simple JSONL files — one aggregated line per task. If your logs are per-request (the shape most tools export), the included importer aggregates them into per-task traces in one command. Prices live in an editable pricing.json, so it works with any provider — and with local models you price yourself. Includes a synthetic sample (before/after traces + generated report) so you can see the exact output before wiring up your own traces: a realistic regression where cost per completed task jumps +85.2% and the report correctly fingers retries, not the longer prompt. What's inside: llm_cost_diff/ CLI tool (Python 3.12, standard library only) including the per-request log importer; SKILL.md agent skill (when to run it, how to read the report, pre-deploy cost checklist); pricing.json editable model prices; sample_data/ synthetic before/after traces; sample reports; tests/ pytest suite proving the cost math; README and LICENSE. Who it's for: indie devs and small teams shipping LLM features who change prompts or models and want a cost check in the loop — the way they already have a test check.
Does not support real-time billing APIs. Requires manual pricing updates. Task IDs must be stable between before/after traces for accurate diffing. Trace files must follow strict JSONL schema.
How to use
- 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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 8 days ago
- Software
Python
Permissions
What's inside
Frequently Asked Questions
New in LLM Ops
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.