continuity-ledger

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Continuity Ledger

连续性台账

Note: This skill is now an alias for
/create_handoff
. Both output the same YAML format.
Create a YAML handoff document for state preservation across
/clear
. This is the same as
/create_handoff
.
注意: 此技能现在是
/create_handoff
的别名,二者输出相同的YAML格式。
创建YAML交接文档,用于在执行
/clear
操作时保留状态。这与
/create_handoff
功能完全一致。

Process

流程

1. Filepath & Metadata

1. 文件路径与元数据

First, determine the session name from existing handoffs:
bash
ls -td thoughts/shared/handoffs/*/ 2>/dev/null | head -1 | xargs basename
This returns the most recently modified handoff folder name (e.g.,
open-source-release
). Use this as the handoff folder name.
If no handoffs exist, use
general
as the folder name.
Create your file under:
thoughts/shared/handoffs/{session-name}/YYYY-MM-DD_HH-MM_description.yaml
, where:
  • {session-name}
    is from existing handoffs (e.g.,
    open-source-release
    ) or
    general
    if none exist
  • YYYY-MM-DD
    is today's date
  • HH-MM
    is the current time in 24-hour format (no seconds needed)
  • description
    is a brief kebab-case description
Examples:
  • thoughts/shared/handoffs/open-source-release/2026-01-08_16-30_memory-system-fix.yaml
  • thoughts/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-release
    ),若无则使用
    general
  • YYYY-MM-DD
    为当前日期
  • HH-MM
    为当前24小时制时间(无需秒数)
  • description
    为简短的烤肉串式(kebab-case)描述
示例:
  • thoughts/shared/handoffs/open-source-release/2026-01-08_16-30_memory-system-fix.yaml
  • thoughts/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
goal:
and
now:
fields are shown in the statusline - they MUST be named exactly this.
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:
    +
    now:
    - REQUIRED, shown in statusline
  • done_this_session:
    - What was accomplished with file references
  • decisions:
    - Important choices and rationale
  • findings:
    - Key learnings
  • worked:
    /
    failed:
    - What to repeat vs avoid
  • next:
    - Action items for next session
DO NOT use alternative field names like
session_goal
,
objective
,
focus
,
current
, etc.
The statusline parser looks for EXACTLY
goal:
and
now:
- nothing else works.
关键要求:必须严格使用此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:
    /
    failed:
    - 值得重复的方法 vs 需要避免的方法
  • next:
    - 下一次会话的行动项
请勿使用
session_goal
objective
focus
current
等替代字段名。
状态栏解析器仅会识别完全匹配的
goal:
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 blocked
After the user responds, mark the outcome:
bash
undefined
重要提示: 在回复用户之前,必须询问会话结果。
使用AskUserQuestion工具,并提供以下确切选项:
问题:"本次会话进展如何?"
选项:
  - SUCCEEDED: 任务成功完成
  - PARTIAL_PLUS: 基本完成,仅存在少量问题
  - PARTIAL_MINUS: 取得部分进展,但存在重大问题
  - FAILED: 任务已放弃或被阻塞
用户回复后,标记结果:
bash
undefined

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

4. 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.yaml

When 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)都是有损压缩——经过多次压缩后,你将使用质量下降的上下文。清除上下文并加载交接文档可为你提供信号完整的全新上下文。