← All articles

Tools

Renew Session: The Restart Button That Refuses to Start Over

Your agent slows down at hour three, and the transcript is why. Renewing a session means deciding what survives — and what you stop paying for.

Renew Session: The Restart Button That Refuses to Start Over

There is an hour in every long agent session when the model starts narrating its own history. It rereads a file it edited forty minutes ago. It restates the plan you already approved. It asks, politely, whether you still want the login fix.

Nothing has gone wrong. The session is simply full, and everything in it gets paid for again on the next turn.

You have two instincts at that point. Paste a summary into a fresh chat and hope it survives, or stay put because starting over feels like throwing away progress. The second one is the more expensive lie, and it is the one almost everybody tells. Renewing a session is the third option, and it deserves a name because it treats a conversation as something to edit rather than something to keep. The useful version of that habit is already sketched in what to carry into your next Claude Code session, and it gets sharper once a tool does the carrying.

What a Long Session Charges You on Every Turn

Cache pricing makes a fat context feel cheap. It is merely discounted, and the discount is billed on every request until you close the tab. Everything the agent pulled in at ten in the morning is still riding along at four in the afternoon, whether or not it still matters.

  • The files it read to answer a question you settled hours ago.
  • The plan it drafted, revised and abandoned.
  • Two failed fixes, plus the apology attached to each.
  • Your corrections, typed twice because the first one did not take.
  • The preamble before every answer, which nobody requested and everybody pays for.

None of that is a mistake. It is the residue of real work. The trouble is that residue compounds. The agent rereads a file to reassure itself, the reassurance lands in the transcript, and the next turn has more to be reassured about. Why Claude Code keeps rereading the same file is the mechanism; the session is the room it happens in.

The same arithmetic governs your instructions. A rule in your CLAUDE.md file, which works on every turn whether you want it to or not, is not paid once when you write it. It is paid again on every request, and then again in every reply that reacts to it. A session that has been open for six hours is carrying all of it, plus the conversation about it.

Write the Handoff Before You Feel Ready To

A renew is a handover, and handovers fail for a boring reason: the person writing them assumes the reader was in the room. The next session was not in the room. It has your repository, your instructions and nothing else.

Write for the stranger who picks this up in ten minutes with no memory of your afternoon.

A bloated Claude Code session on the left folding its essential conclusions into a short four-line handoff file that opens a small, clean session on the right

Four lines cover almost everything. What changed, in files and in behaviour. What was decided, including the options you rejected and the reason you rejected them. What comes next, specific enough that someone could start on it. What must not be touched, with the reason attached rather than the rule alone.

That last line matters more than it looks. An agent told to stay away from the migration runner will stay away from the migration runner. An agent told why will also stay away from the four adjacent things that share the same risk, which is usually where the damage would have happened.

Do this while the session is still warm. The temptation is to close the tab and reconstruct later, which is how you end up with a handoff full of conclusions and none of the evidence that made them true.

HarnessUp treats this boundary as part of the harness instead of an afterthought. Renew Session is the tool that lives at that edge: close the loaded session, carry the short handoff forward, open a new one on a clean context. Everything attaches to the official Anthropic and OpenAI hook events, SessionStart among them, and runs entirely on your machine, where your transcripts already sit. You can see how the HarnessUp suite saves tokens in Claude Code and Codex without sending anything off your disk, which matters when the thing being summarised is your own code.

Renew, Don't Restart: the Difference Is What You Refuse to Carry

A restart throws everything away and charges you twice. Once when you earned the context, again when you explain it to a model that has never heard of it. A renew keeps the conclusions and drops the transcript. That distinction sounds like marketing until you watch the two costs side by side.

Most session advice is really hoarding advice. Keep the context, stretch the window, summarise instead of clearing, never close a chat you might need.

It treats the session like a cupboard you are afraid to empty.

The better instinct is editorial: decide what survives, then let the rest go on purpose.

The practical form of that decision is a file. Not a chat message, not a note in your head, not a pinned tab. A small file in the repository that the next session reads in one pass, specific enough to be wrong in useful ways if you got something wrong.

The second-order effect is the part nobody mentions. When you know a session will be renewed, you stop defending it. You stop keeping a dead branch alive because closing it feels like losing points. The session turns back into a place where work happens rather than a place where progress is stored, and that changes how you spend the last hour of the day.

I work on product at HarnessUp, so weigh my enthusiasm accordingly. The reason this feature earns the enthusiasm is that it refuses to flatter you. HarnessUp's savings number comes from your own transcripts, not from a slide, and a renew either shrinks your context or it does not. There is no story you can tell that makes a bloated session look lean.

How Do You Renew a Claude Code Session Without Losing the Thread?

Close the old session deliberately, write a four-line handoff into a file, start the new session by naming that file, and ask for the next action instead of a summary. The thread survives because the conclusions survive. The transcript does not need to, and the tokens you save are the ones you were spending on narration.

The first prompt decides whether the renew worked. Most people open the new session and paste the summary into the chat, which recreates the original problem with extra steps: a long message that will be reread on every turn until the session ends.

Name the file and the task in the same breath. Read HANDOFF.md, then finish the token refresh in src/auth/session.ts. That reads as a request. A briefing would be longer, and the agent would answer it with a summary you did not ask for.

Then ask for one line before the first edit. Have it restate the constraint it must not break, in a sentence. One line, not a summary. If the line is wrong, you have caught a bad handoff for the price of a sentence instead of an afternoon.

The place most renewals die is the urge to explain. You remember a subtlety, so you add it. Then another, because the first one reminded you of something. By the fifth addition the new session has the shape of the old one, minus the savings you were promised.

Resist that for one turn and watch what happens.

The agent asks a specific question about the gap in the handoff, you answer in one sentence, and the file gets better for the next renew. That is the loop working.

When the Renewed Session Comes Back Dumber

It will happen. A handoff that was too vague, a decision you never wrote down, a file renamed since the note. The new session opens confidently and edits the wrong thing. That says less about renewing than about the handoff, which was doing less work than you assumed.

Fix it in the file, not in the chat.

Every correction typed into the conversation is a correction the next session will need again, and the one after that, forever.

A bad renew is more informative than a good one. It shows you which decisions you were carrying in your head because you never wrote them down, which is most of them. The gap between what you thought you had documented and what a stranger could actually act on is the real measurement of your process.

There is a version of this habit that has nothing to do with tokens. You start noticing which parts of an afternoon were decisions and which were narration. The meeting that changed nothing, the debugging session that ended where it began, the plan you rewrote because you had not decided. A session that renews cleanly is usually a session where you knew what you were doing.

So the next time the agent starts reciting its own history, do not paste. Open a file, write four lines, close the tab, start clean with a task. If the first answer comes back confused, the handoff was thin, and rewriting it is cheaper than rewriting the prompt.

The session ends. The judgement is what you carry.

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