# 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.

LLM Cost Diff — Catch Cost Regressions Before You Deploy is a paid AI agent skill on Agensi by LINH RATHHENRY, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $19 (one-time purchase)
- Creator: [LINH RATHHENRY](https://www.agensi.io/creators/linh-rathhenry)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.1
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/llm-cost-diff-catch-cost-regressions-before-you-deploy
- Tags: llm-ops, python, cost-optimization, observability, jsonl

## 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.

## Requires

- Python

## Known limitations

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 this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the LLM Cost Diff — Catch Cost Regressions Before You Deploy skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What is the primary benefit of using LLM Cost Diff over simply checking my provider's billing dashboard?

This skill compares LLM trace files from different runs to calculate precise cost-per-task changes, helping you identify if an API spend increase is due to token verbosity, model pricing, or inefficient retry logic.

### Which AI agents or development frameworks are compatible with this skill?

The skill is framework-agnostic and works with any Python-based environment; as long as your agent logs input/output tokens, model names, and task IDs to JSONL, this tool can analyze the data.

### Do I need to connect my live OpenAI or Anthropic accounts for this skill to function?

No, this is a local analysis tool designed for pre-deployment audits and post-incident reviews, meaning it does not require access to your live production environment or provider API keys.

### What is included in the purchase of this skill?

You will receive the Python-based analysis tool, a schema for trace preparation, a customizable pricing configuration file, and templates for generating Markdown or HTML cost reports.

### How does the tool handle changes in model pricing from providers like OpenAI or Anthropic?

Since providers frequently update their rates, the skill includes a `pricing.json` file that you can manually update to ensure your cost diffs reflect the most current market prices.

### What happens if my task IDs change between different versions of my prompt?

For the most accurate results, you should ensure that the Task IDs remain stable between your 'before' and 'after' trace files so the skill can correctly map and compare the cost of specific operations.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
