$npx -y skills add parcadei/Continuous-Claude-v3 --skill continuity_ledgerCreate or update continuity ledger for state preservation across clears
| 1 | # Continuity Ledger |
| 2 | |
| 3 | > **Note:** This skill is now an alias for `/create_handoff`. Both output the same YAML format. |
| 4 | |
| 5 | Create a YAML handoff document for state preservation across `/clear`. This is the same as `/create_handoff`. |
| 6 | |
| 7 | ## Process |
| 8 | |
| 9 | ### 1. Filepath & Metadata |
| 10 | |
| 11 | **First, determine the session name from existing handoffs:** |
| 12 | ```bash |
| 13 | ls -td thoughts/shared/handoffs/*/ 2>/dev/null | head -1 | xargs basename |
| 14 | ``` |
| 15 | |
| 16 | This returns the most recently modified handoff folder name (e.g., `open-source-release`). Use this as the handoff folder name. |
| 17 | |
| 18 | If no handoffs exist, use `general` as the folder name. |
| 19 | |
| 20 | **Create your file under:** `thoughts/shared/handoffs/{session-name}/YYYY-MM-DD_HH-MM_description.yaml`, where: |
| 21 | - `{session-name}` is from existing handoffs (e.g., `open-source-release`) or `general` if none exist |
| 22 | - `YYYY-MM-DD` is today's date |
| 23 | - `HH-MM` is the current time in 24-hour format (no seconds needed) |
| 24 | - `description` is a brief kebab-case description |
| 25 | |
| 26 | **Examples:** |
| 27 | - `thoughts/shared/handoffs/open-source-release/2026-01-08_16-30_memory-system-fix.yaml` |
| 28 | - `thoughts/shared/handoffs/general/2026-01-08_16-30_bug-investigation.yaml` |
| 29 | |
| 30 | ### 2. Write YAML handoff (~400 tokens) |
| 31 | |
| 32 | **CRITICAL: Use EXACTLY this YAML format. Do NOT deviate or use alternative field names.** |
| 33 | |
| 34 | The `goal:` and `now:` fields are shown in the statusline - they MUST be named exactly this. |
| 35 | |
| 36 | ```yaml |
| 37 | --- |
| 38 | session: {session-name from ledger} |
| 39 | date: YYYY-MM-DD |
| 40 | status: complete|partial|blocked |
| 41 | outcome: SUCCEEDED|PARTIAL_PLUS|PARTIAL_MINUS|FAILED |
| 42 | --- |
| 43 | |
| 44 | goal: {What this session accomplished - shown in statusline} |
| 45 | now: {What next session should do first - shown in statusline} |
| 46 | test: {Command to verify this work, e.g., pytest tests/test_foo.py} |
| 47 | |
| 48 | done_this_session: |
| 49 | - task: {First completed task} |
| 50 | files: [{file1.py}, {file2.py}] |
| 51 | - task: {Second completed task} |
| 52 | files: [{file3.py}] |
| 53 | |
| 54 | blockers: [{any blocking issues}] |
| 55 | |
| 56 | questions: [{unresolved questions for next session}] |
| 57 | |
| 58 | decisions: |
| 59 | - {decision_name}: {rationale} |
| 60 | |
| 61 | findings: |
| 62 | - {key_finding}: {details} |
| 63 | |
| 64 | worked: [{approaches that worked}] |
| 65 | failed: [{approaches that failed and why}] |
| 66 | |
| 67 | next: |
| 68 | - {First next step} |
| 69 | - {Second next step} |
| 70 | |
| 71 | files: |
| 72 | created: [{new files}] |
| 73 | modified: [{changed files}] |
| 74 | ``` |
| 75 | |
| 76 | **Field guide:** |
| 77 | - `goal:` + `now:` - REQUIRED, shown in statusline |
| 78 | - `done_this_session:` - What was accomplished with file references |
| 79 | - `decisions:` - Important choices and rationale |
| 80 | - `findings:` - Key learnings |
| 81 | - `worked:` / `failed:` - What to repeat vs avoid |
| 82 | - `next:` - Action items for next session |
| 83 | |
| 84 | **DO NOT use alternative field names like `session_goal`, `objective`, `focus`, `current`, etc.** |
| 85 | **The statusline parser looks for EXACTLY `goal:` and `now:` - nothing else works.** |
| 86 | |
| 87 | ### 3. Mark Session Outcome (REQUIRED) |
| 88 | |
| 89 | **IMPORTANT:** Before responding to the user, you MUST ask about the session outcome. |
| 90 | |
| 91 | Use the AskUserQuestion tool with these exact options: |
| 92 | |
| 93 | ``` |
| 94 | Question: "How did this session go?" |
| 95 | Options: |
| 96 | - SUCCEEDED: Task completed successfully |
| 97 | - PARTIAL_PLUS: Mostly done, minor issues remain |
| 98 | - PARTIAL_MINUS: Some progress, major issues remain |
| 99 | - FAILED: Task abandoned or blocked |
| 100 | ``` |
| 101 | |
| 102 | After the user responds, mark the outcome: |
| 103 | ```bash |
| 104 | # Mark the most recent handoff (works with PostgreSQL or SQLite) |
| 105 | PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "${CLAUDE_PROJECT_DIR:-.}") |
| 106 | cd "$PROJECT_ROOT/opc" && uv run python scripts/core/artifact_mark.py --latest --outcome <USER_CHOICE> |
| 107 | ``` |
| 108 | |
| 109 | ### 4. Confirm completion |
| 110 | |
| 111 | After marking the outcome, respond to the user: |
| 112 | |
| 113 | ``` |
| 114 | Handoff created! Outcome marked as [OUTCOME]. |
| 115 | |
| 116 | Resume in a new session with: |
| 117 | /resume_handoff path/to/handoff.yaml |
| 118 | ``` |
| 119 | |
| 120 | ## When to Use |
| 121 | |
| 122 | - Before running `/clear` |
| 123 | - Context usage approaching 70%+ |
| 124 | - Multi-day implementations |
| 125 | - Complex refactors you pick up/put down |
| 126 | - Any session expected to hit 85%+ context |
| 127 | |
| 128 | ## When NOT to Use |
| 129 | |
| 130 | - Quick tasks (< 30 min) |
| 131 | - Simple bug fixes |
| 132 | - Single-file changes |
| 133 | |
| 134 | ## Why Clear Instead of Compact? |
| 135 | |
| 136 | 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. |