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
# Session 1: capture expertisestato initstato 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 availablestato resume # structured recap if neededNo export, no import. The .stato/ files and bridge file live on disk and persist across every session.
How It Works
- Crystallize: run
stato crystallizeto save a capture prompt. Your agent reads the file and writes expertise (skills, plans, memory, context) into.stato/modules - Bridge:
stato bridge --platform claudegeneratesCLAUDE.md, which Claude Code auto-reads at session start - Persist:
.stato/files survive on disk. The agent reads them on demand via the bridge’s working rules - Resume: after
/compactor context loss,stato resumereads 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:
stato bridge --platform claudeThe 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:
stato resumeThis 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:
stato resume --briefOutput:
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):
stato resume --rawCombine Modes
stato resume --brief --rawThis 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:
| Rule | Purpose |
|---|---|
| Read plan first | Agent resumes from correct step, not from the beginning |
| Read skill files before tasks | Agent uses learned parameters, not generic defaults |
| Update plan after steps | Progress is tracked, next session continues correctly |
| Update lessons_learned | Knowledge accumulates across sessions |
| Run validation after changes | Compiler catches corruption before it compounds |
| Fix errors before proceeding | Never work on top of invalid state |
How Resume Works Internally
The resume command:
- Reads
.stato/context.py,.stato/plan.py,.stato/memory.py, and all files in.stato/skills/ - Uses
execto load each module (handles missing files, syntax errors, and empty files gracefully) - Extracts key fields from each module class
- Assembles a structured recap
No network calls, no external services. Everything comes from the files on disk.