done
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDone
会话收尾
Distill the current session into a single markdown file capturing decisions, questions, next steps, and context for future sessions.
Manual, end-of-session action. Not every session needs it — skip when the session was trivial or exploratory with no decisions worth preserving.
将当前会话的内容提炼为单个Markdown文件,记录决策、问题、后续步骤以及供未来会话参考的上下文。
手动执行的会话结束操作。并非所有会话都需要执行此操作——如果会话内容琐碎或仅为探索性工作、没有值得留存的决策,可以跳过。
Workflow
工作流程
Copy this checklist to track progress:
Done progress:
- [ ] Step 1: Gather context
- [ ] Step 2: Assess significance
- [ ] Step 3: Write session file
- [ ] Step 4: Confirm复制以下检查清单来跟踪进度:
Done progress:
- [ ] Step 1: Gather context
- [ ] Step 2: Assess significance
- [ ] Step 3: Write session file
- [ ] Step 4: ConfirmStep 1: Gather context
步骤1:收集上下文
Collect automatically — do not ask the user:
Git context:
- Current branch:
git branch --show-current - Files changed: and
git diff --name-onlygit diff --cached --name-only - Recent commits:
git log --oneline -10
Session context:
- Claude session ID
- Key decisions made and their reasoning
- Questions raised (answered and unanswered)
- Blockers encountered
- Patterns or learnings discovered
If not in a git repo, use as branch and skip files-changed.
no-repo自动收集信息——无需询问用户:
Git上下文:
- 当前分支:
git branch --show-current - 变更文件:和
git diff --name-onlygit diff --cached --name-only - 最近提交:
git log --oneline -10
会话上下文:
- Claude会话ID
- 做出的关键决策及其原因
- 提出的问题(已解决和未解决)
- 遇到的障碍
- 发现的模式或学习心得
如果不在Git仓库中,使用作为分支名,跳过文件变更部分。
no-repoStep 2: Assess significance
步骤2:评估重要性
- Write a file when: decisions were made, architecture was discussed, non-obvious approaches were chosen, there are open questions, or meaningful code was written.
- Skip when: quick fix with no decisions, pure exploration with no conclusions, or the user says it is not needed.
If skipping, tell the user why and stop.
- 生成文件的场景:做出了决策、讨论了架构、选择了非显而易见的方案、存在未解决的问题,或者编写了有意义的代码。
- 跳过的场景:仅为快速修复且无决策、纯探索性工作无结论,或者用户表示不需要。
如果跳过,需告知用户原因并终止操作。
Step 3: Write session file
步骤3:编写会话文件
Location:
Default: in the repo root.
.claude/done/If the folder does not exist, create it:
bash
mkdir -p .claude/doneThe user can override this path in their CLAUDE.md or CLAUDE.local.md:
markdown
Session files go in /path/to/my/folderIf the custom path does not exist, create it with before writing.
mkdir -pCommon alternatives: an Obsidian vault folder, , or any custom path.
docs/sessions/Filename:
YYYY-MM-DD-<branch>-<short-session-id>.md- Branch: replaced with
/, truncated at 40 chars- - Session ID: first 8 chars
- Example:
2026-02-19-feat-auth-a1b2c3d4.md
Template:
markdown
undefined存储位置:
默认路径:仓库根目录下的。
.claude/done/如果该文件夹不存在,创建它:
bash
mkdir -p .claude/done用户可以在CLAUDE.md或CLAUDE.local.md中自定义此路径:
markdown
Session files go in /path/to/my/folder如果自定义路径不存在,在写入前使用创建。
mkdir -p常见替代路径:Obsidian库文件夹、或任何自定义路径。
docs/sessions/文件名格式:
YYYY-MM-DD-<branch>-<short-session-id>.md- 分支名:将替换为
/,截断为40字符以内- - 会话ID:取前8位字符
- 示例:
2026-02-19-feat-auth-a1b2c3d4.md
模板:
markdown
undefinedSession: YYYY-MM-DD <branch>
Session: YYYY-MM-DD <branch>
Session ID: <id>
Branch: <branch>
Date: <date>
Session ID: <id>
Branch: <branch>
Date: <date>
Summary
Summary
1-2 sentences of what was accomplished.
1-2 sentences of what was accomplished.
Decisions
Decisions
- Decision title: What was decided. Why this approach was chosen.
- Decision title: What was decided. Why this approach was chosen.
Questions
Questions
- Open question
- Resolved question — answer
- Open question
- Resolved question — answer
Next Steps
Next Steps
- Specific actionable task
- Specific actionable task
Files Changed
Files Changed
- — what changed and why
path/to/file
- — what changed and why
path/to/file
Learnings
Learnings
- Non-obvious gotcha or pattern discovered
- Non-obvious gotcha or pattern discovered
Context for Next Session
Context for Next Session
Where to pick up. What state is the code in. What needs attention first.
**Writing rules:**
- Omit any section with no content
- Bullets, not paragraphs
- Decisions must include the "why"
- Next steps must be actionable without re-reading the session
- If 20+ files changed, summarize by directory
- Never overwrite existing session filesWhere to pick up. What state is the code in. What needs attention first.
**编写规则:**
- 省略无内容的章节
- 使用项目符号,而非段落
- 决策部分必须包含“选择此方案的原因”
- 后续步骤必须无需重新阅读会话记录即可执行
- 如果变更文件超过20个,按目录汇总
- 切勿覆盖已有的会话文件Step 4: Confirm
步骤4:确认
Report the file path and a one-line summary:
Session captured: .claude/done/2026-02-19-feat-auth-a1b2c3d4.md
Sections: decisions (3), questions (1 open), next steps (4), files changed (7)报告文件路径和一行摘要:
Session captured: .claude/done/2026-02-19-feat-auth-a1b2c3d4.md
Sections: decisions (3), questions (1 open), next steps (4), files changed (7)Anti-patterns
反模式
- Do not create a file for trivial sessions (quick typo fix, one-liner)
- Do not include full code snippets — reference file paths and line numbers instead
- Do not ask the user to fill in sections — extract everything from session context
- Do not overwrite existing session files — each session gets a unique file
- Do not create rolling/append files (like PROJECT-STATUS.md) — one file per session
- Do not modify any project files other than the session file itself
- 不要为琐碎会话生成文件(比如快速修复拼写错误、单行代码修改)
- 不要包含完整代码片段——改用文件路径和行号引用
- 不要要求用户填写章节内容——所有信息从会话上下文提取
- 不要覆盖已有的会话文件——每个会话对应唯一文件
- 不要生成滚动/追加式文件(如PROJECT-STATUS.md)——每个会话一个单独文件
- 不要修改会话文件以外的任何项目文件