先看看示例
作者提供的示例,实际效果取决于你的输入和使用工具。
输入
为修复登录缺陷的后续会话写交接摘要,注明相关提交与建议技能,再启动名为 Fix login bug 的后台代理。
输出
预期交付:临时目录中的交接摘要文件,以及以该文件为提示启动的后台代理会话。(编辑说明,非实际运行结果)
方法说明
--- name: claude-handoff description: Hand the current conversation off to a fresh background agent that picks up the work immediately. argument-hint: "What will the next session be used for?" disable-model-invocation: true --- Write a handoff summary of the current conversation so a fresh agent can continue the work. Save it to the temporary directory of the user's OS, then launch a background agent seeded with it as its prompt: `claude --bg --name "<descriptive name>" -- "$(cat <summary file>)"`. Passing the file keeps the shell from running backticks or expanding `$` in the summary. It starts in the current working directory and returns immediately; the user manages it with `claude agents`. 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. Include a "suggested skills" section in the summary, naming which skills the next agent should call the Skill tool for. Do not duplicate content already captured in other artifacts (specs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead. Redact any sensitive information, such as API keys, passwords, or personally identifiable information, since the summary becomes the agent's prompt. If the user passed arguments, treat them as a description of what the next session will focus on and tailor the summary accordingly.