跳到正文
Skillpedia
自动化101k · #1271

handoff

它能做什么

这个工具会生成一个名为 `HANDOFF.md` 的文件。它总结了你想要达成的目标、哪些方法有效、哪些失败了,以及接下来的步骤。它就像一份交接说明,让别人(或者之后的你自己)能从上次停下的地方准确接着做。

适用场景

  • ✓当你和 AI 的对话太长、内容已经混乱时。
  • ✓当 AI 一直在尝试同一个行不通的方案时。
  • ✓当你需要暂停工作、之后再接着做时。

技能链接

https://github.com/thedotmack/claude-mem/blob/main/plugin/skills/handoff/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedotmack/claude-mem/blob/main/plugin/skills/handoff/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“创建一个总结文件,方便继续这项工作。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会分析主要目标、当前项目的状态(哪些部分正常、哪些不正常)、改动过的文件、失败的尝试以及后续步骤,然后把这些内容整理成一份便于接续的文档。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Handoff

Generate a structured HANDOFF.md file that gives a fresh Claude session everything it needs to continue this work without dragging the current degraded context forward.

claude-mem already injects recent observations into every new session, so the fresh agent starts with a timeline of what happened. The handoff adds what that timeline cannot: the goal, the failed attempts and why they failed, the current theory, and exact next steps, plus pointers into memory for deeper recall.

When to Use

  • The session is long and Claude feels confused or repetitive
  • Claude keeps trying the same failing solution over and over
  • The user wants to step away and resume later
  • /compact ran but Claude still lacks clear direction
  • The user says "handoff", "generate a handoff", "I want to start fresh", or "write a handoff doc"

What to Capture

Think hard about the full arc of this conversation before writing. The handoff must be useful to a Claude instance that has never seen this conversation.

Required Sections

  1. Goal — One paragraph. What is the user actually trying to accomplish? State the end state, not the current sub-task. Be specific enough that a fresh agent can orient immediately.

  2. Current State — What is working right now? What is broken? What is the exact symptom of the problem? Include error messages verbatim if relevant.

  3. Files in Play — List every file that has been read, edited, or created during this session that is relevant to the current task. Use absolute or repo-relative paths. Include a one-line note on why each file matters.

  4. What Has Been Tried (and Why It Failed) — This is the most important section. List every approach attempted that did not work, and explain WHY it failed (not just that it failed). A fresh agent that skips this section will repeat the same mistakes.

  5. Current Best Theory — What do you currently believe is the right path forward, even if you haven't proven it yet? Include any evidence or reasoning that supports it.

  6. Next Steps — Concrete, ordered actions for the fresh agent to take. Be specific: file paths, function names, commands to run. The fresh agent should be able to start on step 1 immediately.

  7. Key Constraints and Context — Any non-obvious constraints: environment specifics, user preferences expressed during this session, things the user explicitly said NOT to do, external dependencies, performance requirements, etc.

  8. Memory Pointers — If claude-mem's search tools are available, run search for this task's key terms and list the few observation IDs that matter most (a decision, the root cause, a failed approach), so the fresh agent can pull full details with get_observations. Also list one or two search queries worth re-running. Skip this section if the tools are not available.

Writing Rules

  • Write the handoff for a fresh Claude, not for the user. The user knows what happened; the fresh Claude does not.
  • Be ruthlessly specific. Vague next steps are useless. "Fix the auth" is bad. "In src/auth/middleware.ts:47, the token expiry check uses Date.now() but should use req.timestamp — change the comparison on line 52" is good.
  • Include exact error messages, stack traces, or test output that captures the failure mode.
  • Do not pad. Every sentence should be load-bearing information for the fresh agent.
  • Do not write the handoff from the user's perspective. Write it as a briefing document addressed to the incoming agent.

Output

Write the handoff to HANDOFF.md in the current working directory (the project root).

Use this structure:

# Handoff

> Generated: [timestamp]  
> Project: [project name or directory]  
> Session summary: [one sentence describing what this session was about]

## Goal

[What the user is trying to accomplish — the actual end state]

## Current State

**Working:**
- [list what is confirmed working]

**Broken:**
- [exact symptom, error message, or failure mode]

## Files in Play

| File | Why It Matters |
|------|---------------|
| `path/to/file.ts` | [one line] |

## What Has Been Tried (and Why It Failed)

### Attempt 1: [short name]
- **What:** [what was done]
- **Why it failed:** [root cause, not just "it didn't work"]

### Attempt 2: [short name]
...

## Current Best Theory

[What you currently believe is the correct approach and why]

## Next Steps

1. [Specific, actionable step with file path or command]
2. [Next step]
3. ...

## Key Constraints


…
常见问题

为什么需要这个文件?

它能确保任何人(包括新开的 AI 会话)都能快速了解工作进展,从而接着做下去,不会丢失重要信息,也不会重复犯同样的错误。

生成 `HANDOFF.md` 文件之后我该做什么?

新开一个与 AI 的会话,让它读取 `HANDOFF.md` 文件,然后接着完成这项工作。

我应该把 `HANDOFF.md` 文件保留在项目里吗?

通常不需要,它只是临时文件。新的 AI 会话读取并接续工作之后,你可以删除它,或者把它加入 `.gitignore`,避免被永久保存。

详情

作者的原始描述

Generate a HANDOFF.md that captures goal, current state, files touched, failed attempts, and next steps — so a fresh Claude session can continue exactly where this one left off. Use when sessions are getting long, Claude keeps retrying the same broken solution, or the user wants to step away and resume later.

repo: thedotmack/claude-mem

热度

GitHub 星标
101k
排名
#1271
许可证
Apache-2.0
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能