Claude Code session handoff: a template

A Claude Code session handoff is a short file the next session reads first. When to use one instead of --resume, a template to copy, and what goes in memory.

On this page

A Claude Code session handoff is a short file the old session writes before you stop and the new session reads first: the goal, where the work stands, what failed, and the next step. Use one when you want a clean context, and claude --resume when you want the old conversation back. Keep the handoff about this task only. Anything a session next month would also need, like a decision and its reason, belongs in lasting memory, not in the handoff.

Claude Code has no built-in handoff file as of November 2026. A feature request for one is open, and the search results for this query are mostly community skills that write one for you. This post is the template behind them, and where its parts should live. What it says about Claude Code comes from its documentation, linked throughout. Claude Code memory: what it keeps, and where maps everything Claude Code remembers, and every guide on it.

--resume A handoff note Lasting memory
Brings back The whole conversation Only what you wrote down What was learned or decided
Context in the new session Full, or a summary if it was compacted Small and clean A briefing, then searched
Includes failed attempts Yes, all of them One line each Only the lesson
Lasts 30 days by default Until the task is done Until it’s superseded
Use it for Picking up the same thread soon A fresh start on the same task Every later session

Should you resume or start fresh with a handoff?

Resume when the history itself is useful and the gap is short. Claude Code saves every session to a local transcript. claude --continue reopens the most recent one in the current directory, claude --resume opens a picker, and claude --resume <name> opens one you named with /rename. A resumed session restores the conversation, the model and, from the terminal, the permission mode. The best practices note it picks up “checkpoints included”, so you can still rewind.

Start fresh with a handoff when the history is in the way. Three cases:

  • The session went wrong. The docs’ advice after two failed corrections is to /clear and write “one new prompt that folds in what you learned”. A handoff is that prompt, written down.
  • The session is long. Every request sends the whole conversation. A best practices note adds that a long idle session is compacted before the cache expires, “so after lunch you continue from a summary”. A summary you didn’t write may keep less than one you did.
  • The plan is settled and the build is next. The docs suggest the same move for a spec: write it to a file, then “start a fresh session to build from it, so the build begins with a clean context”.

Resuming also has limits a file doesn’t. Transcripts are deleted after 30 days unless you change cleanupPeriodDays. Flags like --mcp-config and --add-dir must be passed again. And a resumed long conversation is sent again in full with every request.

A session handoff template

Ask the old session to write this before you stop. Keep it under a page: a handoff that needs its own summary has failed.

HANDOFF.md
# Handoff: <task in a few words>

## Goal
What "done" means for this task, in one or two sentences.

## State
- Done: what is finished and committed (branch, commit).
- In progress: what is half done, and in which files.
- Not started: what is left.

## Tried and failed
- <approach>: why it didn't work, in one line.

## Constraints from this session
Rules you gave in the chat that the next session must follow,
e.g. "don't touch the migration files".

## Next step
The first thing to do, specific enough to start without asking.

## Check
The command that proves it works: a test, a build, a curl.

Then start the next session with one line: Read HANDOFF.md and continue from Next step.

What each part is for

  • Goal stops the next session from solving a nearby problem instead. One sentence of “done” is worth a page of background.
  • State saves the first ten minutes. A new session would otherwise rediscover it from git status and guess at what’s half done.
  • Tried and failed is the part a fresh context loses first and needs most. Without it, the next session tries the obvious fix again.
  • Constraints are the rules you said only in conversation. They are also what compaction is most likely to drop.
  • Next step turns the handoff into a plan the agent can act on, not a report it reads.
  • Check gives the next session a way to know it’s done. The best practices put the same weight on giving Claude a check to run.

Write it from the old session, not from memory. Ask: “Write HANDOFF.md for the next session using this template. Be specific about files and commands. Keep it under a page.” Then read it. The old session is the only one that knows what it tried, and you are the only one who knows if it’s right.

What doesn’t belong in a handoff

A handoff is for one task and should die with it. Delete it when the task is done, or keep it out of git, so the next unrelated session doesn’t follow stale instructions.

Three kinds of thing don’t belong in it:

  • Rules for every task. If a constraint will still hold next month, move it to CLAUDE.md, which is read at the start of every session. A handoff that keeps repeating the same rule is a CLAUDE.md line waiting to be written.
  • Decisions and their reasons. “We chose polling over websockets because the proxy drops idle connections” matters after this task. In a handoff it is deleted with the file.
  • What the code or git already says. File layouts, function names and commit history are one git log away. Writing them down only makes the handoff longer.

Keep the lasting part in memory

The handoff and memory split one session’s output in two. The handoff carries the state of a task to the next session. Memory carries what was learned to every session after.

Memorinth keeps the second part. Agents save notes to a folder of Markdown files, your cortex, as they work: write_memory for something learned, record_decision for a choice and its reason, add_fact for a claim with a source. Three things then make it reach the next session without a handoff:

  • The briefing. A session-start hook gives every new session the current facts, the accepted decisions and the most recent memories before you type. The hook is set up with no matcher, so Claude Code runs it on every kind of session start: a new session, --resume, /clear and compaction.
  • The reminder. When a turn ends after three or more file edits and nothing was saved, a stop hook asks the agent whether the work produced something a later session would need.
  • /memorinth-save. Run it before you /clear or close a session. It reviews the session and saves decisions, insights and facts, and skips “details that only mattered to this conversation”.

That last line is the split. /memorinth-save is the lasting half, and it leaves the task state out on purpose. What goes where puts “a to-do for this session” under what not to save. So before you stop, do both: /memorinth-save for what lasts, and a handoff for what’s next.

If your tasks fit in one session, you may not need a handoff at all. A good briefing plus git status is often enough to pick up a small change. The handoff earns its place on work that spans several sessions, where the dead ends are the expensive part.

Set up the lasting half

To connect Claude Code to a cortex, follow Give Claude Code a long-term memory. How agents use it covers the briefing and the save reminder, and What goes where how to tell a memory from a decision or a fact.

All posts