| name | continuity-ledger |
| model | sonnet |
| description | Maintains a running decision log and context state across agent sessions, preventing context loss between clears and session boundaries. Use when: 'starting a new session on an ongoing project', 'context is getting heavy', 'preserve state before clearing', 'create a handoff document', 'pick up where I left off'. |
| category | wisdom-garden |
| triggers | ["starting a new session on an ongoing project","context is getting heavy","preserve state before clearing","create a handoff document","pick up where I left off"] |
| tier | 1 |
| agents | ["primary"] |
| tool_dependencies | ["file_system"] |
| inputs | [{"name":"session_context","type":"string","description":"Description of the current session's work, decisions made, and state to preserve","required":true},{"name":"prior_ledger","type":"ref","format":"cas-ref","description":"Reference to a previous ledger entry to build upon (for multi-session chains)","required":false}] |
| outputs | [{"name":"ledger","type":"ref","format":"cas-ref","description":"YAML handoff document capturing session state, decisions, findings, and next steps"}] |
Continuity Ledger
Purpose: Create structured YAML handoff documents that preserve session state -- decisions made, files modified, findings discovered, approaches tried, and concrete next steps -- so that a fresh session can resume work without context loss. Each clear/restart gets a clean context with full signal instead of degraded compacted context.
I. When to Use
- Before running
/clear when context usage is approaching 70%+
- At the end of a multi-day implementation session
- During complex refactors you expect to pick up and put down
- Any session expected to hit 85%+ context utilization
- When switching between projects and need to freeze state for later
When NOT to Use
- Quick tasks under 30 minutes
- Simple single-file bug fixes
- Sessions that will complete without approaching context limits
II. Why Clear + Ledger Instead of Compact
Each compaction is lossy compression. After several compactions, you are working with degraded context -- key decisions and file paths silently disappear. Clearing and loading the ledger gives a fresh context with full signal from the structured handoff document.
III. Workflow
Step 1: Determine Ledger Location
Check for existing handoff folders to maintain session continuity:
ls -td thoughts/shared/handoffs/*/ 2>/dev/null | head -1 | xargs basename
- If a handoff folder exists, use that session name
- If none exist, use
general as the folder name
- File path:
thoughts/shared/handoffs/{session-name}/YYYY-MM-DD_HH-MM_description.yaml
Step 2: Capture Session State
Gather the following from the current session:
- Goal -- what this session set out to accomplish (one line, shown in statusline)
- Now -- what the next session should do first (one line, shown in statusline)
- Test command -- a single command to verify the work (
go test ./..., npm test, etc.)
- Done this session -- completed tasks with file references
- Decisions -- choices made and their rationale
- Findings -- key learnings and discoveries