A handoff document is a prompt. The receiver has no access to this conversation, so everything it needs must be on
the page — and everything it does not need competes with what it does.
Mode
$mode selects the receiver. Empty means self.
- self — the receiver holds your project knowledge. Task state, decisions, remaining work. No codebase orientation.
- teammate — the receiver may hold none of it. Adds codebase orientation, skill and tool pointers, and conventions.
Triage
Two passes, in this order. A single pass sorts for precision and loses the subtle context that turns out to be
load-bearing — which is the documented failure of aggressive compaction.
- Recall. Collect everything relevant. Over-collect; nothing is cut yet.
- Precision. Cut what the categories below mark as noise, and only then.
Keep — state that does not survive the boundary any other way:
- Decisions and their rationale, including options considered and rejected. A rejected option that arrives without its
reason gets proposed again by the receiver
- Constraints discovered during the work
- Contingencies — the failure modes you can foresee and the receiver cannot. "If the integration test still fails after
a rebuild, it is the fixture cache, not the code." This is the element handoffs omit most often
- External resource identifiers — URLs, issue IDs, file paths with line numbers, branch names, commit SHAs
- Verification state, in both directions: what was checked and its result, and what was not checked
- Negative state — work that looks started and is not. "No branch, no edit, no commit" stops the receiver assuming a
base that does not exist
- Remaining work in priority order
- Blockers and open questions
Drop — noise in transfer:
- Intermediate exploration and search paths
- Content already committed to files or git history
- Content already captured in an upstream artifact — a PRD, plan, ADR, or tracker issue. Reference it by path or ID
- Anything derivable from the codebase — file structure, function signatures
- Raw tool output
A failed attempt is a decision, not exploration. It belongs under Decisions with the reason it failed, whenever that
reason still constrains the remaining work. Drop only the attempts that constrain nothing.
Do not reconstruct what compaction took. A handoff usually runs late, when part of the conversation is already
summarized. Where the detail is gone, write what is known and mark the gap — a confident reconstruction is the one
failure the receiver cannot detect.
Document Structure
Produce a markdown document. Omit any section with no content; an empty header is noise.
Open with the state grade. It is the first thing both readers hit — the user scanning before they paste, and the agent
reading before it acts — and it decides what the receiver does first.
- clean — the plan holds. Continue from Remaining Work.
- watch — something is off and has not stopped the work. Verify it before building on it, and say what it is.
- blocked — work cannot proceed, or the plan itself is in doubt. Resolve that before anything else.
# Handoff: [task name]
**State: clean | watch | blocked** — [one clause: why, and what it forces first]
## Context
[1-2 sentences: what this work is and where it stands]
## Decisions
- [decision]: [rationale]
## Constraints
- [constraint]: [why it matters]
## External Resources
- [resource type]: [identifier or URL]
## Remaining Work
1. [highest-priority next step]
2. [subsequent steps]
## Contingencies
- If [condition the receiver will hit]: [what it means and what to do]
## Verification State
- [what was checked, and the result]
- [what was not checked]
## Open Questions
- [question]: [what is needed to resolve it]
---
Before acting: restate the task, the state grade, and your first step in two or three sentences, and name anything in
this document that is ambiguous or contradicts what you find. Then proceed without waiting for confirmation.
In teammate mode, add these three sections before Decisions:
## Codebase Orientation
- [file or directory]: [relevance to this task]
## Skills and Tools
- [skill or tool]: [why the receiver needs it]
## Conventions
- [convention]: [where it is documented]
Compression
Target 500-2000 tokens. When the work is larger than that:
- Decisions, constraints, and contingencies — keep every one. These are why the document exists, and losing one
produces a wrong decision downstream
- External resources — keep the identifiers, drop the descriptions around them
- Remaining work — the top 5-7 items, with the rest collapsed into one "Also:" line
- Verification state — collapse what passed into a count; never collapse what was not checked. An unverified area is
worth more to the receiver than a passing test, because it is the thing they must not build on
- Codebase orientation — only the files the receiver will open
Operating Rules
- Print, do not write. Print the document into the conversation for the user to copy. Write a file only when the
user asks for one by name. The user controls delivery.
- Gather nothing. Read only what is already in this conversation. Do not open files, search the codebase, or query
memory — context is nearly full, which is why the handoff is happening.
- Every decision carries its rationale. Without it the receiver re-derives the decision or trusts it blindly.
- Identifiers, not descriptions. "PR #247", not "the pull request we opened". "src/auth/middleware.ts:42", not "the
auth file around line 42".
- Redact secrets and personal data. Strip API keys, tokens, passwords, and PII. The document gets printed, copied,
and pasted somewhere else.
- Write it standalone. Every reference resolves without this conversation, and without any file this session
produced but did not commit.
- Write for the paste. The user copies the document and it becomes the receiver's first message — the
highest-authority position in that session. That is why the closing read-back is obeyed, and why nothing may point at
a handoff file, a scratch note, or a path that exists only here.
If Decisions or Remaining Work comes out empty after real work was done, the triage missed something. Re-read the
conversation rather than emitting the document.
1---2name: handoff3description: Triage this conversation into a standalone transfer document — decisions, constraints, resource identifiers, verification state, and remaining work — for a session restart or a teammate.4---56**A handoff document is a prompt.** The receiver has no access to this conversation, so everything it needs must be on7the page — and everything it does not need competes with what it does.89## Mode1011`$mode` selects the receiver. Empty means self.1213- **self** — the receiver holds your project knowledge. Task state, decisions, remaining work. No codebase orientation.14- **teammate** — the receiver may hold none of it. Adds codebase orientation, skill and tool pointers, and conventions.1516## Triage1718Two passes, in this order. A single pass sorts for precision and loses the subtle context that turns out to be19load-bearing — which is the documented failure of aggressive compaction.20211. **Recall.** Collect everything relevant. Over-collect; nothing is cut yet.222. **Precision.** Cut what the categories below mark as noise, and only then.2324<preserve>2526**Keep** — state that does not survive the boundary any other way:2728- Decisions and their rationale, including options considered and rejected. A rejected option that arrives without its29 reason gets proposed again by the receiver30- Constraints discovered during the work31- Contingencies — the failure modes you can foresee and the receiver cannot. "If the integration test still fails after32 a rebuild, it is the fixture cache, not the code." This is the element handoffs omit most often33- External resource identifiers — URLs, issue IDs, file paths with line numbers, branch names, commit SHAs34- Verification state, in both directions: what was checked and its result, and what was **not** checked35- Negative state — work that looks started and is not. "No branch, no edit, no commit" stops the receiver assuming a36 base that does not exist37- Remaining work in priority order38- Blockers and open questions3940</preserve>4142<drop>4344**Drop** — noise in transfer:4546- Intermediate exploration and search paths47- Content already committed to files or git history48- Content already captured in an upstream artifact — a PRD, plan, ADR, or tracker issue. Reference it by path or ID49- Anything derivable from the codebase — file structure, function signatures50- Raw tool output5152</drop>5354**A failed attempt is a decision, not exploration.** It belongs under Decisions with the reason it failed, whenever that55reason still constrains the remaining work. Drop only the attempts that constrain nothing.5657**Do not reconstruct what compaction took.** A handoff usually runs late, when part of the conversation is already58summarized. Where the detail is gone, write what is known and mark the gap — a confident reconstruction is the one59failure the receiver cannot detect.6061## Document Structure6263Produce a markdown document. Omit any section with no content; an empty header is noise.6465Open with the state grade. It is the first thing both readers hit — the user scanning before they paste, and the agent66reading before it acts — and it decides what the receiver does first.6768- **clean** — the plan holds. Continue from Remaining Work.69- **watch** — something is off and has not stopped the work. Verify it before building on it, and say what it is.70- **blocked** — work cannot proceed, or the plan itself is in doubt. Resolve that before anything else.7172```markdown73# Handoff: [task name]7475**State: clean | watch | blocked** — [one clause: why, and what it forces first]7677## Context7879[1-2 sentences: what this work is and where it stands]8081## Decisions8283- [decision]: [rationale]8485## Constraints8687- [constraint]: [why it matters]8889## External Resources9091- [resource type]: [identifier or URL]9293## Remaining Work94951. [highest-priority next step]962. [subsequent steps]9798## Contingencies99100- If [condition the receiver will hit]: [what it means and what to do]101102## Verification State103104- [what was checked, and the result]105- [what was not checked]106107## Open Questions108109- [question]: [what is needed to resolve it]110111---112113Before acting: restate the task, the state grade, and your first step in two or three sentences, and name anything in114this document that is ambiguous or contradicts what you find. Then proceed without waiting for confirmation.115```116117In **teammate** mode, add these three sections before Decisions:118119```markdown120## Codebase Orientation121122- [file or directory]: [relevance to this task]123124## Skills and Tools125126- [skill or tool]: [why the receiver needs it]127128## Conventions129130- [convention]: [where it is documented]131```132133## Compression134135Target 500-2000 tokens. When the work is larger than that:136137- **Decisions, constraints, and contingencies** — keep every one. These are why the document exists, and losing one138 produces a wrong decision downstream139- **External resources** — keep the identifiers, drop the descriptions around them140- **Remaining work** — the top 5-7 items, with the rest collapsed into one "Also:" line141- **Verification state** — collapse what passed into a count; never collapse what was not checked. An unverified area is142 worth more to the receiver than a passing test, because it is the thing they must not build on143- **Codebase orientation** — only the files the receiver will open144145## Operating Rules146147- **Print, do not write.** Print the document into the conversation for the user to copy. Write a file only when the148 user asks for one by name. The user controls delivery.149- **Gather nothing.** Read only what is already in this conversation. Do not open files, search the codebase, or query150 memory — context is nearly full, which is why the handoff is happening.151- **Every decision carries its rationale.** Without it the receiver re-derives the decision or trusts it blindly.152- **Identifiers, not descriptions.** "PR #247", not "the pull request we opened". "src/auth/middleware.ts:42", not "the153 auth file around line 42".154- **Redact secrets and personal data.** Strip API keys, tokens, passwords, and PII. The document gets printed, copied,155 and pasted somewhere else.156- **Write it standalone.** Every reference resolves without this conversation, and without any file this session157 produced but did not commit.158- **Write for the paste.** The user copies the document and it becomes the receiver's first message — the159 highest-authority position in that session. That is why the closing read-back is obeyed, and why nothing may point at160 a handoff file, a scratch note, or a path that exists only here.161162If Decisions or Remaining Work comes out empty after real work was done, the triage missed something. Re-read the163conversation rather than emitting the document.