handoff
Save or resume a HANDOFF across sessions. Use for 'wrap up' or 'save state'; in-session re-orientation belongs to recap-state.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- handoff
- version
- 0.3.0
- description
- Save or resume a HANDOFF across sessions. Use for 'wrap up' or 'save state'; in-session re-orientation belongs to recap-state.
- user-invocable
- true
02 资源文件 4
- 参考文档README.ja.md7.0 KB
- 参考文档README.md5.7 KB
- 参考文档README.zh-TW.md5.6 KB
- 参考文档references/handoff-schema.md31.8 KB
03 SKILL.md 正文
Handoff
Preserve session state for a cold AI reader in a structured file under
.claude/handoffs/. Use Prepare mode when a user is ending a session and
Resume mode when starting from a prior HANDOFF. For in-session
re-orientation use loom-workflow:recap-state; this is not /recap or
agent-to-agent delegation.
The artifact is an operational restart record, not a polished human summary. Its job is to let a new session prove that repository and tool state still match, recover the user's exact intent, and stop before changing anything. Completeness and precision therefore outrank narrative flow, but repeated schema teaching belongs in the reference rather than this always-loaded file.
Prepare mode
Before authoring any HANDOFF artifact, read references/handoff-schema.md fully.
It is the unchanged authority for the template, field semantics, and examples.
Do not reconstruct the schema from this entrypoint. Then:
-
Run these state-gathering commands and preserve their output verbatim:
git rev-parse HEAD git rev-parse --abbrev-ref HEAD git status --short git log --oneline -5 claude --version 2>/dev/null || codex --version 2>/dev/null || printf '%s\n' 'N/A — host CLI unavailable' -
Write
.claude/handoffs/HANDOFF-YYYY-MM-DD-HHMMSS-<slug>.md, with a short kebab-case slug, using all 10 blocks in schema order:- Frontmatter
- Situation
- Background
- All user messages
- Recent decisions
- Pending
- Critical files
- Do Not Touch
- Verification commands
- Confidence flags
Populate them according to the schema: frontmatter records
conversation_language, git state, and host version. Thetools.claude_codefield holds Claude output,N/A — Codex <version>, orN/A — host CLI unavailable. Situation is one exact sentence; Background retains decisions, rejected paths, and critical paths. All user messages includes every turn verbatim. Recent decisions uses Decision / WHY / Rejected alternative triples. Pending is a P1/P2/P3 checklist. Critical files names each path, why it matters, and whether it changed. Do Not Touch gives exact paths and reasons. Verification commands are runnable assertions with expected output. Confidence flags rate every block with the schema's ✅/⚠️/❓ vocabulary.Set
conversation_languageto the language used with the user, not the language returned by a subagent or command. Preserve exact paths, identifiers, commands, full error messages, decisions, rejected alternatives, and user turns. The reader has zero conversational context; vague phrases such as "the usual file" or "tests mostly pass" are invalid. -
In Block 9 tag every command [T1] load-bearing or [T2] advisory. Use [T1] for facts whose drift makes the saved next action unsafe or wrong, such as HEAD, branch, tool version, PR state, or test counts. Use [T2] for informative state that can change benignly but still deserves review. The new HANDOFF itself may add one untracked
git status --shortentry after the initial snapshot. Never make the raw status line count [T1]: either re-snapshot after writing or label it [T2] and record this known benign drift. -
Append a closing
## Resume Launcherand print the same copy-paste init prompt in chat. This launcher is a thin pointer, not a context re-dump. It must name the exact HANDOFF path, work without this skill installed, direct the next session to read the file, run [T1] checks, report [T2] drift, perform the Synthesis-check before acting, reply inconversation_language, and end with a blankUSER DIRECTIVE:line. Do not reproduce any HANDOFF blocks in the launcher: the file remains the single source of truth. Append first so the launcher survives the current session, then show the identical text to the user for immediate copying.
If the user also wants this session's intent captured as an explicit goal with
its own acceptance condition rather than only saved state, loom-workflow:goal-create
is a separate option they can invoke themselves; Prepare mode only names it and
never invokes it.
Resume mode
Before interpreting any HANDOFF artifact, read references/handoff-schema.md fully.
This read happens before judging, verifying, summarizing, or acting on the
artifact; do not rely on memory of a prior schema version. Then:
If the schema read is unavailable, fail closed: do not interpret or execute the artifact. Still report any self-evident missing evidence in the supplied input, such as a verification command with missing expected output, and request the schema plus a corrected HANDOFF rather than treating read access as the only blocker.
-
Find the latest file:
ls -t .claude/handoffs/ | head -1 -
Read that HANDOFF fully. Adopt its
conversation_languagefor every user-facing reply instead of defaulting to English. Keep subagent and tool output in its source language internally, but localize it before surfacing it to the user. Do not skim or begin pending work while reading. -
run every command in Block 9. Report verbatim output next to expected output; do not collapse several results into a summary:
Command: git log --oneline -5 Expected: abc123 at top Actual: abc123 feat(loom-workflow): ... ← MATCH -
Apply the mismatch tiers command by command; an untagged command is treated as [T1], fail-safe.
- A [T1] mismatch in HEAD, branch, version, PR state, test count, or other
load-bearing state means REFUSE TO CONTINUE. Quote command, expected,
and actual output, explain that state drifted, and ask how to proceed:
Load-bearing verification mismatch on
<command>: expected<X>, got<Y>. State has changed since the handoff was written. How do you want to proceed? - A [T2] mismatch must still be reported verbatim and judged. Proceed
only when it matches a recorded benign cause such as the known benign drift
from the HANDOFF file itself; otherwise ask the user. Never silently waive
it or treat every advisory mismatch as a hard stop. For example:
Advisory mismatch on
git status --short: expected 3 untracked lines, got 4 — the extra line is.claude/handoffs/itself (the known benign drift). Proceeding.
- A [T1] mismatch in HEAD, branch, version, PR state, test count, or other
load-bearing state means REFUSE TO CONTINUE. Quote command, expected,
and actual output, explain that state drifted, and ask how to proceed:
-
Only after full verification passes, give a 3–5 bullet Synthesis-check covering situation, pending work, and next step, then ask the user to confirm or redirect. Do not act until the user responds.
Invariants
Apply the schema's five principles every time:
- structured-schema — use all 10 blocks in order, never a free-form narrative substitute.
- quote-not-paraphrase — preserve load-bearing strings exactly, especially user intent, paths, identifiers, and errors.
- all-user-messages — include every user turn without deciding which ones seem important; the cold reader has no other user-intent record.
- synthesis-check — Resume mode ends at the directed confirmation question and waits for the user's answer.
- technical-precision — retain exact paths, identifiers, errors, commands, and expectations even when plainer wording would sound smoother.
Boundaries
- Do not author
.claude/handoffs/outside Prepare mode; other locations break the discovery command and this directory is canonical. - Do not skip or sample Verification commands in Resume mode, even when the HANDOFF is recent. Run all of them before synthesis.
- Do not substitute a free-form summary for the 10 blocks or filter Block 4.
- Do not use this for in-session recap, an away-summary, or parallel delegation.
- Do not use
/compactas a substitute for intentional handoff: compaction does not preserve the complete verbatim user-message record.
See also
references/handoff-schema.md— SSOT for 10-block template, 5 principles definitions, good-example / bad-example pair.
04 同仓库更多 Skills
using-loom-workflow
Route broad Loom workflow-tool requests to the right skill. Use when the request spans tools or the right workflow skill is unclear.
skill-retro
Review selected past or current Claude Code or Codex sessions against readable target skill sources and related integration. Produce source-linked proposals without applying changes.
recap-state
Give an in-session recap of current progress for 'where were we', '我們剛剛在幹嘛', '剛剛講到哪', '我跟丟了', 'ちょっと振り返って', '今どこだっけ', or '振り返り'. The built-in /recap is an away-summary.
project-retro
Review one current or specified coding session for source-backed project development improvements. Use for a requested retrospective, including 振り返り seeking improvements; not for current-progress recaps or recurring skill mining.
loom-visualization
Show comparisons, flows, decisions, states or reasoning chains as tables, ASCII or Mermaid in coding chat, including when a Loom station reports to the user (intent restatement, choices, acceptance test results); not Obsidian notes.
loom-memory
Record repo-wide lessons when saving to your own memory or asked to remember; recall, reconcile, or forget them when a task needs it.