Handoff
Capture the load-bearing context from the current conversation into a
structured HANDOFF_<slug>.md so a fresh session can pick up cleanly.
Used before /clear, before opening a new Claude Code session, or
whenever context window pressure is forcing a reset.
When to invoke
- User says "hand off", "handoff", "/handoff", "prep for /clear",
"continue in a fresh session", "save context"
- Conversation is approaching context compaction and the user wants
control over what survives
- A long planning/debugging session needs to pause and resume cleanly
Don't use for:
- Persisting reusable preferences — use the memory system instead
- Writing a plan from scratch — use
plan-implementation or
plan-refactor
- Summarizing what was done for a PR description — write the PR body
Inputs
The user usually provides a continuation prompt:
/handoff <what the fresh session should do next>
If they didn't, identify it from the conversation: what's the next
concrete step they'd want a fresh session to take? If it's genuinely
ambiguous, ask one short question before writing — otherwise make the
reasonable call and continue.
Workflow
- Pick a short kebab-case slug for the work, e.g.
auth-cleanup,
release-fix, flaky-test-triage.
- Decide the file location:
- In a git repo:
HANDOFF_<slug>.md at repo root.
- Outside a repo:
/tmp/HANDOFF_<slug>.md.
- Write the file using the template below.
- Print the path and tell the user to start a fresh Claude Code
session and paste the file's contents (or open the file and ask the
new session to read it).
- Stop. Do not continue the actual work in the current session.
Template
# Handoff: <short title>
## Continuation Prompt
<the user's exact next-step prompt, verbatim>
## Current Goal
<what we're trying to accomplish overall — one paragraph>
## What Happened
- <important actions already taken in this session>
- <files created / edited / read if relevant>
- <commands run and meaningful results>
## Decisions and Rationale
- <decision> — <why>
## Current State
- <what is true right now>
- <uncommitted changes / branch / PR state / running processes>
- <open todo list state if relevant>
## Important Context
- <constraints, conventions, user preferences picked up in this session>
- <links to relevant files, plan documents, PRs, issues>
## Risks / Gotchas
- <things the next session must not miss>
- <known wrong turns to avoid repeating>
## Suggested Next Steps
1. <first concrete step>
2. <second concrete step>
3. <third concrete step>
Rules for writing the handoff
- No secrets. Redact tokens, passwords, API keys, private URLs, or
any credential that appeared in the transcript. If a secret was
central to the work, write
<redacted: <description>> so the next
session knows to retrieve it themselves.
- No invented details. If a detail is uncertain, say so
explicitly (
uncertain — last seen ~10 messages ago). Don't paper
over gaps.
- Precise references over vague statements. File paths, command
names, branch names, PR numbers, error text, function names — not
"the auth file" or "that error".
- High signal, not transcript dump. Aim for a doc the next session
reads in under a minute. Skip blow-by-blow back-and-forth; keep
decisions and current state.
- Omit sections with no substance. If there are no risks, drop the
Risks heading rather than writing "None".
Launching the fresh session
After writing the file:
- Print the absolute path.
- Tell the user to either:
- Run
/clear in this same Claude Code session, then paste the file
contents as the first message of the cleared session, or
- Open a new Claude Code window in the same project and start with
Read <path>. Continue from this handoff. as the first message.
- Do not continue the actual work in this session — that defeats the
purpose.
Final response from the current session
Keep it short:
- The handoff file path.
- A one-line summary of what's in it.
- Instructions to
/clear (or open a new window) and read the file.
- Nothing else.
1---2name: handoff3description: Write a structured handoff document so a fresh Claude Code session can continue the current work without re-reading the entire transcript. Use when asked to "hand off", "handoff", run "/handoff", prepare for a "/clear", start a fresh session without losing context, or save the current conversation's state for a future session. Produces a local `HANDOFF_<slug>.md` (or `/tmp/HANDOFF_<slug>.md` outside a repo) that the user pastes or opens in the new session.4---56# Handoff78Capture the load-bearing context from the current conversation into a9structured `HANDOFF_<slug>.md` so a fresh session can pick up cleanly.10Used before `/clear`, before opening a new Claude Code session, or11whenever context window pressure is forcing a reset.1213## When to invoke1415- User says "hand off", "handoff", "/handoff", "prep for /clear",16 "continue in a fresh session", "save context"17- Conversation is approaching context compaction and the user wants18 control over what survives19- A long planning/debugging session needs to pause and resume cleanly2021Don't use for:2223- Persisting reusable preferences — use the memory system instead24- Writing a plan from scratch — use `plan-implementation` or25 `plan-refactor`26- Summarizing what was done for a PR description — write the PR body2728## Inputs2930The user usually provides a continuation prompt:3132```text33/handoff <what the fresh session should do next>34```3536If they didn't, identify it from the conversation: what's the next37concrete step they'd want a fresh session to take? If it's genuinely38ambiguous, ask one short question before writing — otherwise make the39reasonable call and continue.4041## Workflow42431. Pick a short kebab-case slug for the work, e.g. `auth-cleanup`,44 `release-fix`, `flaky-test-triage`.452. Decide the file location:46 - In a git repo: `HANDOFF_<slug>.md` at repo root.47 - Outside a repo: `/tmp/HANDOFF_<slug>.md`.483. Write the file using the template below.494. Print the path and tell the user to start a fresh Claude Code50 session and paste the file's contents (or open the file and ask the51 new session to read it).525. Stop. Do not continue the actual work in the current session.5354## Template5556```markdown57# Handoff: <short title>5859## Continuation Prompt60<the user's exact next-step prompt, verbatim>6162## Current Goal63<what we're trying to accomplish overall — one paragraph>6465## What Happened66- <important actions already taken in this session>67- <files created / edited / read if relevant>68- <commands run and meaningful results>6970## Decisions and Rationale71- <decision> — <why>7273## Current State74- <what is true right now>75- <uncommitted changes / branch / PR state / running processes>76- <open todo list state if relevant>7778## Important Context79- <constraints, conventions, user preferences picked up in this session>80- <links to relevant files, plan documents, PRs, issues>8182## Risks / Gotchas83- <things the next session must not miss>84- <known wrong turns to avoid repeating>8586## Suggested Next Steps871. <first concrete step>882. <second concrete step>893. <third concrete step>90```9192## Rules for writing the handoff9394- **No secrets.** Redact tokens, passwords, API keys, private URLs, or95 any credential that appeared in the transcript. If a secret was96 central to the work, write `<redacted: <description>>` so the next97 session knows to retrieve it themselves.98- **No invented details.** If a detail is uncertain, say so99 explicitly (`uncertain — last seen ~10 messages ago`). Don't paper100 over gaps.101- **Precise references over vague statements.** File paths, command102 names, branch names, PR numbers, error text, function names — not103 "the auth file" or "that error".104- **High signal, not transcript dump.** Aim for a doc the next session105 reads in under a minute. Skip blow-by-blow back-and-forth; keep106 decisions and current state.107- **Omit sections with no substance.** If there are no risks, drop the108 Risks heading rather than writing "None".109110## Launching the fresh session111112After writing the file:1131141. Print the absolute path.1152. Tell the user to either:116 - Run `/clear` in this same Claude Code session, then paste the file117 contents as the first message of the cleared session, **or**118 - Open a new Claude Code window in the same project and start with119 `Read <path>. Continue from this handoff.` as the first message.1203. Do not continue the actual work in this session — that defeats the121 purpose.122123## Final response from the current session124125Keep it short:126127- The handoff file path.128- A one-line summary of what's in it.129- Instructions to `/clear` (or open a new window) and read the file.130- Nothing else.