# Model Savings

Estimate the dollars saved by routing eligible Claude Code work to a cheaper model...

- Repository: https://github.com/hoangsonww/Claude-Code-Agent-Monitor (1136 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill model-savings -g -a claude-code -y`
Codex: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill model-savings -g -a codex -y`
Cursor: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill model-savings -g -a cursor -y`
Gemini CLI: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill model-savings -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor`

## Description

Estimate the dollars saved by routing eligible Claude Code work to a cheaper model family, using the Agent Monitor pricing engine. Re-prices each model's token mix at the target family's rates and quantifies the delta. Uses /api/pricing (rates), /api/pricing/cost (current per-model spend), /api/sessions, and /api/analytics. Use when hunting for cost cuts or comparing model tiers.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Model Savings

Quantify how much spend you would recover by moving eligible work to a cheaper model.

## Input

The user provides: **$ARGUMENTS**

This is the routing question, e.g. `"Opus → Sonnet"`, `"move simple work to Haiku"`,
or empty (analyze every premium model against the next tier down). If no target family
is named, default to proposing the next-cheaper tier per model and say so.

## Data Sources

| Endpoint | Returns |
|----------|---------|
| `GET /api/pricing` | `{ pricing: [{ model_pattern, display_name, input_per_mtok, output_per_mtok, cache_read_per_mtok, cache_write_per_mtok }] }`, the rate card for every family |
| `GET /api/pricing/cost` | `{ total_cost, breakdown: [{ model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost, matched_rule }] }`, current spend and the exact token mix per model |
| `GET /api/sessions?limit=200` | Sessions with `model`, inline `cost`, and `metadata` (turn_count, thinking_blocks), used to judge which work is *eligible* to downshift |
| `GET /api/analytics` | `agent_types`, `tool_usage`, `total_subagents`, corroborate which task types are low-complexity and safe to route cheaper |

## Savings method

For each candidate model in the cost `breakdown`, re-price its **exact token mix** at the target family's rates:

```
cost_at_target = (input_tokens      / 1M) × target.input_per_mtok
               + (output_tokens     / 1M) × target.output_per_mtok
               + (cache_read_tokens / 1M) × target.cache_read_per_mtok
               + (cache_write_tokens/ 1M) × target.cache_write_per_mtok

savings = current_model_cost − cost_at_target
```

Pull `target.*_per_mtok` from `/api/pricing` (longest `model_pattern` match wins). Default rates ($/Mtok in/out/cacheRead/cacheWrite): **Opus** $5/$25/$0.50/$6.25, **Sonnet** $3/$15/$0.30/$3.75, **Haiku** $1/$5/$0.10/$1.25.

### Eligibility, don't promise savings on work that needs the big model

The rest: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/blob/HEAD/plugins/ccam-cost-guard/skills/model-savings/SKILL.md
