sno code — Synoema Mode
Deep language integration for .sno projects
When Does Synoema Mode Activate?
The agent detects project type on startup. Synoema mode activates automatically when:
sno.tomlis present in the project root, or- ≥50% of source files have a
.snoextension
If both .sno files and other languages are present, the agent enters Mixed mode — Synoema tools remain active alongside general-purpose tools.
# Force Synoema mode regardless of detection
sno code --project-type synoema
# Check what the agent detects
sno code config detect
The status line (printed to stderr on startup) shows the resolved project type:
sno-code 0.1.0 | synoema | default | anthropic/claude-sonnet-4-6 | ask
Type-Aware Tools
In Synoema mode, the agent has access to language-specific tools that understand the type system, contracts, and module structure:
Typecheck before commit
The agent can run sno check to validate edits before suggesting them. Errors come back as structured diagnostics with LSP-compatible ranges, so the agent can self-correct:
# The agent uses this internally:
sno check file.sno
sno --errors json check file.sno # LSP-compatible JSON output
Contract verification
Synoema supports requires/ensures contracts on functions. The agent verifies that edits preserve contracts:
# Inspect contracts
sno doc --contracts rule_pump.sno
# Verify with timeout
sno verify file.sno
Code generation
The JIT compiler (Cranelift) and WASM backend are available as agent tools for testing generated code:
sno jit file.sno # JIT-compile and run
sno wasm file.sno # Compile to WebAssembly
sno build --native file.sno -o binary # AOT compile
Formatting
The agent auto-formats generated code with the deterministic sno fmt formatter:
sno fmt file.sno # Format in-place
sno fmt src/ --check # CI dry-run
MCP Integration
The Synoema MCP server (synoema-mcp) provides structured tools that the agent can invoke for deep codebase operations:
| MCP Tool | Description |
|---|---|
typecheck | Run sno check and return structured diagnostics |
eval_expr | Evaluate a Synoema expression and return the result |
doc_query | Query the language reference for type signatures and semantics |
get_context | Get surrounding context for a symbol or location |
get_context_for_edit | Get context optimized for making edits at a location |
search_corpus | RAG vector search over the Synoema knowledge base |
Setup
# Install MCP server
sno mcp-install
# Configure for Claude Desktop or Cursor
sno setup claude --binary
sno setup cursor --binary
# Verify
sno doctor
See MCP & RAG documentation for the full tool reference.
RAG Retrieval
The agent can search a pre-built vector index of the Synoema language documentation, stdlib, and idioms. This provides accurate, up-to-date knowledge about language features.
Install the RAG pack
sno rag install
sno rag status
The pack includes an ONNX embedding model and a pre-built vector index. Updates are checked automatically.
How it works
When the agent encounters a Synoema-related question, it routes the query through the Embed role (configurable model — e.g., ollama/bge-m3) to find relevant documentation chunks. Results are injected into the agent’s context for the current turn.
Custom indexes
# Build a custom index from your own sources
sno build-index \
--sources corpus.jsonl,docs/,skills/ \
--output ~/.sno/index/custom \
--model ~/.sno/models/embed/current \
--chunk-strategy auto \
--batch-size 64
SNO.md Overlay
In addition to AGENTS.md (loaded for all project types), Synoema mode loads SNO.md files that provide language-specific context:
repo/SNO.md # Repository-wide Synoema context
repo/src/SNO.md # Subsystem-specific overlay
repo/src/core/SNO.md # Module-specific overlay
SNO.md files are loaded after AGENTS.md and are injected with # Synoema-specific overlay: <path> headers. Use them for:
- Type system conventions specific to your project
- Contract patterns and verification rules
- Module dependency guidelines
- IoT rule compilation requirements
Inline Fix Agent
sno fix is a lightweight ReAct agent that automatically fixes type errors and diagnostics in a single file:
sno fix broken.sno # Fix type errors
sno fix broken.sno --max-turns 5 # Limit iterations
sno fix broken.sno --dry-run # Preview diff without writing
sno fix broken.sno --with-rag # Use RAG for context
sno fix broken.sno --with-rag --top-k 8
Unlike the full sno code agent, sno fix is focused on a single file and exits when all diagnostics are resolved or the turn limit is reached.
Synoema-Aware Skills
Skills are reusable task templates. In Synoema mode, the bundled skill library includes language-specific workflows:
# List available skills
sno skill list
# Install a custom skill
sno skill install ./my-skill/SKILL.md
Skills can specify tool allowlists, preferred models, and detailed instructions. They are injected into the agent’s context as an XML <skills> block.
Mixed Mode
When a project contains both .sno files and files in other languages, the agent enters Mixed mode. This is common for projects that use Synoema for domain logic alongside Rust, Python, or TypeScript for infrastructure.
In Mixed mode:
- All Synoema tools remain available (
sno check, contracts, MCP, RAG) - General-purpose tools are also active (file editing, shell commands)
- The agent can reason across language boundaries
# Force Mixed mode
sno code --project-type mixed
Agent Overview →
Installation, profiles, sessions, budget system.
Universal Mode →
Using sno code with Rust, Python, TypeScript, Go.
Command Reference →
All subcommands with flags and examples.