/handoff-state:handofffrom handoff-state
Use when the session is about to end, context is about to compact, the user types /handoff, or work must move to a fresh session — serializes session state into a hot-swap payload before context is lost.
Ships in handoff-state. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Halt current work and compile the session into one high-density payload file the next session can boot from. The payload is the single source of truth for resumption; anything not in it is lost.
Write facts, not narrative. No apologies, no conversational filler, no "we discussed". Every line must be actionable by an agent with zero memory of this session.
Determine the payload directory by running ~/.claude/handoff/bin/handoff-path.sh — it prints
~/.claude/handoff/<repo-slug>/<worktree-key> (creating it). The payload path is that
directory + /HANDOFF.md.
One payload per worktree: a worktree is the unit of work continuity, and many agents work the same repo concurrently in different worktrees, so a repo-keyed payload would be a shared file each agent overwrites and the inject hook hands to whichever agent asks first.
Never write the payload inside the repository. <repo>/.claude/ is in the CLI's compiled-in
sandbox denyWrite list and also trips the background-session worktree isolation guard;
<repo>/docs/ lands in git and gets committed by accident. Storing beside the worktree rather
than in it also means the payload outlives the worktree's deletion.
If a HANDOFF.md already exists there, move it to <dir>/archive/<UTC timestamp>.md before writing.
Gather ground truth — do not rely on memory alone:
git status --porcelain and git log -5 --oneline (branch, dirty files, last commit)Write the payload file in exactly this schema:
# SKILL_HOT_SWAP_PAYLOAD
- GENERATED: [UTC timestamp] by /handoff
- OBJECTIVE: "[1-sentence definitive end-state goal]"
- ARCHITECTURE: "[Stack, dependencies, active environments]"
- LAST_STABLE_STATE: "[Commit hashes, working files, successful compilations]"
- ACTIVE_BLOCKERS: "[Current compilation errors, runtime failures, or missing variables — verbatim error text]"
- EXECUTION_QUEUE:
1. [Immediate next logical step to resume execution]
2. [Subsequent dependent task]
3. [Downstream milestone]
- MEMORY_DUMP:
```json
{
"state_variables": {},
"active_code_buffer": "",
"environment_configuration": {}
}
```
EXECUTION_QUEUE item 1 must be executable immediately with no further questions: name the file, the command, or the edit.MEMORY_DUMP.state_variables: decisions made, options rejected and why, key paths/IDs/URLs discovered this session.MEMORY_DUMP.active_code_buffer: only unsaved/in-flight code; if all work is on disk, leave "" and point to files in LAST_STABLE_STATE.MEMORY_DUMP.environment_configuration: env vars, running services, credentials locations (never secret values).After writing, print exactly (with <path> replaced by the actual path written in step 4):
⚙️ [SKILL_HANDOFF_LOCKED]: State payload compiled at <path>. Execute /clear or start a fresh session now.
Then STOP. No further work, no summary of the payload.
| Weak (reject) | Strong |
|---|---|
| "Continue working on the parser" | "Fix the failing test test_parse_dates in pipeline/tests/test_parser.py — assertion error on line 84" |
| "Some tests fail" | Verbatim first error line + command to reproduce |
| "Using the usual stack" | "CPython 3.14.6 / uv; run from pipeline/" |
git status — dirty files get lost.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub smacfiggen/agent-annex --plugin handoff-state