Skip to main content

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:

SituationUse 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 workN/A - nothing to continue

Capabilities

  1. Context Restoration - Query recent messages, decisions, errors
  2. State Detection - Identify todo status, file modifications, git changes
  3. Interruption Analysis - Determine exact point of interruption
  4. 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:

ElementSourcePriority
Last completed taskTodoWrite, session logHigh
Current in_progress taskTodoWriteHigh
Last edited filesgit status, file timestampsMedium
Recent tool callsContext messagesMedium
Blocking issuesError messagesHigh

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

ParameterTypeDefaultDescription
--deepflagfalseExtended context + file reads
--summaryflagfalseQuick summary only
--taskstringnullFocus on specific task ID
--sincestringnullOptional 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:

  • /cx executed 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

FailureCauseRecovery
No context foundEmpty cxqFall back to git log + session log
No active taskClean todo stateCheck PILOT plan for next task
Ambiguous stateMultiple in_progressAsk user which to continue

Integration Points

ComponentIntegration
/cxqContext queries
/orientFallback for complex cases
TodoWriteTask state tracking
Session logsActivity history
GitFile 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-PatternProblemSolution
Using at session startOverkill, use /orientCheck if fresh session
Skipping /cx firstMiss recent exportsAlways run /cx before queries
Skipping cxq queryMiss critical stateAlways query cxq first
Not checking todosMiss task progressAlways check todo state
Assuming time windowMiss old workQuery by count, not time
Not reading key filesLose implementation contextUse --deep for complex work
Not checking gitMiss file stateInclude git status
Guessing next stepWrong directionBase 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

  • 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