Dinoradar  /  Blog  /  Reduce costs
CostBy Updated July 20268 min read

How to reduce Claude Code costs

Seven levers that cut your bill without cutting output quality — ordered from one-setting quick wins to habits that compound.

THE LEVERS, BIGGEST FIRST Context size — re-sent every turn biggest Model choice — Opus vs Sonnet vs Haiku Prompt caching hit-rate Thinking / effort Verbosity

TL;DR

  • Default to Sonnet; save Opus for the genuinely hard stuff (≈5× cost).
  • Keep context lean — it's re-sent every turn, so it's usually the biggest bill driver.
  • Maximize prompt caching by keeping sessions going instead of restarting cold.
  • Don't over-think easy tasks; trim verbose output.
  • Measure — you can't cut a cost you can't see.

If you haven't yet, our companion guide on how much Claude Code costs explains why these levers exist. This one is the how — in rough order of impact.

1. Pick the right model (the 5× quick win)

Per token, Opus costs about 5× Haiku and Sonnet sits in the middle. The mistake is running Opus for everything. Make Sonnet your default — it handles the vast majority of coding well — and only switch to Opus for genuinely hard reasoning: a gnarly refactor, a subtle bug, architecture work. Drop to Haiku for trivial edits and boilerplate. This is one setting and it's the single biggest one-time saving most people can make.

2. Keep your context lean

This is the sleeper. The API is stateless, so every message re-sends the entire conversation as input tokens. A session where you've loaded three big files and chatted for an hour pays for all of that on every turn. Habits that help:

  • Run /clear when you move to an unrelated task instead of letting one session sprawl.
  • Don't paste whole files when a function will do.
  • Keep sessions focused on one problem — shorter, tighter conversations are cheaper conversations.

3. Let prompt caching do its job

Claude Code caches the stable prefix of your prompt automatically, and cache reads cost ~10% of full input price. The way to benefit is to not fight it: keep a session running rather than restarting cold (a cold start re-writes the cache at full price), and avoid churning the early part of the context, which invalidates everything after it. The longer a focused session runs, the more of your input becomes cheap cache reads.

The catch — you can't see it. Nothing in the terminal tells you your cache hit-rate or how much it saved. Dinoradar reads your local history and shows exactly that, per session and per week — so you can tell whether your habits are actually helping. See it free →

4. Don't over-think easy tasks

Deeper reasoning generates more tokens before the answer arrives. That's worth it on a hard problem and pure waste on "rename this variable." Match effort to difficulty — reach for heavy reasoning when a task genuinely needs multi-step thinking, and keep it light for the routine stuff.

5. Trim verbose output

Output tokens cost ~5× input, so long-winded answers and giant generated files add up fast. If you keep getting essays when you wanted a one-liner, say so in your prompt — "keep it concise, code only." Smaller answers, smaller bill.

6. Right-size subscription vs API

If your usage is steady and heavy, a flat Max plan is often cheaper than pay-as-you-go and removes bill anxiety entirely — you simply can't overspend. If your usage is spiky, API billing only charges for the weeks you actually work. Picking the wrong billing model can quietly cost you more than any per-token tweak.

7. Measure — then the rest is easy

Every lever above is guesswork until you can see the number. Check your spend three ways:

  • /cost in a session for a rough running total (API billing).
  • ccusagenpx ccusage for terminal cost tables. (See Dinoradar vs ccusage.)
  • Dinoradar — a native macOS dashboard showing spend, cache savings, and how you work, computed locally.

Watch the number for a week, pull one or two levers, watch it move. That feedback loop is what actually brings a bill down — not any single trick.

Frequently asked

What's the fastest way to cut my Claude Code bill?+

Make Sonnet your default model and only reach for Opus on genuinely hard problems. Model choice alone swings per-token cost by about 5×, and it's a one-setting change.

Does clearing context save money?+

Yes. Every turn re-sends the whole conversation as input tokens, so a bloated context makes every message more expensive. Running /clear between unrelated tasks and keeping sessions focused keeps input tokens down.

How does prompt caching lower cost?+

Claude Code caches the stable prefix of your prompt, and cache reads cost roughly a tenth of full input price. Keeping a session going (instead of restarting cold) and not churning the early context maximizes cache hits.

How do I know if my changes actually reduced cost?+

Measure before and after. Use /cost, the ccusage CLI, or Dinoradar — which visualizes spend and cache savings per session and week from your local history, so you can see the effect of each change.

Cut what you can measure.

Dinoradar shows your spend and cache savings locally, so you can tell which changes actually work. Free forever · Pro $29 once.