Claude Code cost controls for daily drivers, staying under 30 dollars a day in 10 steps
How to control token usage, pick the right model and reduce MCP overhead. Concrete slash commands, settings, patterns from real daily use.
Anthropic itself says the average is 13 dollars per developer per day. 90 percent stay under 30 dollars. When you blow out the top, it is almost never the model. It is almost always the context that gets dragged along, MCP servers that do nothing, an Opus that does a format fix. This playbook shows how I get a grip on this day to day. You don't need an extra tracker, Claude Code brings everything with it.
1. Hit /usage once an hour
The built-in command is /usage. The aliases /cost and /stats work the same. What it shows: total cost (estimated locally from token counts), API duration, wall duration, lines added/removed. The dollar sign is an estimate, not the bill. For the real billing there is the usage page in the Claude Console.
My workflow: I hit /usage at the start of a session and after every larger block. If I am already at 4 dollars after 30 minutes even though the task was small, I know something went wrong. Usually an MCP server that loads tools uncontrollably or a file that keeps getting read in again.
Anyone on Claude Pro or Max sees no dollar value but plan usage limits. Still useful, you see how fast you burn through your quota.
2. Switch /model deliberately, not everything in Opus
The official recommendation is clear: Sonnet for almost everything, Opus only for complex architecture decisions or multi-step reasoning. Haiku for simple subagent tasks.
I almost always start in Sonnet. When I notice the task is trivial (format fix, doc update, refactor with a clear pattern), I switch with /model to Haiku. When I notice this will get hard (new architecture, performance debug, tricky bug), I go to Opus. But deliberately and back again when it is no longer needed.
Setting the default goes through /config. If you have been starting in Opus, switch to Sonnet. You will barely lose any quality.
3. Set subagents to haiku
When you write subagents or slash commands, a model field belongs in the YAML frontmatter. Example for a format command:
---
description: Format code file
model: haiku
---
Haiku is a fraction of the cost and handles such tasks without trouble. If you don't get into this habit, every small sub-call runs in the model that is currently active. With an Opus default that is really expensive, because subagents often run in a loop.
The rule of thumb I use: format / lint / json-parse / small classification → haiku. Code review / refactor / write test → sonnet. Plan architecture → opus.
4. /clear between unrelated tasks
Stale context costs tokens on every single follow-up message. When you have just fixed a bug in the auth component and now want to do something on the newsletter layout, the old auth context has zero value. But it gets sent along with every prompt.
/clear makes a hard cut. Hit /rename beforehand so you find the session again later, then /resume in case you have to go back. That is the only command with which you really get rid of tokens, everything else just compresses.
My rhythm: every 60 to 90 minutes or when I switch topics. Better too often than too rarely.
5. Read /context to see who really eats space
/context shows what is in the context window. Whoever eats space there belongs out. Classic suspects are: MCP servers that load their tools fully, huge files that Claude dragged in 20 messages ago, long tool outputs from earlier steps.
If /context shows that a certain MCP server occupies 8000 tokens even though you haven't used it this session yet, consider whether it even needs to be in. Taking it out of .mcp.json or disabling it via plugin toggle is often the clean solution.
6. Use /compact with your own instructions
When you get close to the limit, Claude Code summarizes automatically. The default behavior is okay, but you can control what gets kept. Example:
/compact Focus on code samples and API usage
This often saves the 30 percent that were really relevant. Default compaction sometimes throws away exactly the file paths you need in the next step.
You can also write compaction instructions into CLAUDE.md so every compact runs the same:
# Compact instructions
When you are using compact, please focus on test output and code changes
7. Prefer CLI tools over MCP servers when possible
The Anthropic docs say it themselves: MCP tool definitions are deferred (only names load until a tool is used), but as soon as you make a tool call the full definition comes in. CLI tools like gh, aws, gcloud, docker need no MCP server, Claude can call them via Bash and the output is deterministically small.
So if you can choose between the GitHub MCP server and simply gh pr list via Bash, Bash is often cheaper and faster. MCP servers pay off mainly for complex API surfaces (Stripe, Notion, your own backends) where a CLI is missing or painful.
8. Anticipate auto-compaction instead of being surprised
Claude Code compacts automatically when you get close to the context limit. The problem: the compaction itself costs tokens and you lose detail. If you see this early enough, you can hit /clear or /compact deliberately before the auto behavior kicks in.
/usage shows you current token counts. A statusline configuration that displays this permanently helps enormously. Up in the Anthropic docs there is the hint: configure your status line to display it continuously. Do that. One second of setup, saves surprises forever.
9. Set spend limits at the workspace level
If you run over the API (not Pro/Max), you can set workspace spend limits in the Claude Console. That is the only hard brake. Anthropic enforces rate limits on three axes: RPM (requests per minute), ITPM (input tokens per minute) and OTPM (output tokens per minute), per model class and per usage tier.
Concrete Tier 1 limits per the official docs: Sonnet 4.x or Opus 4.x are at 50 RPM with 30,000 ITPM and 8,000 OTPM. Haiku 4.5 has 50 RPM with 50,000 ITPM and 10,000 OTPM. Tier 2 jumps to 1,000 RPM with 450,000 ITPM for Sonnet/Opus/Haiku-4.5. Tier 3 is 2,000 RPM, Tier 4 is 4,000 RPM. You move into the next tier when you reach the respective credit threshold (Tier 1 from 5 USD paid in, Tier 2 from 40 USD, Tier 3 from 200 USD, Tier 4 from 400 USD).
Important for daily-driver cost optimization: cache reads do NOT count against your ITPM limit on most models. Only input_tokens (after the last cache breakpoint) and cache_creation_input_tokens are counted. cache_read_input_tokens is free. So with an 80 percent cache hit rate you get 5x the effective throughput out of the same tier limit. Set workspace spend limits in the Console, hard brake active.
Pro/Max uses plan quotas instead of spend limits. If you are on a plan and see tearing quotas, that usually means you need no cost tooling at all, you need quota discipline.
With Bedrock, Vertex or Foundry there are no Anthropic metrics, there the docs recommend LiteLLM as an open-source tracker. Not audited by Anthropic, so decide deliberately.
10. Use agent teams only with a plan
Agent teams (multiple Claude Code instances working in parallel) scale token consumption linearly with team size. Each teammate has its own context, loads CLAUDE.md, MCP servers, skills. That gets expensive fast.
Defaults per the Anthropic docs: agent teams are off by default. You have to set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 in settings.json or the environment. If you use them, three rules: Sonnet for teammates (not Opus), keep teams small, end teams when the job is done (idle teammates keep burning tokens).
That is exactly the lever with which 30 dollars per day quickly become 200 dollars, if you don't watch out.
What comes next
When you have all this in place and still run too high, take a look at the playbook hooks-gegen-halluzinationen. Wrong tool calls that run in a loop are often the true token killer, not the model. And the recipe 2.5-github-mcp shows how you configure MCP servers more leanly.
Source
- code.claude.com/docs/en/costs (official, retrieved 2026-04-27)
- code.claude.com/docs/en/commands (official, retrieved 2026-04-27)
- Frontmatter field model, github.com/anthropics/claude-code Plugin-Dev Skills (official)
- platform.claude.com/docs/en/api/rate-limits (official, tier tables retrieved 2026-04-27)
- CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS confirmed via github.com/anthropics/claude-code issues #23420, #25375, #29660, #29766, #32368