StateSyncDocs

DocsCutting agent costs

StateSync and /compact

Compaction is for when a task ends. StateSync works while one is running. When to use each.

What compaction does

Claude Code sends the whole conversation on every call. Compaction swaps it for a summary, either automatically when the context is nearly full, or when you run /compact with an instruction for what to keep.

  • Between tasks it is exactly right. The old transcript is dead weight. /clear is better still if nothing carries over.
  • Mid-task it hurts. The transcript is the working state, so the agent reads again what it already had. On a short chat the summary can cost more than it saves.

Compaction makes each later call smaller. It does not make there be fewer of them.

What StateSync does

StateSync runs Claude Code on your own account and acts as each tool result comes back. A command that returns hundreds of lines usually has a few that decide the next edit. StateSync carries those forward, and the whole result is one call away if the agent needs it.

That changes what compaction cannot: how much each result adds, and how many calls the work takes. On the run, fewer calls was most of the saving. 30 percent fewer tokens is 25 percent fewer requests multiplied by a 6 percent smaller average request. The requests are most of it.

29% fewerrequestsall 55 tasks
25% fewerrequests, no subagentsthe 13 tasks where neither side delegated
46% lowercost to finishcheaper on 53 of 55 tasks
No lowerquality on average: higher on 15, level on 34, lower on 6scored on every task

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.

Picking a project back up

A compaction summary lives in one session of one agent. StateSync keeps a lighter record of the project's recent tasks and attempts, and it is there the next time you open the project, in whichever agent you pick. It helps most when you are trying approaches. It does not replace reviewing the work.

Side by side

The compaction column is documented behaviour. Anthropic has not published a saving for it.
CompactionBetween sessionsStateSync in a task
WhenAt a task switchAcross sessions and agentsAs each result arrives
Acts onThe whole transcriptRecent tasks and attemptsEach result
KeepsWhat the summary keptA lighter record than a summaryWhat the next step needs, the rest one call away
Calls per taskUnchangedUnchanged29% fewer on the run
CostIncluded with your agentIncluded with StateSyncIncluded with StateSync
EffortA habitNoneNone

Using both

StateSync does not turn compaction off, and you should keep compacting at a switch. The conversation just grows more slowly inside a task, so automatic compaction comes later or not at all. StateSync was cheaper on 53 of 55 tasks.

Very short tasks save the least. On the 18 tasks the plain agent finished in under two minutes, the cost saving was 27 percent, against 50 percent on longer ones. They are cheap already, and compaction never runs on them either. The free fixes are in the Claude Code guide.

Sources

  1. Anthropic, Claude Code: manage costs effectivelycode.claude.com/docs/en/costs
  2. TokenBench harness, our 55-task rungithub.com/Silverspine1/TokenBench

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