← All articles

Tutorial

How to Save Tokens in Claude Code: Stop Paying for Sentences You Never Wrote

The waste isn't in your prompts. It's in the preamble, the third re-read and the session you're afraid to close. Here is where the bill is really set.

How to Save Tokens in Claude Code: Stop Paying for Sentences You Never Wrote

The bill is set in turn three, not in the sentence you typed

You save tokens in Claude Code by cutting what the agent feeds back into its own context, not by writing shorter prompts. Your question is one line. The answer is a page, and that page becomes input for the next turn, and the next, until you clear the session or the window runs out.

This is the part people skip while shopping for cheaper models. A reply is billed once as output and then again as context, every round after. Ask for a fix at ten in the morning and by noon the explanation of the fix has been re-read more often than the code it changed.

Run the arithmetic once and it stops being abstract. If every turn resends the conversation, turn forty is billed for thirty-nine turns of history plus whatever lands in that reply. You did not ask for thirty-nine turns of history. The harness did, politely, on your behalf.

The preamble is not a style problem. It is a subscription.

Start with the ledger instead of the prompt. Measurement is the only free thing in this economy, and the transcript audit that shows where your context actually went is the right first read. HarnessUp, a token-saving suite for Claude Code and Codex, scans the conversations already saved on your machine, with no login and no email, and points at the waste line by line before you commit to anything.

Four sentences you pay for forty times

Open one of your own replies and read it like an invoice. Most agent answers carry a small ceremony that has nothing to do with the work.

  • The greeting. "Sure, I'll help with that." Free once, ruinous by round forty.
  • The itinerary. Three approaches announced, one used, all three kept in context.
  • The recap. The diff, then a paragraph describing the diff you just read.
  • The apology loop. A failed command, an explanation of the failure, a retry that repeats the explanation.

None of this is stupidity. It is a model trained to be pleasant, and pleasantness is billed by the token. HarnessUp's Response Diet goes at exactly that: it asks for a direct answer, blocks the rereading, and cuts oversized output before it enters the context. One key turns it on, another turns it off, and Z undoes everything. Multiply those sentences by every turn in the window and you have your missing Wednesday.

You can do the first pass by hand: open a transcript, count how many lines of an answer are about the answer. Most people find a third of the reply is furniture. Cutting it manually once teaches the reflex faster than any setting.

Why does Claude Code burn tokens rereading files it already read?

Because every turn rebuilds the context, and the agent does not trust its earlier reading of it. A file opened at minute two stays in the transcript, gets requested again when the task drifts, and lands as a second copy; later turns pay for both. The third copy is the expensive one.

Reading one file three times is how a long session pays rent to its own transcript.

Delta Read attacks it at the source by handing the agent the changed region instead of the whole document, so the copy count stops climbing. You can help with a habit: ask for line ranges and diffs, not for the file again. The same pattern shows up in Codex review runs that bill more than the patch they inspect.

There is a second-order effect worth naming. Long sessions get noisier, the agent re-reads to reassure itself, and the session gets longer. No amount of prompt polish breaks that circle; only removing the second copy does.

Stable facts belong in the project instructions, not in a fresh read every hour. A short file that states the build command, the folder map and the conventions removes a whole class of rediscovery. Write it once, stop paying for it at every turn.

To save tokens in Claude Code, give the session a ceiling

People treat the five-hour window like weather. It is a budget spent in real time, and the weekly cap behind it is what ruins Thursday. Knowing when the Claude Code limit resets and how the window works is useful, but the habit of watching it is worth more.

Set a ceiling per task. Stop Loss does the blunt version: a five-dollar cap, and the session stops when it gets there. Blunt is the point. A cap turns "should I keep going" into "is this task worth another dollar", and that second question has an answer.

Small tasks finish; big sessions wander.

Pick the ceiling before you know the answer, not after the meter looks frightening. A dollar for a typo, five for a refactor, and a hard stop when the task stops resembling the one you started. The published "up to" numbers are the ceiling of what anyone measured, not a promise for your Tuesday; your own history is the only figure worth trusting.

The obvious objection is that interrupts break flow. They do, and a two-minute written handoff between sessions is cheaper than a session that runs until the window is gone.

The expensive model should decide, not sweep

Subagents are sold as a saving and often arrive as a second bill, because people paste the results back into the main thread and the big model reads everything twice. The saving only exists when the cheap model's work never enters the expensive context.

TaskEffortWhat it costs when the top model does it
Search the repolightA full context read for one answer
LintlightA paragraph about a missing comma
BuildlightLogs parked in a conversation that keeps them
TestsmediumThree rounds of the same failure
DocsmediumProse that gets summarized on the next turn

Cheap Swarm routes 26 task classes this way, picking the subagent, the model and the effort level per job, keeping the top model for the decision and letting the orchestra carry the rest. Search, lint and build sit at light. Tests and docs sit a notch higher. None of them needs the most expensive model in the room.

The catch is verification. A cheap model that answers confidently and wrongly costs more than an expensive one that answers slowly, because you pay for the wrong answer, the discovery and the repair. Route the grunt work down, check it cheaply, and keep the judgment where it belongs. Division of labour beats discount hunting, every time.

The undo button is the cheapest token tool you own

Ask why a session reached three hundred turns and the honest answer is usually fear. Clearing feels like losing the thread. Committing feels like a promise. So the conversation becomes a filing cabinet, and every new question drags the cabinet along.

Do it once on a small thing. Make a checkpoint, let the agent touch three files, roll it back, and notice that nothing hurt.

Cheap undo fixes more of this than any compression setting.

A developer at a desk looking at a terminal where the same source file appears three times in a Claude Code conversation, with a rising cost counter beside it.

Checkpoint drops a restore point in git without touching your branches, No Delete refuses the destructive commands, Secret Lock masks keys before they reach the conversation, Git Shield keeps secrets out of a push. Once closing a session costs nothing, people close sessions.

That is the uncomfortable part of this whole genre. Token saving is sold as optimization and works like therapy: the leaks are habits, and habits move when the fear underneath them gets cheaper.

Start with the free scan and one transcript. Fix the ugliest line first, whether it is the greeting, the third read or the session with no end. Everything toggles with a single key and Z undoes all of it, so a wrong guess costs one keystroke. The window will not get longer; your sessions can get shorter.

This article was drafted with AI assistance in HarnessUp Publish and approved by the HarnessUp team before publishing.