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
    .claude/handoff.md
    and flow durable learnings into
    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
    /checkpoint
    instead
  • 工作会话结束时 — "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

会话结束

  1. Review the session — From git status/diff and the conversation: files touched, tasks completed vs unfinished, decisions made and why, user corrections observed.
  2. Check uncommitted changes — If any exist, offer to commit before wrapping.
  3. Write the handoff
    .claude/handoff.md
    , 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.
  4. Extract learnings — Corrections and discoveries worth keeping go to
    MEMORY.md
    (via
    instinct-system
    ); emerging patterns update
    .claude/instincts.md
    (via
    instinct-system
    ). The handoff's Learned section is the trigger, not the destination — handoffs are ephemeral.
  5. Confirm — Summarize the handoff and learnings captured for the user.
  1. 回顾会话内容 — 从git状态/差异记录和对话中梳理:涉及的文件、已完成与未完成的任务、做出的决策及原因、观察到的用户修正意见。
  2. 检查未提交更改 — 如果存在未提交的更改,在收尾前询问用户是否需要提交。
  3. 写入交接文件 — 按照下方格式写入
    .claude/handoff.md
    。 单个文件,始终覆盖 — 仅保留当前状态。如果现有交接文件包含他人的待办任务,覆盖前需询问用户:合并、覆盖还是跳过。
  4. 提取学习成果 — 值得保留的修正意见和发现将同步到
    MEMORY.md
    (通过
    instinct-system
    );新出现的模式将更新
    .claude/instincts.md
    (通过
    instinct-system
    )。交接文件中的Learned部分是触发点,而非最终存储地 — 交接文件是临时的。
  5. 确认完成 — 向用户总结已记录的交接内容和学习成果。

Handoff File Format (
.claude/handoff.md
)

交接文件格式(
.claude/handoff.md

Write it for a stranger with zero context — file paths, rationale, specific next steps. "Continue the refactor" is useless; "Refactor
src/Orders/CreateOrder.cs
to the Result pattern — see Catalog for the established pattern" is actionable.
markdown
undefined
文件需面向毫无上下文的陌生人撰写 — 包含文件路径、决策依据、具体下一步操作。"继续重构"毫无意义;"按照Catalog中已确立的模式重构
src/Orders/CreateOrder.cs
为Result模式"才具备可操作性。
markdown
undefined

Session 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

学习成果提取检查清单

  1. Did the user correct anything? → MEMORY.md via
    instinct-system
  2. Did we discover something non-obvious? → Learned section
  3. Did we decide something with rationale? → document the "why"
  4. 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).
  1. 用户是否做出过修正? → 通过
    instinct-system
    同步到MEMORY.md
  2. 是否发现了非显而易见的内容? → 写入Learned部分
  3. 是否做出了带有决策依据的决定? → 记录决策的"原因"
  4. 是否有工具/方法失效? → 记录下来,避免下一次会话重复尝试
优秀的学习成果示例:"EF compiled queries don't work with Include()"。糟糕的示例:"处理了Orders模块"(过于模糊)或"使用了TimeProvider"(已属既定规则)。

Session Start

会话开始

  1. Load context — Read
    .claude/handoff.md
    (pending work),
    MEMORY.md
    (permanent rules),
    .claude/instincts.md
    (patterns at 0.7+ confidence). Missing files are fine: note it and start clean — never block on them.
  2. Detect the solution — Find
    .slnx
    /
    .sln
    (current dir, then parents, then children) so Roslyn MCP tools work from the first prompt.
  3. 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.
  1. 加载上下文 — 读取
    .claude/handoff.md
    (待办工作)、
    MEMORY.md
    (永久规则)、
    .claude/instincts.md
    (置信度0.7以上的模式)。 若文件缺失也无需在意:记录该情况并从零开始 — 绝不要因文件缺失而阻塞会话。
  2. 检测解决方案文件 — 查找
    .slnx
    /
    .sln
    文件(当前目录,然后父目录,再子目录),确保Roslyn MCP工具从首次提示即可正常工作。
  3. 呈现恢复摘要 — 上一次会话的工作内容、待办任务、有效规则/操作准则数量、检测到的解决方案文件。然后询问用户接下来的工作内容 — 绝不要自动启动待办任务。

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.
undefined

Related

相关功能

  • /checkpoint
    — Mid-session save (commit + brief note) without ending the session
  • instinct-system
    — Routes session learnings: patterns become instincts, user corrections become permanent MEMORY.md rules
  • /checkpoint
    — 会话中途保存(提交代码+简短记录)但不结束会话
  • instinct-system
    — 会话学习成果路由:模式转化为操作准则,用户修正意见成为MEMORY.md中的永久规则