session-handoff by davila7/claude-code-templates
npx skills add https://github.com/davila7/claude-code-templates --skill session-handoff创建全面的交接文档,使新的 AI 代理能够无缝地继续工作,消除任何歧义。解决了长期运行的代理上下文耗尽问题。
确定适用哪种模式:
正在创建交接? 用户希望保存当前状态、暂停工作,或者上下文即将填满。
正在从交接恢复? 用户希望继续之前的工作、加载上下文,或提及现有的交接文档。
主动建议? 在完成大量工作(5 个以上文件编辑、复杂调试、重大决策)后,建议:
"我们已经取得了重大进展。考虑创建一个交接文档来保存此上下文以供未来会话使用。准备好时说 '创建交接'。"
运行智能脚手架脚本以创建预填充的交接文档:
python scripts/create_handoff.py [任务标识]
示例:python scripts/create_handoff.py 实现用户认证
对于连续性交接(链接到先前工作):
python scripts/create_handoff.py "认证-第二部分" --continues-from 2024-01-15-auth.md
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
脚本将:
.claude/handoffs/ 目录打开生成的文件并填写所有 [待办:...] 部分。优先处理以下部分:
使用 references/handoff-template.md 中的模板结构作为指导。
运行验证脚本以检查完整性和安全性:
python scripts/validate_handoff.py <交接文件>
验证器检查:
[待办:...] 占位符如果检测到密钥或评分低于 70,请不要最终确定交接。
向用户报告:
列出当前项目中的交接:
python scripts/list_handoffs.py
这将显示所有带有日期、标题和完成状态的交接。
加载前,检查交接文档的新旧程度:
python scripts/check_staleness.py <交接文件>
陈旧度级别:
脚本检查:
在采取任何行动之前,完整阅读相关的交接文档。
如果交接是链的一部分(有"继续自"链接),也请阅读链接的先前交接以获取完整上下文。
遵循 references/resume-checklist.md 中的检查清单:
从交接文档中的"立即执行的后续步骤"第 1 项开始。
工作时参考以下部分:
工作时:
--continues-from 创建一个新的交接以将它们链接起来对于长期运行的项目,将交接链接在一起以维护上下文谱系:
handoff-1.md (初始工作)
↓
handoff-2.md --continues-from handoff-1.md
↓
handoff-3.md --continues-from handoff-2.md
链中的每个交接:
从链恢复时,首先阅读最新的交接,然后根据需要参考前身。
交接存储在:.claude/handoffs/
命名约定:YYYY-MM-DD-HHMMSS-[标识].md
示例:2024-01-15-143022-implementing-auth.md
| 脚本 | 用途 |
|---|---|
create_handoff.py [标识] [--continues-from <文件>] | 使用智能脚手架生成新交接 |
list_handoffs.py [路径] | 列出项目中的可用交接 |
validate_handoff.py <文件> | 检查完整性、质量和安全性 |
check_staleness.py <文件> | 评估交接上下文是否仍然最新 |
每周安装次数
118
代码仓库
GitHub 星标数
22.6K
首次出现
2026 年 1 月 25 日
安全审计
安装于
claude-code100
opencode95
gemini-cli91
cursor91
codex83
antigravity79
Creates comprehensive handoff documents that enable fresh AI agents to seamlessly continue work with zero ambiguity. Solves the long-running agent context exhaustion problem.
Determine which mode applies:
Creating a handoff? User wants to save current state, pause work, or context is getting full.
Resuming from a handoff? User wants to continue previous work, load context, or mentions an existing handoff.
Proactive suggestion? After substantial work (5+ file edits, complex debugging, major decisions), suggest:
"We've made significant progress. Consider creating a handoff document to preserve this context for future sessions. Say 'create handoff' when ready."
Run the smart scaffold script to create a pre-filled handoff document:
python scripts/create_handoff.py [task-slug]
Example: python scripts/create_handoff.py implementing-user-auth
For continuation handoffs (linking to previous work):
python scripts/create_handoff.py "auth-part-2" --continues-from 2024-01-15-auth.md
The script will:
.claude/handoffs/ directory if neededOpen the generated file and fill in all [TODO: ...] sections. Prioritize these sections:
Use the template structure in references/handoff-template.md for guidance.
Run the validation script to check completeness and security:
python scripts/validate_handoff.py <handoff-file>
The validator checks:
[TODO: ...] placeholders remainingDo not finalize a handoff with secrets detected or score below 70.
Report to user:
List handoffs in the current project:
python scripts/list_handoffs.py
This shows all handoffs with dates, titles, and completion status.
Before loading, check how current the handoff is:
python scripts/check_staleness.py <handoff-file>
Staleness levels:
The script checks:
Read the relevant handoff document completely before taking any action.
If handoff is part of a chain (has "Continues from" link), also read the linked previous handoff for full context.
Follow the checklist in references/resume-checklist.md:
Start with "Immediate Next Steps" item #1 from the handoff document.
Reference these sections as you work:
As you work:
--continues-from to chain themFor long-running projects, chain handoffs together to maintain context lineage:
handoff-1.md (initial work)
↓
handoff-2.md --continues-from handoff-1.md
↓
handoff-3.md --continues-from handoff-2.md
Each handoff in the chain:
When resuming from a chain, read the most recent handoff first, then reference predecessors as needed.
Handoffs are stored in: .claude/handoffs/
Naming convention: YYYY-MM-DD-HHMMSS-[slug].md
Example: 2024-01-15-143022-implementing-auth.md
| Script | Purpose |
|---|---|
create_handoff.py [slug] [--continues-from <file>] | Generate new handoff with smart scaffolding |
list_handoffs.py [path] | List available handoffs in a project |
validate_handoff.py <file> | Check completeness, quality, and security |
check_staleness.py <file> | Assess if handoff context is still current |
Weekly Installs
118
Repository
GitHub Stars
22.6K
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code100
opencode95
gemini-cli91
cursor91
codex83
antigravity79
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
66,200 周安装