/continue - Resume Work After Context Loss
Resume work after context summarization, interruption, or break. Restores working memory and identifies where to pick up.
Usage
# Quick restore (default)
/continue
# With expanded context (more messages)
/continue --deep
# Show only summary, don't restore files
/continue --summary
# Focus on specific task
/continue A.9.2
System Prompt
EXECUTION DIRECTIVE:
When the user invokes /continue, immediately execute the context restoration workflow. Do not ask questions first.
You are restoring context after a mid-session interruption (context summarization, error, or break).
Goal: Get Claude back to the exact mental state before the interruption so work can continue seamlessly.
Step 0: Capture Latest Context (REQUIRED - ALWAYS FIRST)
Run /cx BEFORE anything else to ensure any recent exports or session data are captured:
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 before querying
CRITICAL: Without this step, queries may miss recent work that hasn't been indexed yet.
Step 1: Query Recent Context (REQUIRED)
Execute these searches to understand recent activity:
# Recent messages (last 50)
python3 "$(git rev-parse --show-toplevel)/.coditect/scripts/context-db.py" query --recent 50 --format brief
# Recent decisions
python3 "$(git rev-parse --show-toplevel)/.coditect/scripts/context-db.py" query --decisions --limit 5
Step 2: Check Working State (REQUIRED)
# Current todo list
cat /dev/stdin <<< "Check TodoWrite state from conversation"
# Recent file modifications (last 2 hours)
find . -type f -name "*.py" -o -name "*.md" -o -name "*.ts" | xargs ls -lt 2>/dev/null | head -20
# Git status for uncommitted work
git status --short
git diff --stat HEAD~3..HEAD 2>/dev/null || git log --oneline -5
Step 3: Identify Interruption Point
From the context gathered, determine:
- Last Completed Task - What was the last thing marked done?
- Current In-Progress Task - What task ID was being worked on?
- Last Tool Actions - What files were being edited/read?
- Pending Decisions - Any questions awaiting answers?
Step 4: Generate Restoration Summary
Output this format:
## Context Restored
**Last Working On:** [Task ID]: [Description]
**Status:** [in_progress/blocked/waiting]
**Last Actions:**
- [Action 1]
- [Action 2]
**Key Files:**
- `path/to/file1.py` - [what was being done]
- `path/to/file2.md` - [what was being done]
**Recent Decisions:**
- [Decision 1]
- [Decision 2]
**Next Step:** [Specific action to continue]
---
Ready to continue. What would you like me to do?
Step 5: Restore Critical Files (if --deep)
If --deep flag or complex work detected, read the key files:
# Read last 3 modified files relevant to the task
Read(file_path="path/to/relevant/file.py")
Options
| Option | Description |
|---|---|
--deep | Extended context (100 messages) + read key files |
--summary | Quick summary only, no file reads |
--task TASK_ID | Focus restoration on specific task |
--since TIME | Optional: limit file search to time window (e.g., "1h", "30m"). Context queries are NOT time-limited. |
Note: By default, /continue finds your last active work regardless of when it was. The --since flag only affects which modified files are shown, not the context query.
Examples
After Context Summarization
/continue
Result: Queries recent context, shows what was being worked on, suggests next step.
After Long Break
/continue --deep
Result: Extended context search, reads relevant files, full restoration.
Resume Specific Task
/continue A.9.2
Result: Focuses on Task A.9.2, shows its state and next actions.
When to Use
| Situation | Command |
|---|---|
| Context just summarized | /continue |
| Error/crash recovery | /continue --deep |
| After 30+ min break | /continue |
| Switching back to task | /continue TASK_ID |
| New session, known task | /orient then /continue TASK_ID |
Comparison with /orient
| Aspect | /orient | /continue |
|---|---|---|
| Use case | Session start | Mid-session recovery |
| Context source | PILOT plan, checkpoints | Recent cxq, git, todos |
| Scope | Full project | Last active work (any timeframe) |
| Agent discovery | Yes | No (assumes known) |
| Time | ~30 sec | ~10 sec |
| Output | Task recommendations | Working state restoration |
Note: /continue is NOT time-bounded. It finds your last active work whether that was 10 minutes ago or 10 days ago.
Integration
Works with:
/cxq- Context database queries/orient- Full session orientation- TodoWrite - Task state tracking
- Session logs - Activity history
Success Output
## Context Restored
**Last Working On:** A.9.2.6: Fix django-multitenant integration tests
**Status:** in_progress
**Last Actions:**
- Fixed TenantMeta configuration in models.py
- Added get_next_sync_cursor() to views.py
- Ran tests: 15/15 passing
**Key Files:**
- `backend/context/models.py` - TenantMeta class added
- `backend/context/views.py` - sync_cursor sequence fix
**Recent Decisions:**
- Use TenantMeta inner class pattern (not tenant_id attribute)
- Explicitly call PostgreSQL sequence for sync_cursor
**Next Step:** Update session log with test results, then commit changes.
---
Ready to continue. What would you like me to do?
Failure Indicators
This command has FAILED if:
- No recent context found in cxq
- Cannot determine last working task
- Git status unavailable
- No actionable next step identified
Completion Checklist
Before marking /continue 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)
- Last task identified (task ID or description)
- Clear next step provided
- Key files listed
When NOT to Use
Do NOT use /continue 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 |
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 context query | Miss critical state | Always query cxq |
| 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 |
Principles
This command 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
Skill: session-continuation
Script: scripts/context-restore.py
Version: 1.0.0
Created: 2026-01-05