Purpose: How to resume work from previous sessions using session context and task files
Last Updated: 2026-02-04
.tmp/
├── sessions/ # Session context
│ └── {YYYY-MM-DD}-{task-slug}/
│ ├── context.md # Full task context
│ └── PROGRESS.md # Progress report
│
└── tasks/ # Task breakdowns
└── {task-slug}/
├── task.json # Main task definition
└── subtask_NN.json # Individual subtasks
# List recent sessions
ls -lt .tmp/sessions/ | head -5
# Most recent session
SESSION=$(ls -t .tmp/sessions/ | head -1)
echo "Latest session: $SESSION"
# View progress
cat .tmp/sessions/$SESSION/PROGRESS.md
Look for:
# View full context
cat .tmp/sessions/$SESSION/context.md
Key sections:
# Find task directory
TASK_DIR=.tmp/tasks/$(basename $SESSION | cut -d'-' -f4-)
# List subtasks
ls $TASK_DIR/subtask_*.json
# View next subtask
cat $TASK_DIR/subtask_04.json # Example
Subtask format:
{
"id": "04",
"name": "Migrate AgentLoader",
"description": "Create src/core/AgentLoader.ts with load/parse functions",
"estimated_hours": 1.5,
"status": "pending",
"dependencies": ["02"],
"context_files": ["...standards to load..."],
"acceptance_criteria": ["...checklist..."]
}
# 1. Check what's done
grep "✅" .tmp/sessions/$SESSION/PROGRESS.md
# 2. Find next task
grep "🔥 NEXT" .tmp/sessions/$SESSION/PROGRESS.md
# 3. Tell the agent
"Continue with subtask 04 from session $SESSION"
# 1. View phase structure
cat .tmp/tasks/$TASK_DIR/task.json | jq '.phases'
# 2. Find phase tasks
cat .tmp/tasks/$TASK_DIR/task.json | jq '.phases[1]' # Phase 2
# 3. Tell the agent
"Start Phase 2 - Adapters from session $SESSION"
# 1. Quick status
cat .tmp/sessions/$SESSION/PROGRESS.md | grep -A5 "Overall Progress"
# 2. View completed work
cat .tmp/sessions/$SESSION/PROGRESS.md | grep -A20 "Completed Work"
# 3. Discuss with agent
"Show me the current status of session $SESSION and suggest next steps"
Why: Contains standards you MUST follow
## Context Files (Standards to Follow)
- .opencode/context/core/standards/code-quality.md - CRITICAL
- .opencode/context/core/standards/test-coverage.md - CRITICAL
Before writing any code, load these standards!
Why: Shows exactly what's done and what's next
Key sections:
Why: Detailed task definition with acceptance criteria
Use when:
# Quick catch-up
cat .tmp/sessions/$SESSION/PROGRESS.md | head -50
# Read: Overall Progress + Completed Work + Next Steps
Time: 2 minutes
# Read original request
cat .tmp/sessions/$SESSION/context.md | grep -A20 "Current Request"
# Read components
cat .tmp/sessions/$SESSION/context.md | grep -A30 "Components"
Time: 3 minutes
# Read context files list
cat .tmp/sessions/$SESSION/context.md | grep -A15 "Context Files"
# Load the standards
cat .opencode/context/core/standards/code-quality.md
Time: 5 minutes
# Read exit criteria
cat .tmp/sessions/$SESSION/context.md | grep -A20 "Exit Criteria"
Time: 1 minute
When resuming a session, tell the agent:
"Resume session: {SESSION_ID}"
Or more specific:
"Continue with subtask 04 from session 2026-02-04-compatibility-layer-141"
The agent should:
.tmp/archive/sessions/{date}/After completing a session:
.tmp/sessions/{YYYY-MM-DD}-{task-slug}/.tmp/tasks/{task-slug}/