StateSyncDocs

DocsCutting agent costs

How to reduce Claude Code costs

The free fixes that keep a Claude Code bill down, and what StateSync adds on top.

Where the money goes

Claude Code works in a loop. It reads the conversation, calls a tool, adds the result, then sends everything again. A file it read early on is paid for on every call after that.

On the run behind our numbers, 94 percent of the plain agent's tokens were that resend, billed at the cache read price. What the model actually wrote was a small share of the bill.

The free fixes

All built in. Do these first, whatever else you use.

  1. Clear between tasks

    /clear stops the next task paying to carry the last one. It is the biggest free saving there is.

  2. Compact at a switch, not mid-task

    Run /compact when a plan is agreed or a change lands, and say what to keep: /compact keep the failing test names. Mid-task it drops detail the agent still needs.

  3. Match the model to the job

    Small fixes and tests rarely need the largest model. /model switches mid-session.

  4. Keep CLAUDE.md short

    It loads into every session, so every line is paid for on every call. Keep commands and conventions. Move long explanations into files the agent can read when it needs them.

  5. Ask for narrow reads

    Name the file and the function. Ask for the failing test, not the whole run, and git diff on a path, not the tree. Every line returned rides along on every later call.

  6. Use subagents on purpose

    A subagent keeps exploration out of the main thread, but it pays for its own reads. Use one for research, not for every small task.

  7. Keep the start of the session stable

    Prompt caching makes the resend cheaper. Editing CLAUDE.md mid-session throws the cache away and the next call pays full price.

  8. Check /cost

    /cost shows what a session spent on API billing. When one feels expensive, find the call that made it so.

What habits cannot do

Habits work between tasks, or when you remember them. None of them can look at each result as it comes back and keep only what the next step needs. That happens hundreds of times in a task.

Where StateSync fits

StateSync is a desktop app that runs Claude Code on your own account. As each result arrives, it carries forward the part the agent will use, and the whole result is one call away if it needs it. A local map of your code means the agent starts near the right file. Same model, same account, nothing to configure.

+86%more work for the same spendquality no lower on average
46% lowercost to finishcheaper on 53 of 55 tasks
48% fasterwall clocksame tasks, same model
No lowerquality on average: higher on 15, level on 34, lower on 6scored on every task

Short tasks save the least.

Banded by how long the task took the plain agent.
Task lengthTasksCost savingCheaper
Under 2 minutes1827%17 of 18
2 to 4 minutes2750%27 of 27
4 minutes and up1050%9 of 10

Measured by us on the TokenBench 55-task set, on Claude Code with Claude Sonnet 4.6, with one StateSync run per task against the plain agent's earlier runs. See every task, losses included.

On a Max plan

Your bill is flat, so the saving shows up as room. Fewer requests and tokens per task means more work before you reach a session or weekly limit. On the run that was 29 percent fewer requests and 45 percent fewer tokens for the same work.

Where to start

  • Today: /clear between tasks, /compact at a switch, a shorter CLAUDE.md.
  • This week: a default model for each kind of task, and narrower reads.
  • Then try StateSync: install it, open your project folder, start a chat and pick Claude Code. The Account page in the app shows what you saved.

Other tools cover parts of this. The comparison sorts them by what they act on.

Sources

  1. Anthropic, Claude Code: manage costs effectivelycode.claude.com/docs/en/costs
  2. Anthropic, Claude Code: memory and CLAUDE.mdcode.claude.com/docs/en/memory
  3. Anthropic, Claude Code: subagentscode.claude.com/docs/en/sub-agents
  4. Anthropic, prompt cachingdocs.anthropic.com/en/docs/build-with-claude/prompt-caching
  5. TokenBench harness, our 55-task rungithub.com/Silverspine1/TokenBench

Something missing or wrong on this page? Write to support@statesync.net.