Restore previous session state from Serena MCP checkpoints. Retrieves checkpoint by ID or auto-selects most recent, deserializes context, restores command/skill/phase/wave state. Use when: resuming after context loss, continuing previous session, recovering from interruption.
View on GitHubkrzemienski/shannon-framework
shannon
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/krzemienski/shannon-framework/blob/main/skills/context-restoration/SKILL.md -a claude-code --skill context-restorationInstallation paths:
.claude/skills/context-restoration/# Context Restoration Skill
## Purpose
Restore complete session state after context loss events (auto-compact, session break, interruption).
**Zero Context Loss Promise**: When combined with context-checkpoint skill, users can resume exactly where they left off regardless of auto-compact events or session boundaries.
---
## Inputs
**Required:**
- `checkpoint_id` (string): Unique checkpoint identifier (e.g., "SHANNON-W2-20251103T143000")
**Optional:**
- `auto_select` (boolean): Automatically select most recent checkpoint if ID not provided (default: true)
- `project_id` (string): Filter checkpoints by specific project
- `validate_integrity` (boolean): Verify checkpoint integrity via SHA-256 hash (default: true)
---
## When to Use This Skill
Activate context-restoration when:
1. **After Auto-Compact** - Claude Code compressed conversation history
2. **New Session Start** - User returns after hours/days
3. **Context Loss Detection** - Claude doesn't remember recent work
4. **Project Switching** - Loading different project context
5. **Error Recovery** - Restoring from last known good state
---
## Workflow
### Step 1: Identify Checkpoint
```yaml
Input Options:
- Checkpoint ID: "precompact_checkpoint_20250930T143000Z"
- Auto Mode: Find most recent checkpoint automatically
- Project-Specific: Latest checkpoint for specific project
- Phase-Specific: Checkpoint from specific phase
```
**Auto-Detection Logic**:
```python
# Priority order for auto-selection:
1. Read "latest_checkpoint" pointer from Serena
2. If not found, list all checkpoints and sort by timestamp
3. Select most recent checkpoint
4. Validate checkpoint is not corrupted
```
### Step 2: Retrieve Checkpoint from Serena
**Serena MCP Operation**:
```python
# Method 1: Direct retrieval (if ID known)
checkpoint_data = read_memory(checkpoint_id)
# Method 2: Auto-selection
latest_key = read_memory("latest_checkpoint")
checkpoint_data = read_memory(latest_key)
# Method 3: Search and filter
a