wrap-up
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/wrap-up
/wrap-up
What
功能说明
The session continuity ritual. Sessions are ephemeral; knowledge is permanent.
Wrap-up bridges sessions in both directions:
- Session END — capture exactly three things: what was DONE, what is
PENDING, and what was LEARNED. Write them to and flow durable learnings into
.claude/handoff.md.MEMORY.md - Session START — load the handoff, memory, and instincts, then present a resume summary so no session starts blind.
会话连续性流程。会话是短暂的,但知识是永久的。
收尾功能在两次会话之间搭建桥梁:
- 会话结束 — 准确记录三项内容:已完成工作(DONE)、待办任务(PENDING)和学习成果(LEARNED)。将这些内容写入,并将可持久化的学习成果同步到
.claude/handoff.md。MEMORY.md - 会话开始 — 加载交接文件、记忆内容和操作准则,然后呈现一份恢复摘要,确保会话开启时信息完整。
When
适用场景
- End of a working session — "done for today", "that's all", "signing off"
- Before switching projects or after a major milestone
- Implicit endings — "thanks" after completed tasks, "good enough for now": offer the handoff, don't just say goodbye
- Start of a session — "start session", "load handoff", "what were we working on"
- For a mid-session save without ending, use instead
/checkpoint
- 工作会话结束时 — "done for today"、"that's all"、"signing off"
- 切换项目前或完成重要里程碑后
- 隐性结束场景 — 完成任务后说"thanks"、"good enough for now":主动提供交接服务,而非直接道别
- 会话开始时 — "start session"、"load handoff"、"what were we working on"
- 如果需要在会话中途保存但不结束会话,请使用指令
/checkpoint
How
操作流程
Session End
会话结束
- Review the session — From git status/diff and the conversation: files touched, tasks completed vs unfinished, decisions made and why, user corrections observed.
- Check uncommitted changes — If any exist, offer to commit before wrapping.
- Write the handoff — , using the format below. Single file, always overwritten — only the current state matters. If the existing handoff has pending tasks from someone else, ask before overwriting: merge, overwrite, or skip.
.claude/handoff.md - Extract learnings — Corrections and discoveries worth keeping go to
(via
MEMORY.md); emerging patterns updateinstinct-system(via.claude/instincts.md). The handoff's Learned section is the trigger, not the destination — handoffs are ephemeral.instinct-system - Confirm — Summarize the handoff and learnings captured for the user.
- 回顾会话内容 — 从git状态/差异记录和对话中梳理:涉及的文件、已完成与未完成的任务、做出的决策及原因、观察到的用户修正意见。
- 检查未提交更改 — 如果存在未提交的更改,在收尾前询问用户是否需要提交。
- 写入交接文件 — 按照下方格式写入。 单个文件,始终覆盖 — 仅保留当前状态。如果现有交接文件包含他人的待办任务,覆盖前需询问用户:合并、覆盖还是跳过。
.claude/handoff.md - 提取学习成果 — 值得保留的修正意见和发现将同步到(通过
MEMORY.md);新出现的模式将更新instinct-system(通过.claude/instincts.md)。交接文件中的Learned部分是触发点,而非最终存储地 — 交接文件是临时的。instinct-system - 确认完成 — 向用户总结已记录的交接内容和学习成果。
Handoff File Format (.claude/handoff.md
)
.claude/handoff.md交接文件格式(.claude/handoff.md
)
.claude/handoff.mdWrite it for a stranger with zero context — file paths, rationale, specific
next steps. "Continue the refactor" is useless; "Refactor
to the Result pattern — see Catalog for the
established pattern" is actionable.
src/Orders/CreateOrder.csmarkdown
undefined文件需面向毫无上下文的陌生人撰写 — 包含文件路径、决策依据、具体下一步操作。"继续重构"毫无意义;"按照Catalog中已确立的模式重构为Result模式"才具备可操作性。
src/Orders/CreateOrder.csmarkdown
undefinedSession Handoff
Session Handoff
Generated: 2026-06-12 | Branch: feature/order-validation
Generated: 2026-06-12 | Branch: feature/order-validation
Completed
Completed
- Added FluentValidation to CreateOrder (src/Orders/Features/CreateOrder.cs:15-35)
- Fixed N+1 in GetOrderDetails (src/Orders/Features/GetOrderDetails.cs:28)
- Added FluentValidation to CreateOrder (src/Orders/Features/CreateOrder.cs:15-35)
- Fixed N+1 in GetOrderDetails (src/Orders/Features/GetOrderDetails.cs:28)
Pending
Pending
- Add validation to UpdateOrder (src/Orders/Features/UpdateOrder.cs)
- Reference: CreateOrder validator for the established pattern
- Full test run — 2 pre-existing Catalog failures, not from today
- Add validation to UpdateOrder (src/Orders/Features/UpdateOrder.cs)
- Reference: CreateOrder validator for the established pattern
- Full test run — 2 pre-existing Catalog failures, not from today
Learned
Learned
- FluentValidation validators must be registered in the module's DI setup
- Test fixture seeds 1 item per order, which hides N+1 queries
- FluentValidation validators must be registered in the module's DI setup
- Test fixture seeds 1 item per order, which hides N+1 queries
Context
Context
- Branch: feature/order-validation | Last commit: "Add CreateOrder validation"
- Uncommitted changes: no | Solution: src/MyApp.slnx
When multiple developers share the project, add a `## Decisions Made` table
(Decision | Choice | Rationale) and `## Open Questions`.- Branch: feature/order-validation | Last commit: "Add CreateOrder validation"
- Uncommitted changes: no | Solution: src/MyApp.slnx
当多个开发者共享项目时,需添加`## Decisions Made`表格(决策内容 | 选择方案 | 决策依据)和`## Open Questions`部分。Learning Extraction Checklist
学习成果提取检查清单
- Did the user correct anything? → MEMORY.md via
instinct-system - Did we discover something non-obvious? → Learned section
- Did we decide something with rationale? → document the "why"
- Did a tool/approach fail? → note it so the next session doesn't retry it
Good learning: "EF compiled queries don't work with Include()". Bad learning:
"Worked on Orders module" (vague) or "Used TimeProvider" (already a rule).
- 用户是否做出过修正? → 通过同步到MEMORY.md
instinct-system - 是否发现了非显而易见的内容? → 写入Learned部分
- 是否做出了带有决策依据的决定? → 记录决策的"原因"
- 是否有工具/方法失效? → 记录下来,避免下一次会话重复尝试
优秀的学习成果示例:"EF compiled queries don't work with Include()"。糟糕的示例:"处理了Orders模块"(过于模糊)或"使用了TimeProvider"(已属既定规则)。
Session Start
会话开始
- Load context — Read (pending work),
.claude/handoff.md(permanent rules),MEMORY.md(patterns at 0.7+ confidence). Missing files are fine: note it and start clean — never block on them..claude/instincts.md - Detect the solution — Find /
.slnx(current dir, then parents, then children) so Roslyn MCP tools work from the first prompt..sln - Present a resume summary — Last session's work, pending tasks, active rules/instincts count, detected solution. Then ask what to work on — never auto-start pending work.
- 加载上下文 — 读取(待办工作)、
.claude/handoff.md(永久规则)、MEMORY.md(置信度0.7以上的模式)。 若文件缺失也无需在意:记录该情况并从零开始 — 绝不要因文件缺失而阻塞会话。.claude/instincts.md - 检测解决方案文件 — 查找/
.slnx文件(当前目录,然后父目录,再子目录),确保Roslyn MCP工具从首次提示即可正常工作。.sln - 呈现恢复摘要 — 上一次会话的工作内容、待办任务、有效规则/操作准则数量、检测到的解决方案文件。然后询问用户接下来的工作内容 — 绝不要自动启动待办任务。
Example
示例
User: /wrap-up
Claude: Wrapping up session...User: /wrap-up
Claude: Wrapping up session...Session Summary
Session Summary
- Implemented OrderService with validation pipeline
- Fixed N+1 query in GetOrdersByCustomer
- Implemented OrderService with validation pipeline
- Fixed N+1 query in GetOrdersByCustomer
Pending
Pending
- Add retry logic to payment gateway calls (OrderService.cs:42)
- Add retry logic to payment gateway calls (OrderService.cs:42)
Learnings Captured
Learnings Captured
- User prefers explicit mapping over AutoMapper → MEMORY.md
Written to .claude/handoff.md. See you next session.
undefined- User prefers explicit mapping over AutoMapper → MEMORY.md
Written to .claude/handoff.md. See you next session.
undefinedRelated
相关功能
- — Mid-session save (commit + brief note) without ending the session
/checkpoint - — Routes session learnings: patterns become instincts, user corrections become permanent MEMORY.md rules
instinct-system
- — 会话中途保存(提交代码+简短记录)但不结束会话
/checkpoint - — 会话学习成果路由:模式转化为操作准则,用户修正意见成为MEMORY.md中的永久规则
instinct-system