Skip to content

Across Sessions

Your AI coding agent forgets everything between sessions. Stato makes its knowledge persist on disk as validated Python modules that survive session restarts, /compact, and context window limits.

The Session Workflow

Terminal window
# Session 1: capture expertise
stato init
stato crystallize
# Saves prompt to .stato/prompts/crystallize.md
# Ask your coding agent:
# "Read and follow .stato/prompts/crystallize.md"
# Agent writes .stato/ modules based on what it learned.
stato validate .stato/
stato bridge --platform claude
# Session 2 (next day, after /compact, new terminal):
# Agent reads CLAUDE.md automatically — expertise is available
stato resume # structured recap if needed

No export, no import. The .stato/ files and bridge file live on disk and persist across every session.

How It Works

  1. Crystallize: run stato crystallize to save a capture prompt. Your agent reads the file and writes expertise (skills, plans, memory, context) into .stato/ modules
  2. Bridge: stato bridge --platform claude generates CLAUDE.md, which Claude Code auto-reads at session start
  3. Persist: .stato/ files survive on disk. The agent reads them on demand via the bridge’s working rules
  4. Resume: after /compact or context loss, stato resume reads all modules and produces a structured recap

Generating a Bridge

After crystallizing or writing modules, generate a bridge file so your coding agent discovers the expertise automatically:

Terminal window
stato bridge --platform claude

The bridge contains:

  • A skill summary table (name, version, key parameters, lesson count)
  • Current plan progress (objective, completion, next step)
  • Working rules that tell the agent how to use the modules

The bridge is a table of contents, not a copy of the modules. The agent loads individual skill files on demand (~500 tokens each) only when needed. This keeps context usage minimal even with 20+ skills.

Session Resume

Restore agent context after /compact or at the start of a new session:

Terminal window
stato resume

This produces a formatted panel showing:

  • Project name and description (from context module)
  • Plan progress (completed/total steps, next step)
  • Skills with versions and key parameters
  • Current phase and known issues (from memory module)

Brief Mode

For a one-paragraph summary:

Terminal window
stato resume --brief

Output:

cortex_scrna: scRNA-seq analysis of mouse cortex P14.
Progress: 3/7 steps complete. Next: find_hvg.
QC and normalization complete.

Raw Mode

For plain text output (useful for piping into a coding agent):

Terminal window
stato resume --raw

Combine Modes

Terminal window
stato resume --brief --raw

This gives a single plain-text paragraph, suitable for pasting directly into an agent prompt.

When to Use Resume

  • After /compact: the agent’s context window was compressed, but .stato/ modules are still on disk
  • New session: starting fresh with an agent that has never seen your project
  • Context restoration: any time the agent seems to have forgotten project details

Working Rules

Bridge files include working rules that guide agent behavior across sessions:

RulePurpose
Read plan firstAgent resumes from correct step, not from the beginning
Read skill files before tasksAgent uses learned parameters, not generic defaults
Update plan after stepsProgress is tracked, next session continues correctly
Update lessons_learnedKnowledge accumulates across sessions
Run validation after changesCompiler catches corruption before it compounds
Fix errors before proceedingNever work on top of invalid state

How Resume Works Internally

The resume command:

  1. Reads .stato/context.py, .stato/plan.py, .stato/memory.py, and all files in .stato/skills/
  2. Uses exec to load each module (handles missing files, syntax errors, and empty files gracefully)
  3. Extracts key fields from each module class
  4. Assembles a structured recap

No network calls, no external services. Everything comes from the files on disk.