Use when ending a session mid-work and a fresh agent (or future you) needs to pick it up — context budget running out, a task blocked, or a deliberate stop. Compacts the live conversation into a handoff document saved to the OS temp dir, with a suggested-skills section and references to durable artifacts. Do not use to record durable project state — that is /lean-doc-generator close (sprint record) or a commit.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Handoff?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/aldianriski-handoff)
---
name: handoff
description: Use when ending a session mid-work and a fresh agent (or future you) needs to pick it up — context budget running out, a task blocked, or a deliberate stop. Compacts the live conversation into a handoff document saved to the OS temp dir, with a suggested-skills section and references to durable artifacts. Do not use to record durable project state — that is /lean-doc-generator close (sprint record) or a commit.
argument-hint: "[what the next session will focus on]"
allowed-tools: Read, Write, Bash, Glob, Grep
user-invocable: true
version: "0.1.0"
---
# handoff
Compact the current conversation into a handoff document so a fresh agent can continue without
re-deriving everything. **Transient, not durable** — this is the conversation's working state, not a
project record. Pairs with `/prime`: handoff out at session end → `/prime` + read the handoff in.
`TODO.md` present and no `docs/work/` → v1 · both present → mixed · only `docs/work/` → v2 (existence only, never content).
On v1 or mixed, name it and refuse to write the status stub — point to `/lean-doc-generator migrate`, the only 2.x path for a v1 tree.
## When to invoke
- The session's context is past ~200k (or the host's `lane-context-ceiling:`) at a task boundary and work is unfinished;
in a lane, also send the coordinator "rotate me `<path>`" (→ `/orchestrator` `references/coordinator.md` § 8 Lane rotation).
- A task is blocked and the next session will resume it.
- A deliberate stop mid-task, or a planned agent-to-agent handoff.
Not a substitute for `/lean-doc-generator close` (durable sprint record + CHANGELOG) or a commit.
## Where it saves
Write to the **OS temp directory, not the workspace** — a handoff is throwaway and must not pollute
the repo or git status. Resolve temp per platform:
- Windows: `$env:TEMP` (e.g. `C:\Users\<you>\AppData\Local\Temp`)
- macOS / Linux: `$TMPDIR` or `/tmp`
Filename: `handoff-<short-slug>.md`. Emit the absolute path so the next session can read it.
**Before saving**, pass the doc's prose through `/humanizer` embedded mode (the humanizer skill's `references/embedded.md`; format `markdown`; voice sample = the "What goes in" outline below, since no template file exists).
Never changed: paths, commands, ids, the `handoff-path` line and the status fields. A failed pass saves the original text plus the contract's one-line notice; it never blocks the handoff.
## What goes in
1. **Goal / focus** — what this work is trying to achieve. If the user passed an argument, treat it as the next session's focus and tailor the doc to it.
2. **State** — what's done, what's in progress, what's left. Be concrete (files touched, decisions made).
3. **Next steps** — the ordered list the next agent should start with.
4. **Blockers / open questions** — anything unresolved, with what's needed to unblock. A sprint run's ready frontier lands here as rounds with a recommended answer per question; dependents wait for prerequisite answers (`orchestrator/references/sprint-bulk-run.md` § Runtime).
5. **Uncertain writes** — every write you started but did not see finish (a worktree agent that timed out, a remote gate run whose connection dropped, a merge-back that stopped part-way, a push with no reply), plus any you inherited from an earlier handoff and have not yet reconciled:
the operation, its target, and how to read it back. A timeout does not prove it failed. Write `none` when there is none; never omit the item.
6. **Suggested skills** — which skills the next agent should invoke (e.g. `/prime` first, then `/orchestrator` to resume, `/diagnose` for the failing test).
7. **References — do not duplicate** — point to durable artifacts by path or URL (PRDs, ADRs, the sprint file, commits, diffs, issues). Summarize only what is NOT already captured elsewhere.
## Repo-side status stub (STANDARD §12(b))
The temp-dir doc stays out of the repo — that placement is correct and unchanged. What lean-flow
was missing is a **status stub**: a repo-side record of whether this handoff is `live` (a session
may still resume it), `consumed` (a session resumed it and continued), or `spent` (superseded, or
the sprint closed past it) — so "was this actioned?" is answerable without opening the temp file.
1. **Resolve context** — after the layout check above (v1/mixed stops here): find the active sprint
in the store — never through `TODO.md`. Candidates are the top-level `docs/sprint/SPRINT-*.md`
files only (not `logs/`, whose files carry `status:` too, nor `archive/`) whose frontmatter reads
`status: active`; on a multi-stream repo keep the one whose `stream:` matches the work in hand
(still more than one → ask). Its members — the `## Members` paths ∪ every `docs/work/*/TASK-*.md`
stamped `sprint: SPRINT-NNN`, whatever folder it sits in — name the task in focus. The log to use
is `docs/sprint/logs/` + the sprint file's own filename (it exists since promote; create it from
`sprint-log.md.template` only if absent — a sprint promoted before that rule). A handoff is the sprint's own when the
session's focus names a member task of that sprint; any other is a side handoff and goes to the fallback ledger, root
`HANDOFF-LEDGER.md` (create lazily, same two-field shape, no sprint-specific content), as does any handoff with no
active sprint. Unsure whether the focus is a member task → ask.
2. **Close out a prior handoff you are now resuming** — find the record being resumed by its
`handoff-path`, or check both the sprint Log and the ledger. If its newest entry is `handoff-status: live`,
append one entry reusing that `handoff-path` with `handoff-status: consumed` to the file that holds it —
Log or ledger, not necessarily the one step 1 picked — before writing the new one below.
3. **Append the new stub**, after writing the temp doc:
```
### YYYY-MM-DD | handoff | <one-line focus>
handoff-status: live
handoff-path: <the absolute temp path printed below>
```
Never restate the doc's content here — the stub is a status record, not a second copy of the
notes (STANDARD §12(b) still bars committing raw notes).
## Hard rules
- **Redact secrets** — never write API keys, passwords, tokens, or PII into the doc.
- **Reference, don't copy** — if it's already in a commit / ADR / sprint file / issue, link it; don't restate it.
- **Temp dir only** — never write the handoff DOC into the workspace or stage it in git; only its
two-field status stub is repo-side (§ Repo-side status stub).
- **Transient** — the doc captures conversation state; durable decisions still belong in DECISIONS.md / CHANGELOG via `/lean-doc-generator`.
## Output format
```
=== HANDOFF WRITTEN ===
Path: <absolute temp path>
Focus: <one line>
Stub: <sprint log path, or HANDOFF-LEDGER.md> -- handoff-status: live
Next: open a fresh session → /prime → read the handoff path above → resume
=======================
```
## Red flags
❌ **Writing into the repo** — handoffs are throwaway; they belong in the OS temp dir.
❌ **Duplicating a PRD / ADR / diff** — reference it by path; don't restate it.
❌ **Leaking a secret** — redact every credential and PII before saving.
❌ **Using this for durable state** — sprint records and decisions go through `/lean-doc-generator`, not here.
❌ **Skipping the status stub, or writing the raw notes into it** — either leaves "was this
actioned?" unanswerable from the repo alone, which is the exact silent loss STANDARD §12(b)'s
conversion exists to close (SPRINT-094 T2).
❌ **Restating the live sprint / task state** (open DoD, current task list) — `/prime` re-reads it next session, so restating it is paid twice; capture only the *ephemeral* (in-flight reasoning · the immediate next action) and point to the sprint file and its member task files for the durable task state.