handoff
Skill2 starsChanged 6 months agoMITView on GitHub
Compact the current conversation into a structured handoff document (saved to the OS temp directory) so a fresh agent can continue the work without losing context. Use when the user invokes /handoff, says "create a handoff doc", "write a handoff document", "compact this for another agent", "pass off to another session", "what will the next session focus on", or generally wants to checkpoint the conversation state before a context-window break. Always references existing artifacts (design docs, plans, PRs, commits, memory entries) by path/URL — never duplicates their content. Includes a mandatory "suggested skills" section. Redacts API keys, passwords, PII.
- Reads credentials
195 other projects use a version of this.
Adopted by
Most recently taken up by
- mattpocock/skillstheir own version, first seen Oct 8, 2026
- fmind/dottheir own version, first seen Oct 5, 2026
- michielvandermeer/skillstheir own version, first seen Oct 4, 2026
- Integralist/agent-skillstheir own version, first seen Oct 4, 2026
- obie/auto-handofftheir own version, first seen Oct 4, 2026
- jesse-merhi/skillstheir own version, first seen Oct 4, 2026
Used with
Projects with it also use which-skill, wait-what and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
risadamsSkillwhich-skill
Router over this pack's skills and flows. Ask it "which skill fits X" when you don't remember what's available.
Also in 5 projects that use this
AWSSkillwait-what
Stop. That last message did not land: re-pitch it.
Also in 51 projects that use this
AWSSkillto-questionnaire
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
Also in 41 projects that use this
loulanyueSkillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 15 projects that use this
RoentekSkillwriting-beats
Writing, exploit — assemble raw material into a journey of beats, grounding each term before a beat leans on it.
Also in 20 projects that use this
RoentekSkillwriting-fragments
Writing, explore — mine raw fragments, no structure yet.
Also in 20 projects that use this
- +5 more from aws
- +1 more from Roentek
Other versions195 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 195
- mattpocock/skills★ 335ksame name
- ykdojo/claude-code-tips★ 10ksame name
- vinvcn/mattpocock-skills-zh-CN★ 4.6ksame name
- davidondrej/skills★ 4.1ksame name
- compozy/compozy★ 2.8ksame name
- feiskyer/claude-code-settings★ 1.7ksame name
- openclaw/agent-skills★ 1.1ksame name
- suboss87/FDEOps★ 950same name
- anombyte93/prd-taskmaster★ 604same name
- stevesolun/ctx★ 588same name
185 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- fizzy-board-monitorSkill
- fizzy-product-managerSkill
- fizzy-tasksSkill
- fizzy-writeSkill
- grill-meSkill
- grill-meSkill
- html-outputSkill
- pair-agent-harnessSkill
- recall-ai-integrationSkill
- rijuls-reviewSkill
- srs-documentationSkill
- srs-to-delivery-planSkill
- tri-agent-loopSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 167 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
When the conversation is short (<20 substantive turns) and nothing material would be lost by starting fresh.
- Distinctive: line 28
When the user is asking for documentation that should live IN the repo (design docs, ADRs, READMEs).
- Very specific: line 32
If the user passed an argument to /handoff (or named the next session's focus in their message), treat it as the mission statement.
- Very specific: line 72
If /tmp/ doesn't exist or isn't writable (rare), fall back to $(mktemp -d)/handoff.md and report that path.
- Distinctive: line 81
Before writing a single line of doc body, enumerate every artifact that *already* captures something you'd otherwise restate.
- Distinctive: line 95
If you find yourself wanting to write out a 10-bullet summary of a doc, stop and reference the doc instead.
- Very specific: line 191
When in doubt, redact. Note redactions in a final line: *Redacted: <count> credentials and <count> PII items.*
- Distinctive: line 223
Before reporting the path to the user, verify:
“Common” is measured: kept by at least 6 in 10 of the 167 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
handoff
Compact the current conversation into a single self-contained Markdown document that a fresh agent can read at the start of the next session and immediately know: what to do, what's already done, what's blocked, and which skills/files to touch. Save it to the OS temp directory (NOT the workspace) so it doesn't accidentally get committed.
The handoff doc is a briefing, not a transcript. It references — never duplicates — content that already lives in other artifacts (PRs, plans, design docs, commits, memory entries, ADRs, issue trackers).
See README.md for the credit (Matt Pocock's original handoff) and install / use instructions.
When to invoke
Fire on any of:
- User invokes
/handoff(optionally with an argument describing the next session's focus). - User says "create a handoff doc", "write a handoff document", "compact this", "pass off to another session", "checkpoint this conversation".
- User says "what will the next session focus on" or "I'll pick this up tomorrow".
- User signals an imminent context-window break and wants the work to survive.
When NOT to invoke
- Mid-task, when the user wants you to keep going. Handoff is a session-boundary ritual, not a status update mid-conversation.
- For one-off questions ("what's the status?") — answer directly; don't write a file.
- When the conversation is short (<20 substantive turns) and nothing material would be lost by starting fresh.
- When the user is asking for documentation that should live IN the repo (design docs, ADRs, READMEs). Handoff docs are ephemeral session-bridge artifacts; if it deserves permanent docs, write it alongside code (e.g. under
docs/,project-management/, orarchitecture/), not in/tmp.
Step 1 — Parse the argument
If the user passed an argument to /handoff (or named the next session's focus in their message), treat it as the mission statement. The whole doc tailors to that mission.
Examples of argument shapes you might see:
/handoff respond to Codex's review on PR #364→ mission = "respond to Codex review, then merge"/handoff and create a skill for X→ mission = "create the X skill"/handoff continue Slice 3→ mission = "implement Slice 3 of the current epic"- (No argument) → infer the mission from the most recent in-flight work; if ambiguous, ask the user with a one-line question before writing.
Step 2 — Gather state without asking the user
The user is checking out; don't make them answer questions. Mine the state yourself:
git status --short
git log --oneline -10
git branch --show-current
gh pr list --repo <owner/repo> --author "@me" --state open
gh pr view <N> --json state,reviewDecision,mergeStateStatus,headRefOid # for each in-flight PR
date -u +"%Y-%m-%dT%H:%M:%SZ" # timestampAlso scan the recent conversation for:
- In-flight PRs + their status + any pending review comments.
- Recently merged work (last 1–2 PRs) and their merge commits.
- Open questions / decisions the user deferred or you couldn't resolve without them.
- External dependencies (waiting on Codex review, waiting on CI, waiting on user input).
- Memory entries that materially shaped recent decisions (cite them by filename — don't quote the body).
Step 3 — Choose the output path
OS temp directory, NOT the workspace. On macOS the canonical user-facing temp is /tmp/ (symlinked to $TMPDIR for the user's session). On Linux, /tmp/ is standard. Filename pattern:
/tmp/handoff-<short-kebab-slug>-<YYYY-MM-DD>.mdWhere <short-kebab-slug> is 3–5 words summarising the next session's focus (e.g. slice-3-and-skill, respond-codex-pr-364, bootstrap-rebuild).
If /tmp/ doesn't exist or isn't writable (rare), fall back to $(mktemp -d)/handoff.md and report that path.
Never write to:
- The repo workspace (
./,../, anywhere under the current project). - The user's home dir outside
~/.claude/. ~/.claude/plans/(that's for plan-mode artifacts; handoffs are not plans).
Step 4 — Identify references (don't duplicate)
Before writing a single line of doc body, enumerate every artifact that already captures something you'd otherwise restate. Reference these by path or URL; don't paraphrase their content.
| Artifact type | Common locations | How to reference |
| Design docs | docs/design/**/*-design.md, project-management/**/*-design.md, architecture/**/*.md, ADR folders | Path + section anchor (e.g. docs/design/foo-design.md §4.5) |
| Implementation plans | <docs-folder>/**/*-plan.md | Same |
| Peer-review threads (Codex, another Claude, human reviewer) | <repo>/.dialogue/*-review-thread.md, <docs-folder>/**/*-review-thread.md | Path; note whether closed (Final ACK both sides) or open |
| Open PRs | GitHub / GitLab | URL + PR number; cite head SHA |
| Merged PRs | Same | URL + merge commit SHA |
| Recent commits worth flagging | git history | SHA + one-line subject |
| Auto-memory entries | ~/.claude/projects/<project>/memory/*.md | Filename only (no body) — the next agent reads MEMORY.md on session start |
| Per-package / per-module specs | packages/<pkg>/{SPEC,CLAUDE}.md, apps/<name>/CLAUDE.md, <module>/SPEC.md | Path; note "assume loaded" for the next session |
| Plan files from plan-mode | ~/.claude/plans/<name>.md | Path; note approval status |
If you find yourself wanting to write out a 10-bullet summary of a doc, stop and reference the doc instead. The next agent reads what they need; pre-digesting wastes context.
Step 5 — Write the doc
Canonical structure — adapt section names but keep this order:
# Handoff — <one-line mission> (<YYYY-MM-DD>)
**Repo**: <absolute path> (one-line description)
**Branch at handoff**: `<branch>` (clean | dirty: <files>)
**Working tree**: <state as of timestamp>
## Mission for next session
<2–4 sentences. Lead with the action verb. If the user passed an argument,
this section is shaped around it. If multiple parallel tracks, name them
1. ... 2. ... so the next agent can pick one or run them concurrently.>
## Where we are
### Recent merge / open PR / pending work
<Table: work item × PR/branch × status × one-line note. Cite SHAs.>
### Canonical artifacts to read first
<Bullet list of paths/URLs the next agent MUST read before doing anything.
Order them by load-bearingness — most critical first.>
## Active work / context anchors
<For each in-flight thread, name:
- What it is + its current state (1–2 sentences)
- Where the canonical record lives (path/URL)
- Anything the next agent would otherwise have to reconstruct from this
conversation. THIS is the section where transient session knowledge
gets persisted; everything else is references.>
### Anticipated review push-back (when waiting on a peer review)
<If a PR is awaiting Codex or another reviewer, list the 2–4 specific
things you'd anticipate getting flagged, with defensive answers prepped.
This is the highest-value addition over what's already on disk.>
### Key memories worth recalling
<Table: filename × one-line summary. NEVER quote memory bodies. List
only the entries that materially shaped recent decisions; the next agent
loads the full index from MEMORY.md on session start.>
## Suggested skills
<Mandatory section. Table: skill name × why this session needs it.
Order by likely-first-invoked. Include the user-feedback skills
(`grill-me` before finalising plans, `pair-agent-harness` for Codex /
peer-review threads, etc.) that match the mission.>
## Open questions / decisions for the next session
<Numbered list of things you couldn't resolve without the user. Each item:
- The question (concrete, one sentence)
- The options you considered + your recommended call (if any)
- Why it's blocking (or note "non-blocking; can proceed without")>
## How to start the next session cleanly
<3–5 numbered steps. Almost always:
1. Read these CLAUDE.md files: ...
2. Read this handoff doc.
3. Check the in-flight PR / review thread / blocked task.
4. Invoke <primary skill> with <opening intent>.>
## Hand-off complete checklist
- [x] Branch state clean OR uncommitted changes documented above.
- [x] In-flight PR description has the full state-of-play; no comments need response from THIS session.
- [x] No secrets / PII in this doc.
- [x] References (not duplication): all canonical artifacts cited with paths/URLs/SHAs.
---
*Generated <ISO-8601 UTC timestamp>. Source conversation covered:
<one-line topic list>.*Step 6 — Redact
Scan the draft for sensitive content before writing:
- API keys / tokens / secrets: any string matching
sk-,whsec_,pk_,xoxb-,ghp_,eyJ, JWT-shaped tokens, anything from an.envexample. Redact to<REDACTED>or<example-key>. - Passwords: any line near the word "password", "passphrase", "secret".
- PII: full names other than the user's already-public profile, personal email addresses (other than the user's own as published in repo metadata), phone numbers, addresses, birthdays from journal content. The user's GitHub handle from a PR URL is public and OK.
- Database connection strings with credentials:
postgres://user:PASS@host/db→postgres://<REDACTED>@host/db. - Local file paths that include other usernames or sensitive directory names.
When in doubt, redact. Note redactions in a final line: *Redacted: <count> credentials and <count> PII items.*
Step 7 — Print the path
End the chat reply with:
Handoff doc written to <absolute-path>.Optionally add 2–3 sentences summarising the doc's structure (mission + the highest-value addition the doc makes vs. what's already on disk). Don't paste the doc body into chat — it's already in the file.
Doc-shape examples
The most recently written handoff (a worked example you can mimic) is at the path the user last invoked /handoff against. If that's not accessible:
- Two parallel tracks (most common): mission has two numbered items; structure has separate sub-sections per track.
- Single in-flight PR awaiting review: mission = "respond to review on #N"; the "Anticipated push-back" section becomes load-bearing.
- Mid-design pivot: mission = "decide between X and Y approach"; "Open questions / decisions" section is load-bearing.
Anti-patterns (do not do)
- Writing to the workspace. Handoff docs are ephemeral session bridges; they don't belong in git. If the user wants permanent docs, write to wherever the repo keeps them (
docs/,project-management/,architecture/, alongside code). - Paraphrasing the design doc / plan / PR body. Cite them. The next agent reads the artifact directly.
- Dumping the full memory index. Cite only the entries that shaped recent decisions;
MEMORY.mdloads automatically on session start. - Mid-conversation handoff ("checkpoint and continue"). Handoff is a session-boundary ritual. If you want a status pin without ending the session, just summarise in chat.
- Asking the user to fill in details before writing. The whole point of handoff is the user is checking out. Mine the state yourself; the only acceptable question is one-line clarification of the mission when truly ambiguous.
- Skipping the "suggested skills" section. Even when no skill obviously applies, suggest the closest ones (
grill-mefor plans,pair-agent-harnessfor any peer review, the most-recently-used domain skill). This section is what makes handoffs re-bootable. - Skipping redaction. Even if the conversation didn't visibly contain secrets, the next agent might widen access; scan systematically.
Validation checklist
Before reporting the path to the user, verify:
- File written to OS temp dir (path starts with
/tmp/or$TMPDIR), NOT the workspace. - Filename matches
handoff-<slug>-<YYYY-MM-DD>.md. - Frontmatter sections present in order: Mission, Where we are, Active work, Suggested skills, Open questions, How to start, Hand-off checklist.
- Mandatory "Suggested skills" section present with ≥2 entries.
- References use paths/URLs/SHAs; no duplicated content from cited artifacts.
- Redaction pass complete; sensitive content removed or replaced.
- Final timestamp + one-line topic summary at the bottom.
- Hand-off-complete checklist's items all checked (or unchecked items explicitly noted as known-incomplete).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

