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

  1. 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.

  2. The session sizing problem — Too small: overhead of re-establishing context. Too large: context window fills up, agent loses focus, risk of compounding errors.

  3. Session continuity patterns — How to hand off work between sessions: commit messages as context, session summaries, TODO files, plan files.

  4. The --continue and --resume patterns — When to continue a previous session vs. starting fresh.

  5. Session checkpointing — Committing at natural breakpoints so you can recover from agent mistakes.

  6. Multi-session workflows — Breaking large projects into a sequence of focused sessions with clear handoff points.

  7. 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

  1. Plan a multi-session workflow for a medium-sized feature
  2. Practice session handoffs: end one session, start another, verify continuity
  3. Context window management: monitor usage, practice /compact, optimize prompts
  4. Recovery drill: intentionally create a messy session, recover using checkpoints