基础工具与工作流 · mattpocock/skills

claude-handoff

Hand the current conversation off to a fresh background agent that picks up the work immediately.

L2 本地 · 限定工作目录V1 已固定读写文件Dual-pass Audit
Author mattpocockGitHub mattpocock/skills ↗Stars 257659License MIT(GitHub API spdx MIT;仓库根 LICENSE: Copyright (c) 2026 Matt Pocock)Commit 3cca18b368
管控等级描述 skill 的能力与建议配套的管控措施,不代表质量或安全认证,也不表示可用或不可用。是否使用由用户和管理者决定。不同 agent 宿主对权限的约束各不相同,请勿假定宿主一定会提供安全兜底。第三方 skill 版权归原作者,使用风险由使用者自行承担。

1实现原理 · 为什么它能做到

核心动作是不落盘直启后台 agent:把当前会话压缩成交接摘要后,直接以摘要为 prompt 调 `claude --bg` 启动新 agent,而非像稳定版 handoff 那样写交接文档。

skills/in-progress/claude-handoff/SKILL.md
Write a handoff summary of the current conversation so a fresh agent can continue the work. Instead of saving it, launch a background agent seeded with the summary as its prompt: `claude --bg --name "<descriptive name>" "<handoff summary>"`. It starts in the current working directory and returns immediately; the user manages it with `claude agents`.
这里在做什么:'Instead of saving it' 一句话把本 skill 与 productivity/handoff(写文档交接)区分开——交接物从文件变成进程。

摘要内容纪律:必须带 suggested skills 段、用 path/URL 引用已有工件而非复制、并对敏感信息脱敏——因为摘要会成为新 agent 的 prompt。

skills/in-progress/claude-handoff/SKILL.md
Include a "suggested skills" section in the summary, naming which skills the next agent should call the Skill tool for.
脱敏指令原文:'Redact any sensitive information, such as API keys, passwords, or personally identifiable information, since the summary becomes the agent's prompt.'——模型写的摘要直接变成另一个 agent 的指令,故 redaction 是安全关键步骤。

仅用户显式触发:frontmatter 带 disable-model-invocation: true,Codex 清单以 policy.allow_implicit_invocation: false 配对;argument-hint 在触发时向用户要『下一会话用途』。

skills/in-progress/claude-handoff/SKILL.md
argument-hint: "What will the next session be used for?"
argument-hint 是 Claude Code 的用户输入提示;用户给的方向会进摘要('If the user passed arguments, treat them as a description of what the next session will focus on and tailor the summary accordingly.')。

命名纪律:必须传 -n/--name 描述性名称,用于作业列表/会话选择器/终端标题的展示。

skills/in-progress/claude-handoff/SKILL.md
Always pass `-n`/`--name` with a descriptive name (e.g. `--name "Fix login bug"`); it sets the display name shown in the job list, session picker, and terminal title.
面向 Claude Code 宿主的 CLI 参数约定;也说明本 skill 强依赖 Claude Code(`claude` 命令 + `claude agents` 管理界面)。

2核心能力

01一条命令把当前会话续给全新后台 agent(claude --bg,立即返回)
02按用户参数定向下一会话重点并裁剪摘要
03在摘要里推荐下一 agent 该调的 skills
04以 path/URL 引用既有工件(specs/plans/ADRs/issues/commits/diffs)避免重复内容
05摘要脱敏:redact API keys/密码/PII 后才交给新 agent

3外部依赖

KindDependency / Endpoint
cliclaude (Claude Code CLI)

4管控建议与判定依据

建议配套管控措施
面向 Agent
限定工作目录
面向管理者
保留操作记录
判定依据(文件路径与关键语句摘要)
  • 本地工作目录: 文件读写与工件输出: skill 自身不写文件(明确 'Instead of saving it');由它启动的后台 agent 将按宿主权限在 cwd 继续工作、可能读写
审计说明: 。调用的是本地官方 CLI(claude --bg)把会话交接给后台 agent:skill 自身无网络外发、无凭证读取指令、不落盘。注意点:① 摘要会成为新 agent 的完整 prompt,脱敏与注入面需留意(会话中不可信内容可能跨会话传播);② 后台 agent 以宿主工具权限在 cwd 继续执行,能做的操作 = 宿主给它的权限;③ 强依赖 Claude Code,跨宿主意义有限。均属可预期的本地工具使用,无代码级危险面。

5第二遍独立确认

  • [ok] claude --bg 调用点真实存在 — SKILL.md 正文逐字含 ``claude --bg --name "<descriptive name>" "<handoff summary>"``,且是唯一 CLI 调用指令。
  • [ok] user-invoked 双清单(disable-model-invocation + allow_implicit_invocation: false) — 两 manifest 均存在且取值正确;in-progress README 亦标 User-invoked。
  • [ok] 不落盘 vs productivity/handoff 写文档 — 原文 'Instead of saving it, launch a background agent' 明确;productivity/handoff/SKILL.md 存在且为写文档实现,两 skill 并存无冲突。
  • [ok] suggested skills / 引用不复制 / 脱敏三段纪律 — 三段原文均在 SKILL.md('suggested skills'、'Reference them by path or URL instead'、'Redact any sensitive information…')。
  • [ok] argument-hint 存在 — frontmatter 含 argument-hint: "What will the next session be used for?",且正文有对应的定向裁剪指令。
  • [ok] 无外部网络端点/凭证读取 — token 扫描零网络命中;无 env/keychain/文件凭证读取指令。claude --bg 为本地 CLI。
  • [ok] 命令注入面(安全反例检查) — 确认注入面真实存在(摘要进命令行 + 进新 agent prompt),已在 security.injection_surface 与 verdict.risks 显式记录;skill 自身无转义指令属宿主/模型责任,如实标注而非回避。
  • [ok] 元数据 — GitHub API:MIT、257659 stars、pushed_at 2026-09-04T08:45:43Z;本地 HEAD == 3cca18b。license 归属仓库根 LICENSE。

6结论

  • 零中间态交接:不写文件、一条命令把续作直接变成运行中的后台 agent,适合『换会话继续干』。
  • 摘要即质量的把关点:内置 suggested skills、引用而非复制、脱敏三条纪律,控制新 agent 冷启动质量与信息泄漏。
  • 保留用户编辑痕迹与工件单一来源:不复制 specs/ADRs/diffs 内容,避免双份真相。
  • 适合: 适合 Claude Code 用户遇到『当前会话上下文太满/需要换主题继续同一任务』时,把会话续给一个后台 agent(由 claude agents 管理),尤其是工作已部分落盘到 specs/commits、摘要可以引用而非搬运的场景。
    不适合: 不适合 Codex 等非 Claude Code 宿主(命令不可执行);不适合需要留下可审阅交接文档的团队流程(应选会写文档的 productivity/handoff);不适合会话里充满密钥/高度敏感信息且宿主无隔离的场合(脱敏依赖模型自觉)。
    Install Agent-Ready
    ① Verified Mirror 2026-09-09
    Option A · Direct DownloadDownload claude-handoff.tar.gz
    sha256: 09e04d39f394ef5b…
    Option B · Copy Guide for Agent
    install.json
    agent 读 JSON 指南后会自动从本站下载安装,无需更多说明。
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 3cca18b368.