Skill
Session Continuation Skill
Restore working context after mid-session interruptions (context summarization, errors, breaks).
When to Use
- Context window summarized mid-task
- Error/crash recovery
- Returning after 30+ minute break
- Switching back to previous task
- Lost track of where you were
When NOT to Use
Do NOT use this skill when:
| Situation | Use Instead |
|---|---|
| Fresh session, unknown project state | /orient |
| Need to discover which agent to use | /which <task> |
| Starting completely new task | /orient or direct work |
| Just need to search context | /cxq "search" |
| Project has no prior work | N/A - nothing to continue |
Capabilities
- Context Restoration - Query recent messages, decisions, errors
- State Detection - Identify todo status, file modifications, git changes
- Interruption Analysis - Determine exact point of interruption
- Continuation Guidance - Provide specific next step
Execution Steps
0. Capture Latest Context (ALWAYS FIRST)
Run /cx before any queries to ensure all recent exports and session data are indexed:
python3 "$(git rev-parse --show-toplevel)/.coditect/scripts/unified-message-extractor.py"
This ensures:
- Recent exports are processed and archived
- Session JSONL files are scanned for new messages
- Context database is fully up-to-date
CRITICAL: Without this step, queries may miss recent work!
1. Query Recent Context
# Recent messages from context database
/cxq --recent 50 --format brief
# Recent decisions
/cxq --decisions --limit 5
# Recent errors (if any)
/cxq "error OR failed OR blocked" --limit 10
2. Check Working State
# Todo list state (from conversation or session)
# Look for last TodoWrite call
# Recent file modifications
find . -type f \( -name "*.py" -o -name "*.md" -o -name "*.ts" -o -name "*.tsx" \) \
-mmin -120 | head -20
# Git working state
git status --short
git log --oneline -5
3. Analyze Interruption Point
From gathered context, extract:
| Element | Source | Priority |
|---|---|---|
| Last completed task | TodoWrite, session log | High |
| Current in_progress task | TodoWrite | High |
| Last edited files | git status, file timestamps | Medium |
| Recent tool calls | Context messages | Medium |
| Blocking issues | Error messages | High |
4. Generate Restoration Summary
Template:
## Context Restored
**Last Working On:** [Task ID]: [Description]
**Status:** [in_progress/blocked/completed]
**Last Actions:**
- [Most recent action]
- [Previous action]
- [Earlier action]
**Key Files:**
- `path/to/file.ext` - [modification description]
**Recent Decisions:**
- [Decision with rationale]
**Blockers (if any):**
- [Blocker description]
**Next Step:** [Specific actionable step]
---
Ready to continue.
5. Restore Key Files (Deep Mode)
If --deep or complex task detected:
# Read the 2-3 most relevant files
Read(file_path="most/recently/modified.py")
Read(file_path="related/context/file.md")
Input Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
--deep | flag | false | Extended context + file reads |
--summary | flag | false | Quick summary only |
--task | string | null | Focus on specific task ID |
--since | string | null | Optional time window (e.g., 1h, 30m). If not specified, finds last active work regardless of when. |
Note: By default, /continue is NOT time-bounded. It finds your last active work whether that was 10 minutes ago or 10 days ago.
Output Format
Minimal (--summary):
Last: A.9.2.6 - django-multitenant fix
Status: in_progress
Next: Update session log
Standard:
## Context Restored
**Last Working On:** A.9.2.6: Fix django-multitenant tests
**Status:** in_progress
**Last Actions:**
- Fixed TenantMeta in models.py
- Added sync_cursor sequence fix
- Tests: 15/15 passing
**Next Step:** Update session log with results
Deep (--deep): Standard + full file contents of key files
Completion Checklist
Before marking session continuation complete, verify:
-
/cxexecuted first (captured unprocessed exports) - Recent context queried (last 50+ messages)
- Git status checked (modified files, last commit time)
- Session log reviewed (most recent, any date)
- Working state identified (todos, files, git)
- Interruption point determined
- Last task identified (task ID or description)
- Clear next step provided
- Key files listed
Failure Modes
| Failure | Cause | Recovery |
|---|---|---|
| No context found | Empty cxq | Fall back to git log + session log |
| No active task | Clean todo state | Check PILOT plan for next task |
| Ambiguous state | Multiple in_progress | Ask user which to continue |
Integration Points
| Component | Integration |
|---|---|
/cxq | Context queries |
/orient | Fallback for complex cases |
| TodoWrite | Task state tracking |
| Session logs | Activity history |
| Git | File modification tracking |
Examples
After Context Summarization
Trigger: User sees "conversation summarized" message
Action:
/continue
Output:
## Context Restored
**Last Working On:** A.9.2.6: Fix django-multitenant integration tests
**Status:** in_progress (15/15 tests passing)
**Last Actions:**
- Added TenantMeta class to all 5 models
- Fixed sync_cursor NULL issue with sequence
**Next Step:** Update session log, commit changes
After Error Recovery
Trigger: Session crashed, restarted
Action:
/continue --deep
Output: Full restoration with file contents
Task Switch
Trigger: User was on A.9, wants to return from B.3
Action:
/continue A.9
Output: Context focused on Track A.9 tasks
Anti-Patterns
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Using at session start | Overkill, use /orient | Check if fresh session |
| Skipping /cx first | Miss recent exports | Always run /cx before queries |
| Skipping cxq query | Miss critical state | Always query cxq first |
| Not checking todos | Miss task progress | Always check todo state |
| Assuming time window | Miss old work | Query by count, not time |
| Not reading key files | Lose implementation context | Use --deep for complex work |
| Not checking git | Miss file state | Include git status |
| Guessing next step | Wrong direction | Base on actual state |
Principles
This skill embodies:
- #1 Recycle, Extend, Re-Use - Recovers prior work instead of restarting
- #3 Complete Execution - Full restoration pipeline with no manual steps
- #5 Search Before Create - Queries existing context before asking user
- #9 Based on Facts - Uses actual context data, not assumptions
Full Standard: CODITECT-STANDARD-AUTOMATION.md
Related Components
- Command:
/continue- User-facing invocation - Command:
/orient- Full session orientation - Skill:
moe-task-execution- Task execution workflow - Script:
context-db.py- Context database queries - Script:
context-restore.py- Restoration helper
Skill: session-continuation
Version: 1.0.0
Created: 2026-01-05
Author: CODITECT Framework