
Claude Cost Optimizer

One command grades your Claude Code setup, prices your last 30 days of usage, and prints the fixes. Nothing to install and no signup. It needs Python 3.10 or later, and once downloaded the script reads only local files.
curl -sSL https://raw.githubusercontent.com/Sagargupta16/claude-cost-optimizer/main/tools/claude-rate/rate.py | python3 - . --user --usage --fix
Windows PowerShell:
irm https://raw.githubusercontent.com/Sagargupta16/claude-cost-optimizer/main/tools/claude-rate/rate.py | python - . --user --usage --fix

The tool's real output on this repo (project grade only), rendered by scripts/render-terminal-demo.py.
Add --what-if fable-5-2 (or any model) to reprice your own recorded tokens on that model. Every flag is in Rate your setup.
Cut Claude Code costs with sourced levers: cache reads bill at 5% of input on Opus 5.5 and Sonnet 5.5, Haiku 5.5 costs 1/40 of Opus 5.5 per token (prompts up to 100K tokens), and Batch is 50% off (Anthropic pricing) -- with an installable skill, CLI tools, and 12 deep-dive guides.
No one has published a typical saving for a mixed Claude Code workload, so this repo does not quote one. What is measured: prompt caching cut cost by a factor of 4.8 to 7.2 on a research agent and by 83% to 86% on a small triage agent (Anthropic's cost guide, read 2026-11-01); Anthropic's cost-optimization cookbook stacked model choice, effort and caching on one agent for a 13x lower cost per task ($0.2906 to $0.0223, 10/10 tasks passed both ways); and the cost guide's search over effort and model on tau2-bench retail cut cost per task 61% ($0.142 to $0.055) within a 2-point pass-rate band. See How far can you actually go?, and price your own sessions with /usage or claude-rate.
Live site: sagargupta.online/claude-cost-optimizer -- Repo Analyzer | Cost Calculator | Badge Checker. How the pieces fit: How It Is Built.
 |  |
| Repo Analyzer: paste a public repo, get a grade and the fixes | Cost Calculator: cache-aware monthly spend and where it goes |
Screenshots come from scripts/capture-screenshots.py (Playwright against a local build, 1440x900 and 390x844), which also renders the site's 1200x630 social preview image.
Install
Claude Code (official plugin system):
/plugin marketplace add Sagargupta16/claude-cost-optimizer
/plugin install cost-mode@claude-cost-optimizer