Write a compact, decision-ready handoff so the next session (or the user) can continue without reconstructing the current one. Use when the session is ending, c
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-handoff-303eab60d737 ,按照其中的说明把「handoff」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Write a compact, decision-ready handoff so the next session (or the user) can continue without reconstructing the current one. Use when the session is ending, context is running low, the user asks for a handoff / "pass the baton" / "hand off", or a long-running operation needs a durable state checkpoint. The goal: the durable artifact survives, the context does not need to.
Invocation: model+user
Gather the truth from tools, not memory. Run/collect:
git branch --show-current, git status --short, git log --oneline origin/<default>..HEAD (what is local-only), git log --oneline -5
(recent context).gh pr list --state open,
gh pr checks <n>, gh run list) — only what the user's operation
actually depends on; do not pad the handoff with a full GitHub dump.Write a compact markdown handoff (aim under ~60 lines; the user may also ask for a "short text-only" variant — then aim under ~15 lines):
# Handoff — <operation/session name> — <date>
- **State:** <one-line: what is done vs in-flight vs blocked>
- **Landed/committed:** <exact SHAs + one-line what>
- **Branches/PRs:** <names + states; which are ours vs community>
- **CI:** <what is green, what is waiting, what is broken>
- **Blockers:** <exact blocker + what would unblock>
- **Decisions made:** <the WHY that a fresh session must not re-litigate>
- **Next step:** <the single next action, one line>
- **Continuation records:** <pointers to partial work that must be
preserved (worktrees, uncommitted files, receipts)>
Persist it. Always write .codewhale/handoff.md in the workspace — that
is the only path the runtime reads back. On the next session's first turn it
is injected as the "## Previous Session Relay" block
(HANDOFF_RELATIVE_PATH, crates/tui/src/prompts.rs:85; loader at
prompts.rs:301-315). A handoff written anywhere else is never picked up,
so the next session starts cold no matter how good the note is.
Optionally also write a human-discoverable copy:
codewhale-ops/notes/
with a living handoff file), update the living handoff's dated facts and
snapshot, or create <topic>-handoff-<date>.md next to it.HANDOFF.md or
docs/handoff/<topic>-<date>.md. These are for people; nothing in the
runtime reads them. Never overwrite someone else's uncommitted handoff
without reading it first.Clear the way for the new session ("clears context"). A skill cannot delete the current context, but it can make the context disposable:
Deliver. Give the user the compact handoff text in your reply (the persisted file is the durable copy; the reply is the readable one).