BlogGuide · · 2 min read
When a Claude Code session runs out of context: handing off cleanly
The short answerBefore the context is full, have the session write a handoff note (goal, current state, decisions made, what is left, how to verify), then start a fresh session that reads the note first. A fresh session with a good note beats a long session that has forgotten its own decisions.
What goes wrong in a long session
Every file read, command output and reply takes room in the session’s context window. When it fills, Claude Code summarises the earlier conversation to make space. The summary keeps the gist and drops detail, so the session can lose a decision you made two hours ago, or the reason a certain approach was ruled out.
You usually notice it as repetition: the session re-reads files it already knows, or proposes something you already rejected.
Hand off before it is full
Do not wait for the limit. When the context is around three quarters used and the task is not nearly done, ask the session for a handoff note while it still remembers everything:
Write a handoff note to HANDOFF.md for a fresh session that will continue this task.
Include: the goal, what is done, what is left, decisions made and why,
files changed, how to run and verify, and open questions.What a good note holds
- The goal, in the words of whoever asked.
- The state now: branch, what is committed, what is half done.
- Decisions and reasons, especially approaches that were tried and dropped.
- What is left, in order.
- How to verify: the test command, the page to look at.
- Open questions for a person.
Leave out the story of how you got there. The next session needs the map, not the diary.
Starting the next session
Open a new session in the same working copy and make reading the note its first step: “Read HANDOFF.md, then continue from What is left.” It starts with an empty context and the whole plan.
In HeyJason
HeyJason shows how full each session’s context is and warns when one is close to its limit. Replace does the handoff for you: the session writes its note, a fresh one (for example billing-worker-v2) reads it and takes over the same tasks, and you can do it from your phone. The old session stays open until you close it.
By The HeyJason team. Found a mistake? support@heyjason.dev