Claude Code cost savings: find where tokens are wasted
Connect Claude Code to Budgethelm with one command, then ask where tokens are wasted and how much a model switch would save. Answers come with amounts, evidence and assumptions.
Connect Claude Code in one line
claude mcp add --transport http agentops https://agentops.agentops.workers.dev/api/mcp
Then type /mcp in Claude Code, pick agentops and approve in the browser. Setup for Claude (web/desktop), Cursor and Codex is on the onboarding page after you log in.
What you can ask once connected
diagnose_token_waste: finds token waste in your usage, each with an estimated monthly amount and a suggestion.estimate_savings: what each agent would save per month on a same-tier model or one or two tiers cheaper (only options saving 15% or more), with quality risks noted.recommend_model: describe a task and get 1 to 3 models with an estimated monthly cost.scan_agent_workspace: checks CLAUDE.md, AGENTS.md and MCP configs for prompt-injection risks.
All of these tools are read-only, and you pick each permission when approving in the browser.
Which kinds of waste are checked
- Repeated context: average input of 8,000 tokens or more and at least 20 times the output.
- No prompt caching: the model has a cache price, average input is 2,000 tokens or more over at least 20 calls, and under 10% is cached.
- Overly long output: average output of 1,500 tokens or more.
- Retries or runaway loops: error rate of 5% or more, or a day with more than 3 times the median call volume (median of at least 5 calls). With the Budgethelm guard installed, a run that nobody is replying to stops itself on your computer after the same error 5 times, 8 failures in a row, 25 failures in total or 500 tool calls (Claude Code, Codex CLI and Gemini CLI; Cursor has no way to be stopped from outside, so the agent is told to stop).
- Expensive models on simple tasks: short input and output on a pricier tier.
Thresholds are conservative assumptions and are shown with every result. Overlapping costs are deducted so nothing is counted twice.
You need usage data first
The Budgethelm server cannot see the logs on your computer. Usage is uploaded from your machine only after you agree: ask your agent to run a Budgethelm checkup, report with an ingest key, or upload a CSV; demo data is available to try it out. See AI agent token cost monitoring.
FAQ
- Do I need to give Budgethelm my Anthropic API key?
- No. Claude Code gets a Budgethelm token through OAuth that rotates every hour. Budgethelm never sees your model API keys.
- Will Budgethelm switch models for me?
- No. Savings estimates and recommendations are suggestions only.
- Are the savings guaranteed?
- No. They project one month from the last 30 days of usage (at least 7 days are assumed), with thresholds and assumptions listed in the result. Check them against your actual bill.