Build a handoff document so a fresh Claude Code session can continue this work without re-reading the conversation.
If the user passed arguments, treat them as a description of what the next session will focus on and tailor the document accordingly.
Step 1: Gather context
- Scan the conversation for: completed work, decisions made, files changed, bugs found, gotchas discovered, and outstanding items.
- Run
git diff --stat in the current working directory (if it is a git repo) to capture uncommitted changes.
- Check for active tasks via TaskList.
- Read the auto-memory index (MEMORY.md in the current project's memory directory) for relevant recent entries.
Step 2: Write the handoff document
Save a Markdown file to the OS temporary directory:
- Path:
$TMPDIR/claude-handoff-<YYYY-MM-DD>-<short-slug>.md (use mktemp --tmpdir parent; on Linux this is /tmp).
- The
<short-slug> is a 2-3 word kebab-case label derived from the session's primary topic.
Document structure
# Handoff: <one-line summary>
Date: <YYYY-MM-DD>
Working directory: <cwd>
## What was done
<1-5 bullet points. Completed work only.>
## Current state
<Uncommitted changes, running processes, partial migrations, anything a fresh session needs to know about the environment right now.>
## What remains
### Ready to execute
<Items that can be started immediately.>
### Blocked / needs decision
<Items waiting on input, a prerequisite, or a human choice.>
### Backlog
<Known future work, not urgent.>
## Gotchas & discoveries
<Bugs found, workarounds applied, surprising behavior, constraints discovered. Omit if none.>
## Suggested skills
<List 1-5 Claude Code slash commands (e.g. `/diagnose`, `/self-healing-pipeline`) that would be useful in the next session, with a one-line reason each. Only suggest skills that are genuinely relevant to the remaining work.>
## References
<Paths or URLs to PRDs, plans, ADRs, issues, commits, diffs, or other artifacts that contain detail. Do NOT duplicate their content above -- just point to them.>
Content rules
- No duplication. If detail exists in a plan, PRD, ADR, issue, commit message, or diff, reference it by path or URL instead of restating it.
- Redact sensitive information. Replace API keys, passwords, tokens, and PII with
[REDACTED]. Never include secrets in the handoff document.
- Self-contained. Assume the next session has CLAUDE.md and auto-memory but NOT this conversation. Include enough context that the next agent can act without asking "what were we doing?"
- Concise. Target under 400 words for the entire document. Lead with action, not recap.
Step 3: Output
- Write the handoff document to the temp-dir path.
- Print the full document contents to the conversation so the user can review it.
- Print the file path so the user can paste it into the next session (e.g.
Read /tmp/claude-handoff-2026-05-26-auth-refactor.md).
- Print the task list from "What remains" as a clean standalone list below the document -- this doubles as a quick-reference without opening the file.
1---2name: next3description: Generate a continuation prompt for a fresh session and list current tasks. Use when wrapping up a session or handing off work.4---56Build a handoff document so a fresh Claude Code session can continue this work without re-reading the conversation.78If the user passed arguments, treat them as a description of what the next session will focus on and tailor the document accordingly.910## Step 1: Gather context11121. Scan the conversation for: completed work, decisions made, files changed, bugs found, gotchas discovered, and outstanding items.132. Run `git diff --stat` in the current working directory (if it is a git repo) to capture uncommitted changes.143. Check for active tasks via TaskList.154. Read the auto-memory index (MEMORY.md in the current project's memory directory) for relevant recent entries.1617## Step 2: Write the handoff document1819Save a Markdown file to the OS temporary directory:20- Path: `$TMPDIR/claude-handoff-<YYYY-MM-DD>-<short-slug>.md` (use `mktemp --tmpdir` parent; on Linux this is `/tmp`).21- The `<short-slug>` is a 2-3 word kebab-case label derived from the session's primary topic.2223### Document structure2425```markdown26# Handoff: <one-line summary>27Date: <YYYY-MM-DD>28Working directory: <cwd>2930## What was done31<1-5 bullet points. Completed work only.>3233## Current state34<Uncommitted changes, running processes, partial migrations, anything a fresh session needs to know about the environment right now.>3536## What remains37### Ready to execute38<Items that can be started immediately.>3940### Blocked / needs decision41<Items waiting on input, a prerequisite, or a human choice.>4243### Backlog44<Known future work, not urgent.>4546## Gotchas & discoveries47<Bugs found, workarounds applied, surprising behavior, constraints discovered. Omit if none.>4849## Suggested skills50<List 1-5 Claude Code slash commands (e.g. `/diagnose`, `/self-healing-pipeline`) that would be useful in the next session, with a one-line reason each. Only suggest skills that are genuinely relevant to the remaining work.>5152## References53<Paths or URLs to PRDs, plans, ADRs, issues, commits, diffs, or other artifacts that contain detail. Do NOT duplicate their content above -- just point to them.>54```5556### Content rules5758- **No duplication.** If detail exists in a plan, PRD, ADR, issue, commit message, or diff, reference it by path or URL instead of restating it.59- **Redact sensitive information.** Replace API keys, passwords, tokens, and PII with `[REDACTED]`. Never include secrets in the handoff document.60- **Self-contained.** Assume the next session has CLAUDE.md and auto-memory but NOT this conversation. Include enough context that the next agent can act without asking "what were we doing?"61- **Concise.** Target under 400 words for the entire document. Lead with action, not recap.6263## Step 3: Output64651. Write the handoff document to the temp-dir path.662. Print the full document contents to the conversation so the user can review it.673. Print the file path so the user can paste it into the next session (e.g. `Read /tmp/claude-handoff-2026-05-26-auth-refactor.md`).684. Print the task list from "What remains" as a clean standalone list below the document -- this doubles as a quick-reference without opening the file.