How to Cut Your Claude Code Token Spend Without Losing Quality

Where Claude Code usage really goes and the habits that cut it: measuring with /usage, clearing and compacting, model and effort choice, and a leaner CLAUDE.md

When people run out of Claude Code usage halfway through the week, they usually blame their prompts. The prompts are rarely the problem. The spend goes to context: on every turn, Claude Code sends the whole conversation again, along with your CLAUDE.md, your tool definitions and every file and log it has read so far. I build my apps with Claude Code every day, and my cheapest sessions are also the ones where Claude does its best work. A lean context costs less and thinks better.

Measure before you change anything

You cannot cut what you cannot see. Start with two built in commands.

  • /usage shows where you stand. On a Pro, Max, Team or Enterprise plan you get your plan usage bars plus a breakdown of what counted against them: skills, subagents, plugins and individual MCP servers, with behaviors like long context or cache misses flagged when they take a big share. On API billing, the Session block shows token counts and a dollar estimate. /cost is an alias for the same screen.
  • /context draws a grid of what is in your context window right now: system prompt, tools, memory files, skills and conversation. If one category is huge, that is where to start.

Then put the number where you will see it all the time. Run /statusline and describe what you want in plain words:

/statusline show the model name and how full the context window is as a percentage

Watching that percentage climb while you work changes your habits faster than any checklist.

Clear between jobs, compact within a job

This is the habit that saves the most. Two commands, two different situations.

  • New, unrelated task: run /clear. The old conversation is dead weight that gets resent on every message. Clearing costs nothing. If you might come back, name the session first with /rename and return later with /resume.
  • Same task, long thread: run /compact with a focus, so the summary keeps what matters to you instead of what the automatic pass guesses.
/compact Keep the goal, the decisions we made about the checkout flow, the files we changed, and the failing test. Drop the exploration.

One thing people miss: compacting reads the entire conversation it summarizes, so on a huge session it is a large request itself. When you do not need continuity, /clear is the cheaper move.

Match the model and the effort to the job

Most work does not need the biggest model. My default split looks like this:

  • Sonnet for everyday building: features, refactors, copy changes, most bugs.
  • Opus for architecture decisions and bugs that already beat Sonnet twice.
  • Haiku for mechanical work: renames, formatting, simple conversions.

Switch with /model. There is also an opusplan alias that uses Opus while you are in plan mode and Sonnet when it executes the plan, which is a good fit for bigger features.

Effort matters as much as the model. Thinking tokens are billed as output, so a simple edit at high effort pays for reasoning it does not need. Run /effort low or /effort medium for bounded tasks and /effort auto to go back to the default. Keep in mind that a session or weekly limit on a subscription is shared across models, so switching models will not bring you back once you hit it. Pick the right one early.

Put your CLAUDE.md on a diet

Your CLAUDE.md loads at the start of every session, so every line is a small tax on every task. Anthropic's own guidance is to aim for under 200 lines per file. Keep only what is true for almost all work: how to run and test the project, conventions Claude would get wrong, and hard constraints.

Everything else has a better home:

  • Multi step procedures (release steps, a review checklist) go into a skill. Only a short description sits in context until the skill is used.
  • Rules for one part of the codebase go into .claude/rules/ with a paths field, so they load only when Claude touches matching files.
---
paths: ["src/api/**/*.ts"]
---
# API rules
Validate every request body with the shared schema helpers.
Return errors in the standard error shape.

If your CLAUDE.md is checked in, run /doctor. It proposes trims, cutting things Claude can read from the code itself, like directory trees and dependency lists.

Keep noisy output out of your main thread

Test suites, build logs and documentation pages can dump thousands of lines into your context. Once they are in, you pay for them on every following turn.

  • Use subagents for noisy jobs. A subagent works in its own context window and hands back a summary. Ask for it directly:
Use a subagent to run the full test suite and report only the failing tests, with file, line and error message.
  • Filter output with a hook. A PreToolUse hook can rewrite a test command so only failures come back. The official cost guide has a working example you can copy.
  • Prefer CLI tools. If a command line tool like gh does the job, it is lighter than an MCP server. Run /mcp and disable servers you are not using in this project.

Stop wrong turns early

The most expensive tokens are the ones spent building the wrong thing and then undoing it.

  • Plan first. Press Shift+Tab to cycle into plan mode for anything non trivial. Reading a short plan is cheaper than reviewing a long wrong diff.
  • Be specific. "Improve the app" makes Claude scan everything. "Add an empty state to the orders list in OrdersView, match the style of the existing empty state in Settings" does not.
  • Interrupt. Press Esc the moment Claude heads the wrong way. Press Esc twice or run /rewind to go back to an earlier checkpoint instead of arguing with a broken approach.
  • Mind the break. Prompt caching makes a warm session cheap, but the first message after a long break reprocesses your full context. On a subscription the cache lasts about an hour. If you come back after lunch to a giant session, a fresh start with a short handoff note is often cheaper.

Do not try all of this at once. Pick one real task this week, run /usage and /context before and after, and change one habit at a time. Start with /clear between unrelated jobs and a trimmed CLAUDE.md. Those two alone make a visible difference, and the rest is easier to judge once you have a number to watch.

More in Claude Code

← All guides