bye

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Session Wrap-up

会话收尾

CRITICAL: Restore Full Session History First

重要提示:先恢复完整会话历史

Nothing proceeds until full history is reconstructed. Context compaction hides earlier work — you must recover it or the sessionlog will be incomplete.
  1. Use a subagent to analyze the session file (see subagent-tasks.md)
  2. Follow the tool-specific restoration guide:
    • Claude Code: claude-code-session-restoration.md
    • Cursor: cursor-session-restoration.md
  3. Combine restored history with current context before continuing
If restoration finds no prior work beyond current context, proceed — but log that restoration was attempted.
Parallel session safety: The user may have multiple sessions running. Filter by
$CLAUDE_SESSION_ID
and timestamp correlation. Never combine work from other sessions. If uncertain, ASK.
在完整历史重建完成前,不得进行任何后续操作。 上下文压缩会隐藏早期工作内容——你必须恢复这些内容,否则会话日志会不完整。
  1. 使用子代理(subagent)分析会话文件(参见 subagent-tasks.md
  2. 遵循对应工具的恢复指南:
    • Claude Code: claude-code-session-restoration.md
    • Cursor: cursor-session-restoration.md
  3. 在继续后续步骤前,将恢复的历史与当前上下文合并
如果恢复操作发现除当前上下文外无其他早期工作内容,可继续流程,但需记录已尝试进行恢复操作。
并行会话安全提示: 用户可能同时运行多个会话。请通过
$CLAUDE_SESSION_ID
和时间戳关联进行筛选。绝不能合并其他会话的工作内容。如有疑问,请询问用户。

Session Type Detection

会话类型检测

After restoring history, classify the session:
SignalTypeAction
"isSidechain": true
or in
subagents/
dir
SubagentSTOP — do not run /bye
messageCount <= 2
, first msg contains
"Context: This summary"
Metadata sessionSKIP — not a real work session
First messages reference executing a plan; recent file in
~/.claude/plans/
Plan executionRead plan file; sessionlog documents execution vs plan
System message contains
"Plan mode is active"
Plan creationPlan file is the deliverable
None of aboveNormalContinue with checklist
恢复历史后,对会话进行分类:
信号类型操作
"isSidechain": true
或位于
subagents/
目录下
子代理会话终止 — 不执行/bye指令
messageCount <= 2
,第一条消息包含
"Context: This summary"
元数据会话跳过 — 非实际工作会话
初始消息提及执行计划;
~/.claude/plans/
目录下存在最新文件
计划执行会话读取计划文件;会话日志需记录实际执行与计划的对比情况
系统消息包含
"Plan mode is active"
计划创建会话计划文件为交付成果
不符合以上任何情况常规会话继续执行检查清单

Session Wrap-up Checklist

会话收尾检查清单

  1. Determine scope — everything between last /bye (or session start) and now. Verify each item was discussed in THIS conversation.
  2. Assess work — files created, files modified, decisions made, research done, tasks completed, tasks remaining.
  3. Trivial session? If just Q&A with no file changes, ask: "Skip sessionlog?"
  4. Create or update sessionlog — see sessionlog-template.md for format, naming, and create-vs-update logic.
  5. Update project status — if work relates to
    projects/*/
    , update its
    status.md
    .
  6. Handle git — see git decision table below.
  7. Print final summary — see template below.
  1. 确定范围 — 涵盖上次执行/bye指令(或会话开始)至当前的所有内容。验证每一项内容均在本次对话中讨论过。
  2. 评估工作内容 — 已创建的文件、已修改的文件、已做出的决策、已完成的研究、已结束的任务、剩余的任务。
  3. 是否为小型会话? 如果仅为问答且未修改任何文件,询问用户:"是否跳过会话日志生成?"
  4. 创建或更新会话日志 — 格式、命名规则及创建/更新逻辑请参见 sessionlog-template.md
  5. 更新项目状态 — 如果工作内容与
    projects/*/
    相关,更新其
    status.md
    文件。
  6. 处理Git操作 — 请参考下方的Git决策表。
  7. 打印最终总结 — 请使用下方的模板。

Git Decision Table

Git决策表

SituationAction
Files I created/edited THIS sessionAuto-commit
Untracked files from beforeASK
Modified files I didn't touchASK — likely parallel session
.env, credentials, secretsNEVER, warn user
Commit message:
[Brief description]\n\nSession wrap-up: YYYY-MM-DD
Push if remote tracking exists.
场景操作
本次会话中我创建/编辑的文件自动提交
之前存在的未追踪文件询问用户
我未修改过的已修改文件询问用户 — 可能来自并行会话
.env、凭证、密钥文件绝不提交,并向用户发出警告
提交信息:
[简要描述]\n\n会话收尾:YYYY-MM-DD
若存在远程追踪分支则进行推送。

Final Summary Template

最终总结模板

undefined
undefined

Session Complete

会话完成

Accomplished:
  • [item 1]
  • [item 2]
Committed: [hash]
  • [file list]
Pending:
  • [task 1]
Sessionlog:
sessionlogs/[file].md
Ready to clear context.
undefined
已完成内容:
  • [项1]
  • [项2]
已提交: [哈希值]
  • [文件列表]
待办事项:
  • [任务1]
会话日志:
sessionlogs/[file].md
已准备好清除上下文。
undefined