‹ 首页

continuity-ledger

@parcadei · 收录于 1 周前 · 上游提交 5 个月前

Create or update continuity ledger for state preservation across clears

适合你,如果需要在清除操作后保留系统状态。

/ 下载安装
continuity-ledger.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add parcadei/continuous-claude-v3/continuity-ledger
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- parcadei/continuous-claude-v3/continuity-ledger
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify parcadei/continuous-claude-v3/continuity-ledger
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
3859GitHub stars
~900上下文体积 · 单文件
镜像托管

怎么用

商店整理自技能原文 · 版本 d07ff4b · 表述以原文为准
它做什么

安装后,Claude 会在每次对话结束前询问会话结果,然后创建一个 YAML 格式的“交接文档”,记录本次会话的目标、完成的任务、决策、发现和下一步计划。下次新对话时,你可以用 /resume_handoff 命令加载这个文档,恢复之前的状态。

什么时候触发

当你准备执行 /clear 命令、上下文使用量接近 70% 或进行多天、复杂的任务时触发。

装好后可以这样说
Claude 会询问会话结果并生成 handoff 文件。
Claude 会按指定名称创建 handoff 文件。
技能原文 SKILL.md作者撰写 · MIT · d07ff4b

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.

Process
1. Filepath & Metadata

First, determine the session name from existing handoffs:

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
2. Write YAML handoff (~400 tokens)

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.

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

3. Mark Session Outcome (REQUIRED)

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:

# Mark the most recent handoff (works with PostgreSQL or 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>
4. Confirm completion

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
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
When NOT to Use
  • Quick tasks (< 30 min)
  • Simple bug fixes
  • Single-file changes
Why Clear Instead of 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.

按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。