continuity-ledger
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContinuity Ledger
连续性台账
Note: This skill is now an alias for. Both output the same YAML format./create_handoff
Create a YAML handoff document for state preservation across . This is the same as .
/clear/create_handoff注意: 此技能现在是的别名,二者输出相同的YAML格式。/create_handoff
创建YAML交接文档,用于在执行操作时保留状态。这与功能完全一致。
/clear/create_handoffProcess
流程
1. Filepath & Metadata
1. 文件路径与元数据
First, determine the session name from existing handoffs:
bash
ls -td thoughts/shared/handoffs/*/ 2>/dev/null | head -1 | xargs basenameThis returns the most recently modified handoff folder name (e.g., ). Use this as the handoff folder name.
open-source-releaseIf no handoffs exist, use as the folder name.
generalCreate your file under: , where:
thoughts/shared/handoffs/{session-name}/YYYY-MM-DD_HH-MM_description.yaml- is from existing handoffs (e.g.,
{session-name}) oropen-source-releaseif none existgeneral - is today's date
YYYY-MM-DD - is the current time in 24-hour format (no seconds needed)
HH-MM - is a brief kebab-case description
description
Examples:
thoughts/shared/handoffs/open-source-release/2026-01-08_16-30_memory-system-fix.yamlthoughts/shared/handoffs/general/2026-01-08_16-30_bug-investigation.yaml
首先,从现有交接文档中确定会话名称:
bash
ls -td thoughts/shared/handoffs/*/ 2>/dev/null | head -1 | xargs basename该命令会返回最近修改的交接文件夹名称(例如:),将其用作本次的交接文件夹名称。
open-source-release如果不存在任何交接文档,则使用作为文件夹名称。
general在以下路径创建文件: ,其中:
thoughts/shared/handoffs/{session-name}/YYYY-MM-DD_HH-MM_description.yaml- 来自现有交接文档(例如:
{session-name}),若无则使用open-source-releasegeneral - 为当前日期
YYYY-MM-DD - 为当前24小时制时间(无需秒数)
HH-MM - 为简短的烤肉串式(kebab-case)描述
description
示例:
thoughts/shared/handoffs/open-source-release/2026-01-08_16-30_memory-system-fix.yamlthoughts/shared/handoffs/general/2026-01-08_16-30_bug-investigation.yaml
2. Write YAML handoff (~400 tokens)
2. 编写YAML交接文档(约400词)
CRITICAL: Use EXACTLY this YAML format. Do NOT deviate or use alternative field names.
The and fields are shown in the statusline - they MUST be named exactly this.
goal:now:yaml
---
session: {session-name from ledger}
date: YYYY-MM-DD
status: complete|partial|blocked
outcome: SUCCEEDED|PARTIAL_PLUS|PARTIAL_MINUS|FAILED
---
goal: {What this session accomplished - shown in statusline}
now: {What next session should do first - shown in statusline}
test: {Command to verify this work, e.g., pytest tests/test_foo.py}
done_this_session:
- task: {First completed task}
files: [{file1.py}, {file2.py}]
- task: {Second completed task}
files: [{file3.py}]
blockers: [{any blocking issues}]
questions: [{unresolved questions for next session}]
decisions:
- {decision_name}: {rationale}
findings:
- {key_finding}: {details}
worked: [{approaches that worked}]
failed: [{approaches that failed and why}]
next:
- {First next step}
- {Second next step}
files:
created: [{new files}]
modified: [{changed files}]Field guide:
- +
goal:- REQUIRED, shown in statuslinenow: - - What was accomplished with file references
done_this_session: - - Important choices and rationale
decisions: - - Key learnings
findings: - /
worked:- What to repeat vs avoidfailed: - - Action items for next session
next:
DO NOT use alternative field names like , , , , etc.
The statusline parser looks for EXACTLY and - nothing else works.
session_goalobjectivefocuscurrentgoal:now:关键要求:必须严格使用此YAML格式,不得使用其他字段名。
goal:now:yaml
---
session: {来自台账的会话名称}
date: YYYY-MM-DD
status: complete|partial|blocked
outcome: SUCCEEDED|PARTIAL_PLUS|PARTIAL_MINUS|FAILED
---
goal: {本次会话完成的内容——会显示在状态栏}
now: {下一次会话应首先执行的操作——会显示在状态栏}
test: {验证本次工作的命令,例如:pytest tests/test_foo.py}
done_this_session:
- task: {完成的第一项任务}
files: [{file1.py}, {file2.py}]
- task: {完成的第二项任务}
files: [{file3.py}]
blockers: [{任何阻塞问题}]
questions: [{留给下一次会话的未解决问题}]
decisions:
- {决策名称}: {理由}
findings:
- {关键发现}: {详细内容}
worked: [{有效的方法}]
failed: [{失败的方法及原因}]
next:
- {第一项后续步骤}
- {第二项后续步骤}
files:
created: [{新建文件}]
modified: [{修改的文件}]字段说明:
- +
goal:- 必填,会显示在状态栏中now: - - 已完成的工作及涉及的文件
done_this_session: - - 重要的决策及其理由
decisions: - - 关键收获
findings: - /
worked:- 值得重复的方法 vs 需要避免的方法failed: - - 下一次会话的行动项
next:
请勿使用、、、等替代字段名。
状态栏解析器仅会识别完全匹配的和——其他名称均无效。
session_goalobjectivefocuscurrentgoal:now:3. Mark Session Outcome (REQUIRED)
3. 标记会话结果(必填)
IMPORTANT: Before responding to the user, you MUST ask about the session outcome.
Use the AskUserQuestion tool with these exact options:
Question: "How did this session go?"
Options:
- SUCCEEDED: Task completed successfully
- PARTIAL_PLUS: Mostly done, minor issues remain
- PARTIAL_MINUS: Some progress, major issues remain
- FAILED: Task abandoned or blockedAfter the user responds, mark the outcome:
bash
undefined重要提示: 在回复用户之前,必须询问会话结果。
使用AskUserQuestion工具,并提供以下确切选项:
问题:"本次会话进展如何?"
选项:
- SUCCEEDED: 任务成功完成
- PARTIAL_PLUS: 基本完成,仅存在少量问题
- PARTIAL_MINUS: 取得部分进展,但存在重大问题
- FAILED: 任务已放弃或被阻塞用户回复后,标记结果:
bash
undefinedMark the most recent handoff (works with PostgreSQL or SQLite)
标记最新的交接文档(支持PostgreSQL或SQLite)
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "${CLAUDE_PROJECT_DIR:-.}")
cd "$PROJECT_ROOT/opc" && uv run python scripts/core/artifact_mark.py --latest --outcome <USER_CHOICE>
undefinedPROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "${CLAUDE_PROJECT_DIR:-.}")
cd "$PROJECT_ROOT/opc" && uv run python scripts/core/artifact_mark.py --latest --outcome <USER_CHOICE>
undefined4. Confirm completion
4. 确认完成
After marking the outcome, respond to the user:
Handoff created! Outcome marked as [OUTCOME].
Resume in a new session with:
/resume_handoff path/to/handoff.yaml标记结果后,回复用户:
交接文档已创建!结果标记为[OUTCOME]。
可使用以下命令在新会话中恢复:
/resume_handoff path/to/handoff.yamlWhen to Use
使用场景
- Before running
/clear - Context usage approaching 70%+
- Multi-day implementations
- Complex refactors you pick up/put down
- Any session expected to hit 85%+ context
- 在执行操作之前
/clear - 上下文使用率接近70%及以上时
- 跨多天的实现工作
- 需要中断后继续的复杂重构
- 任何预计上下文使用率会达到85%及以上的会话
When NOT to Use
不适用场景
- Quick tasks (< 30 min)
- Simple bug fixes
- Single-file changes
- 快速任务(少于30分钟)
- 简单bug修复
- 单文件修改
Why Clear Instead of Compact?
为何选择Clear而非Compact?
Each compaction is lossy compression—after several compactions, you're working with degraded context. Clearing + loading the handoff gives you fresh context with full signal.
每次压缩(compaction)都是有损压缩——经过多次压缩后,你将使用质量下降的上下文。清除上下文并加载交接文档可为你提供信号完整的全新上下文。