← 返回 Skills 市场
clarezoe

Session Handoff

作者 clarezoe · GitHub ↗ · v1.5.1 · MIT-0
cross-platform ✓ 安全检测通过
56
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install sg-session-handoff
功能描述
Summarize the current session into a precise, file-saved handoff document covering goals, files changed, commands run, errors, decisions, and next steps. Use...
使用说明 (SKILL.md)

Session Handoff

Use this skill when the user says "handoff", "summarize this session", "create a handoff", "hand this off", or invokes /handoff.

Produce a precise handoff document and write it to a file. Do not ask the user questions — derive everything from conversation history and git state.

If the user provides arguments, treat them as the intended focus of the next session and prioritize that focus in Goal, Current State, and Next Steps. If the user says "update handoff" or similar, update the most recent handoff file in place instead of creating a new one.

This skill writes the artifact. Use handoff-receiver when the task is to continue execution from an existing handoff.


Step 1: Determine output path and index files

  1. If .trellis/ exists in the working directory → write to .trellis/handoffs/YYYY-MM-DD-HH-MM.md
  2. Else if docs/ exists in the working directory → write to docs/handoffs/YYYY-MM-DD-HH-MM.md
  3. Otherwise → write to handoff.md in the project root
  4. If the handoff directory is not the project root, maintain \x3Chandoff-dir>/CURRENT as the active pointer
  5. Maintain \x3Chandoff-dir>/INDEX.md as the compact handoff index
if [ -d ".trellis" ]; then
  mkdir -p .trellis/handoffs
  HANDOFF_DIR=".trellis/handoffs"
elif [ -d "docs" ]; then
  mkdir -p docs/handoffs
  HANDOFF_DIR="docs/handoffs"
else
  HANDOFF_DIR="."
fi
if [ "$HANDOFF_DIR" = "." ]; then
  HANDOFF_PATH="handoff.md"
  CURRENT_PATH="CURRENT"
  INDEX_PATH="INDEX.md"
else
  HANDOFF_PATH="$HANDOFF_DIR/$(date +%Y-%m-%d-%H-%M).md"
  CURRENT_PATH="$HANDOFF_DIR/CURRENT"
  INDEX_PATH="$HANDOFF_DIR/INDEX.md"
fi
printf '%s\
%s\
%s\
' "$HANDOFF_PATH" "$CURRENT_PATH" "$INDEX_PATH"

Before creating a new handoff, if CURRENT points to an existing active handoff, update that file:

  • status: paused
  • updated_at: \x3Cnow>

Do not rewrite handoffs already marked done or superseded. Use superseded only when you are explicitly replacing the same work stream.


Step 2: Gather facts from git

Run these commands to get objective facts. Do not skip any.

# What changed
git status --short
git diff --stat HEAD
git log --oneline -10

# What branch
git rev-parse --abbrev-ref HEAD

# Any stash
git stash list

Use results to populate the Files Changed and Commands Run sections.


Step 3: Extract from conversation

Review the full conversation to extract:

Field How to find it
Goal What the user asked for at the start or most recently
Files Changed Tool calls to Edit/Write + git diff output
Commands Run Bash tool calls — extract the command and its outcome
Errors Any tool errors, failed commands, stack traces mentioned
Decisions Choices made between options, trade-offs accepted, scope cuts
Next Steps Unfinished work, items explicitly deferred, follow-ups named
History Commit hashes and branch/state changes that matter to the next session

Be precise. Prefer concrete facts over summaries. Include file paths and line numbers where known.

Avoid duplicating content already captured in other artifacts (PRDs, plans, ADRs, issues, commits, diffs). Reference those artifacts by path or URL in the relevant sections instead of repeating long content.


Step 4: Write the handoff file

Use this exact template. Fill every section — write "none" if a section is genuinely empty.

---
status: open
created_at: YYYY-MM-DD HH:MM
updated_at: YYYY-MM-DD HH:MM
taken_over_at:
taken_over_by:
superseded_by:
source_handoff:
stream_note:
---

# Session Handoff

**Date**: YYYY-MM-DD HH:MM  
**Branch**: \x3Cbranch name>  
**Working directory**: \x3Cabsolute path>

---

## Goal

\x3COne paragraph. What was the user trying to accomplish and why? Be specific — not "improve the app" but "add X to Y so that Z".>

---

## Files Changed

| File | Change |
|------|--------|
| `path/to/file.ts` | Added `functionName()`, removed deprecated `oldFn()` |
| `path/to/config.yml` | Updated `timeout` from 30 to 60 |

*(list only files with actual changes; omit read-only)*

---

## Commands Run

| Command | Outcome |
|---------|---------|
| `npm run build` | ✓ passed |
| `git push origin main` | ✗ rejected — no upstream set |

---

## History

Summarize the commit and branch history that matters for the next session.

Include:
- recent commit hashes
- branch rewrites or force-pushes
- merges, rebases, or resets that changed the working line of development

---

## Errors Encountered

- **Error**: `Cannot find module './utils'` in `src/index.ts:12`  
  **Resolution**: Added missing import; resolved.

- **Error**: `git push` rejected  
  **Resolution**: Unresolved — see Next Steps.

*(list errors that occurred, whether resolved or not)*

---

## Decisions Made

- **Chose X over Y** because: \x3Creason>
- **Deferred Z** because: \x3Creason>
- **Accepted trade-off**: \x3Cwhat was given up and why>

---

## Current State

\x3COne paragraph. Where does the work stand right now? Is it working? Partially done? Blocked? What is the state of the codebase at this moment?>

---

## Next Steps

1. [ ] \x3CConcrete action — specific file, command, or decision needed>
2. [ ] \x3CNext action>
3. [ ] \x3CStretch / nice-to-have if time allows>

---

## Context for the Next Session

\x3CAny non-obvious context a new AI or developer would need to pick this up: gotchas, environment quirks, why something was done a certain way, what was explicitly ruled out.>

Step 5: Update pointer and index

Write the final handoff path into CURRENT. Then update INDEX.md with one row per tracked handoff:

Path Status Updated Goal
.trellis/handoffs/2026-05-22-13-10-search.md open 2026-05-22 13:10 Document the search feature handoff flow

Rules:

  • keep rows stable and append-only when possible
  • update only minimal metadata: path, status, updated_at, short goal summary
  • never duplicate full handoff bodies inside the index
  • preserve paused, done, and superseded rows for historical routing

handoff-receiver should read CURRENT and INDEX.md first. It should not scan the directory in the common case.


Step 6: Confirm to user

After writing the file, output exactly:

Handoff written to: \x3Crelative path to file>

## Goal
\x3Cone sentence summary>

## Next Steps
\x3Cnumbered list from the file>

Do not output the full file contents in chat — the file is the artifact. The inline summary is just a quick confirmation.


Anti-patterns

  • Do not ask the user "what did we work on?" — derive from conversation.
  • Do not write vague entries like "various files updated" — be specific.
  • Do not skip the git commands — they provide objective ground truth.
  • Do not create a new handoff if the user says "update handoff" — overwrite the most recent one.
  • Do not leave multiple active handoffs without updating CURRENT.

Example

If the handoff directory contains:

  • CURRENT.trellis/handoffs/2026-05-22-12-40-open-core.md
  • .trellis/handoffs/2026-05-22-12-21-onboarding.md with no status

and you create .trellis/handoffs/2026-05-22-13-10-search.md, then:

  • 2026-05-22-12-40-open-core.md becomes status: paused
  • 2026-05-22-12-21-onboarding.md remains untouched until indexed
  • CURRENT moves to 2026-05-22-13-10-search.md
  • INDEX.md contains one row for each known stream
安全使用建议
Install this if you want an agent to save local handoff notes in your project. In shared or sensitive repositories, consider asking for a preview or dry run before writes, and keep handoff files version-controlled or otherwise recoverable because the skill can update existing handoff state.
能力评估
Purpose & Capability
The skill’s purpose is coherent: it gathers conversation and git state, then writes a handoff document so work can be resumed later.
Instruction Scope
It tells the agent not to ask follow-up questions and to infer content from history and git state, which is practical for handoffs but can produce unwanted writes if invoked casually.
Install Mechanism
The artifact is a single Markdown skill with no executable scripts, package dependencies, background services, or network setup.
Credentials
Bash, Read, Write, Glob, and Grep access are proportionate for reading git state and creating local handoff files; no credential or remote API use is present.
Persistence & Privilege
It intentionally creates persistent repository files and maintains CURRENT and INDEX.md metadata, including updating prior active handoffs, so users should understand the local file impact.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install sg-session-handoff
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /sg-session-handoff 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.5.1
Add tags for discoverability
v1.5.0
Initial ClawdHub publish: precise file-saved handoff with CURRENT pointer, INDEX.md, and handoff-receiver integration
元数据
Slug sg-session-handoff
版本 1.5.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Session Handoff 是什么?

Summarize the current session into a precise, file-saved handoff document covering goals, files changed, commands run, errors, decisions, and next steps. Use... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 56 次。

如何安装 Session Handoff?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install sg-session-handoff」即可一键安装,无需额外配置。

Session Handoff 是免费的吗?

是的,Session Handoff 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Session Handoff 支持哪些平台?

Session Handoff 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Session Handoff?

由 clarezoe(@clarezoe)开发并维护,当前版本 v1.5.1。

💬 留言讨论