Handoff
Create a handoff packet: a factual state snapshot plus an executable continuation plan. The packet is for the next agent, who starts with fresh context, so it must carry enough ground truth to resume without guessing.
Workflow
Fix the handoff target.
Infer whether the recipient is the same agent later, another coding agent, a reviewer, QA, or a human. If the user supplied arguments, treat them as the next session focus. Ask one question only when the recipient or purpose changes what must be captured.
Inventory the current state.
Gather only durable facts:
- Original goal and latest user request.
- Current repository, branch, environment, and relevant paths.
- Files created, edited, or intentionally left untouched.
- Commands run, tests run, outputs observed, and commands still running.
- Decisions made, options rejected, and why.
- Known blockers, risks, assumptions, secrets, credentials, and external dependencies.
Prefer artifact references over pasted bulk content. Use paths, URLs, issue IDs, commit hashes, command names, and short evidence quotes. If a command such as git status hangs or fails, record that exact fact instead of inventing state.
Protect sensitive material.
Redact credentials, tokens, passwords, private personal data, and session cookies. Replace them with labels such as [REDACTED_API_TOKEN] and describe where the next agent should retrieve them safely.
Write the continuation plan.
Convert remaining work into ordered steps. Include the details needed to execute and verify each step:
- Why it exists.
- Exact files or systems to inspect or edit.
- Commands to run when known.
- Completion criterion.
- Side effects or rollback concerns.
Keep tasks small enough that the next agent can complete or verify them one by one.
Save the packet.
Use the most durable appropriate location:
- If the current workspace has a docs convention, use it.
- Else if a repository is active, save to
docs/handoffs/<YYYY-MM-DD-HHMM>-<topic>.md.
- Else save to the OS temp directory and name the file with the same timestamp and topic.
Link to existing PRDs, plans, ADRs, tickets, diffs, and commits; summarize only what matters for restart.
Run the resume check.
Read the packet as if you are the next agent, then check it against the ## Resume Check checklist below.
Handoff Packet Template
Use this structure unless a repository already has a stricter handoff format.
# Handoff: <task or ticket>
Generated: <YYYY-MM-DD HH:MM timezone>
Recipient: <same agent later | another coding agent | reviewer | QA | human>
Focus: <what the next session should do first>
Status: <not started | in progress | blocked | ready for review | complete except verification>
## Goal
<Original goal and latest user request in one short paragraph.>
## Current State
- Workspace: `<absolute path or URL>`
- Branch or version: `<branch, commit, release, or unknown with reason>`
- Active services or sessions: `<name, pid, URL, or none>`
- Important artifacts: `<paths or URLs>`
## Completed Work
- <Fact with file path, command evidence, or artifact reference.>
## Decisions
- <Decision>: <reason>. Rejected: <alternative and reason>.
## Files And Changes
- `<path>`: <what changed and why>
- Untouched but relevant: `<path>`: <why it matters>
## Commands And Evidence
- `<command>`: <result, exit code, important output, or failure mode>
## Remaining Plan
1. <Action>
- Why: <reason>
- Where: `<file, service, or artifact>`
- Command: `<command or none>`
- Done when: <checkable condition>
- Risk: <side effect or none>
## Verification Plan
- <Test, lint, type check, build, manual check, or external validation>
## Risks And Assumptions
- <Risk or assumption and how to verify it>
## Suggested Skills
- `<skill-name>`: <why it should be used>
## Resume Prompt
<A concise prompt the next agent can paste into a new session. Include this handoff path and the first step.>
## Redactions
- <What was redacted and where the next agent should retrieve it, or "none">
Resume Check
Before finalizing, check:
- Goal and latest request are clear.
- Completed work and current state are evidence-backed, not guessed.
- Every modified file has a reason.
- Files and areas the next agent must not touch are named.
- Every running command, server, or external dependency is accounted for.
- Remaining plan is ordered, starts with the exact next action, and each step has a completion criterion.
- Verification plan names exact commands or concrete manual checks.
- Risks, assumptions, and redactions are explicit.
- Resume prompt is ready to paste.
If any item fails, revise the packet.
Final Response
Respond with:
- The saved packet path.
- The first recommended next action.
- What verification you performed on the packet.
Keep the response short. The packet is the durable artifact.
1---2name: handoff-23description: Handoff: saves state to pause, resume, or transfer work. Use when: "handoff", "pause here and continue later", "hand this over to QA or another agent".4---56# Handoff78Create a handoff packet: a factual state snapshot plus an executable continuation plan. The packet is for the next agent, who starts with fresh context, so it must carry enough ground truth to resume without guessing.910## Workflow11121. **Fix the handoff target.**13 Infer whether the recipient is the same agent later, another coding agent, a reviewer, QA, or a human. If the user supplied arguments, treat them as the next session focus. Ask one question only when the recipient or purpose changes what must be captured.1415162. **Inventory the current state.**17 Gather only durable facts:18 - Original goal and latest user request.19 - Current repository, branch, environment, and relevant paths.20 - Files created, edited, or intentionally left untouched.21 - Commands run, tests run, outputs observed, and commands still running.22 - Decisions made, options rejected, and why.23 - Known blockers, risks, assumptions, secrets, credentials, and external dependencies.2425 Prefer artifact references over pasted bulk content. Use paths, URLs, issue IDs, commit hashes, command names, and short evidence quotes. If a command such as `git status` hangs or fails, record that exact fact instead of inventing state.2627283. **Protect sensitive material.**29 Redact credentials, tokens, passwords, private personal data, and session cookies. Replace them with labels such as `[REDACTED_API_TOKEN]` and describe where the next agent should retrieve them safely.3031324. **Write the continuation plan.**33 Convert remaining work into ordered steps. Include the details needed to execute and verify each step:34 - Why it exists.35 - Exact files or systems to inspect or edit.36 - Commands to run when known.37 - Completion criterion.38 - Side effects or rollback concerns.3940 Keep tasks small enough that the next agent can complete or verify them one by one.4142435. **Save the packet.**44 Use the most durable appropriate location:45 - If the current workspace has a docs convention, use it.46 - Else if a repository is active, save to `docs/handoffs/<YYYY-MM-DD-HHMM>-<topic>.md`.47 - Else save to the OS temp directory and name the file with the same timestamp and topic.4849 Link to existing PRDs, plans, ADRs, tickets, diffs, and commits; summarize only what matters for restart.5051526. **Run the resume check.**53 Read the packet as if you are the next agent, then check it against the `## Resume Check` checklist below.545556## Handoff Packet Template5758Use this structure unless a repository already has a stricter handoff format.5960```markdown61# Handoff: <task or ticket>6263Generated: <YYYY-MM-DD HH:MM timezone>64Recipient: <same agent later | another coding agent | reviewer | QA | human>65Focus: <what the next session should do first>66Status: <not started | in progress | blocked | ready for review | complete except verification>6768## Goal69<Original goal and latest user request in one short paragraph.>7071## Current State72- Workspace: `<absolute path or URL>`73- Branch or version: `<branch, commit, release, or unknown with reason>`74- Active services or sessions: `<name, pid, URL, or none>`75- Important artifacts: `<paths or URLs>`7677## Completed Work78- <Fact with file path, command evidence, or artifact reference.>7980## Decisions81- <Decision>: <reason>. Rejected: <alternative and reason>.8283## Files And Changes84- `<path>`: <what changed and why>85- Untouched but relevant: `<path>`: <why it matters>8687## Commands And Evidence88- `<command>`: <result, exit code, important output, or failure mode>8990## Remaining Plan911. <Action>92 - Why: <reason>93 - Where: `<file, service, or artifact>`94 - Command: `<command or none>`95 - Done when: <checkable condition>96 - Risk: <side effect or none>9798## Verification Plan99- <Test, lint, type check, build, manual check, or external validation>100101## Risks And Assumptions102- <Risk or assumption and how to verify it>103104## Suggested Skills105- `<skill-name>`: <why it should be used>106107## Resume Prompt108<A concise prompt the next agent can paste into a new session. Include this handoff path and the first step.>109110## Redactions111- <What was redacted and where the next agent should retrieve it, or "none">112```113114## Resume Check115116Before finalizing, check:117118- Goal and latest request are clear.119- Completed work and current state are evidence-backed, not guessed.120- Every modified file has a reason.121- Files and areas the next agent must not touch are named.122- Every running command, server, or external dependency is accounted for.123- Remaining plan is ordered, starts with the exact next action, and each step has a completion criterion.124- Verification plan names exact commands or concrete manual checks.125- Risks, assumptions, and redactions are explicit.126- Resume prompt is ready to paste.127128If any item fails, revise the packet.129130## Final Response131132Respond with:1331341. The saved packet path.1352. The first recommended next action.1363. What verification you performed on the packet.137138Keep the response short. The packet is the durable artifact.