Crystallize
The crystallize command saves a structured prompt that instructs an AI agent to capture its current expertise as stato modules. There are two modes: one for coding agents and one for web AI.
Coding Agent Mode (Default)
stato crystallizeThis saves the crystallize prompt to .stato/prompts/crystallize.md and prints a short instruction message. Tell your coding agent (Claude Code, Cursor, Codex): “Read and follow .stato/prompts/crystallize.md”. The agent reads the file and writes Python modules to .stato/.
To also print the full prompt to terminal:
stato crystallize --printWhat the Agent Creates
After reading the crystallize prompt, the agent writes up to 5 module types:
| Module | File | Purpose |
|---|---|---|
| Skill | .stato/skills/<name>.py | Reusable procedures with parameters, run() method, and lessons learned |
| Plan | .stato/plan.py | Project objective, steps (with status and dependencies), decision log |
| Memory | .stato/memory.py | Current phase, tasks, known issues, reflection |
| Context | .stato/context.py | Project name, description, datasets, environment, conventions |
| Protocol | .stato/protocol.py | Multi-agent handoff schemas and validation rules |
Each module is a Python class with typed fields. The compiler validates every module before writing to disk.
Two Capture Modes
The crystallize prompt supports two modes:
- Session-specific capture (primary, richest mode): The agent has been working on the project, learned parameters, made decisions, hit failures. It captures that expertise directly from its session context.
- Fresh session capture: The agent just started and has no session history. It reads the project’s existing code, configs, notebooks, and documentation, then infers expertise from what it can observe.
The agent automatically detects which mode applies based on whether it has session context.
Web AI Mode
stato crystallize --webThis prints a prompt designed for web AI conversations (Claude.ai, Gemini, ChatGPT) and also saves it to .stato/prompts/crystallize_web.md. Instead of writing files directly, the web AI outputs a single Python bundle file containing all modules.
For clipboard copy:
stato crystallize --web | pbcopyWeb AI Workflow
- Copy the web crystallize prompt
- Paste into your web AI conversation
- The AI outputs a bundle file (a single Python file with
SKILLS,PLAN,MEMORY,CONTEXTvariables) - Save the output as
stato_bundle.py - Import into your project:
stato import-bundle stato_bundle.pyThe bundle parser uses ast.parse (not exec) for safety, then validates each module through the 7-pass compiler before writing.
See Web AI Bridge for the complete workflow.
Options
| Flag | Description |
|---|---|
--print | Print full prompt to terminal (in addition to saving to file) |
--web | Web AI prompt (prints to terminal, saves to crystallize_web.md) |
--path | Project directory (default: .) |