title: "Session Architecture" last_updated: 2026-03-21 status: experimental difficulty: intermediate prerequisites: [05-sub-agents]
Session Architecture
Coming in V2. This module is scaffolded with an outline.
Core Question
How do I structure work across sessions for continuity and recovery?
Module Outline
Concepts
-
Sessions as units of work — Each session has a context window, a goal, and a set of changes. How you scope sessions determines your productivity.
-
The session sizing problem — Too small: overhead of re-establishing context. Too large: context window fills up, agent loses focus, risk of compounding errors.
-
Session continuity patterns — How to hand off work between sessions: commit messages as context, session summaries, TODO files, plan files.
-
The --continue and --resume patterns — When to continue a previous session vs. starting fresh.
-
Session checkpointing — Committing at natural breakpoints so you can recover from agent mistakes.
-
Multi-session workflows — Breaking large projects into a sequence of focused sessions with clear handoff points.
-
The context window budget — Understanding what fills the context window and how to manage it (/compact, targeted file reads, concise prompts).
Tool-Specific Content
- Claude Code: --continue, --resume, /compact, session history, context management
- Codex CLI: session management, conversation history, context handling
Exercises
- Plan a multi-session workflow for a medium-sized feature
- Practice session handoffs: end one session, start another, verify continuity
- Context window management: monitor usage, practice /compact, optimize prompts
- Recovery drill: intentionally create a messy session, recover using checkpoints