Introduction
Castellan
Self-evolving agent coordination runtime — the harness is the castellan.
Terminal demo — run → episode → multiplexer
Offline / no CDN — static transcript
$ castellan plugin list
$ castellan run --goal "reach target" --plugin gridworld
episode satisfied
$ castellan run --json | head -3
Download castellan-demo.cast ·
Run live from repo root: ./docs/demo/castellan-demo.sh
Castellan is a Rust coordination runtime: agents wake from a decaying pressure field, verify work through typed harness recursion (RAH), and improve topology from episode logs.
What makes Castellan different
| Dimension | Typical harness | Castellan |
|---|---|---|
| Coordination | Scripts / chat | Stigmergic pressure field + scheduler |
| Topology | Fixed | Evolved from .castellan/episodes/ |
| Recursion | API subagents | RAH verified depth in multiplexer panes |
| Execution | Vendor PTY | In-tree multiplexer + castellan dashboard |
Castellan is not a meta-harness wrapper or workflow DSL. Default castellan run uses deterministic plugins (gridworld, shell) — wire your LLM via MCP, ACP, or remote panes. See What Castellan is / is not.
Conventions
| Term | Meaning |
|---|---|
| Binary | castellan — single CLI entrypoint |
| Config | Layered castellan.toml → castellan.toml reference |
| Workspace | .castellan/ — episodes, archive, traces |
| MCP tools | castellan_* prefix — MCP tools |
| Socket API | NDJSON on multiplexer socket — Socket API |
Episode flywheel
flowchart LR
RUN[castellan run] --> LOG[.castellan/episodes]
LOG --> EVOLVE[castellan evolve]
EVOLVE --> GATE[castellan drift-check]
GATE --> RUN
classDef runtime stroke:#0969da,stroke-width:2px
classDef evolve stroke:#d97706,stroke-width:2px
classDef gate stroke:#1a7f37,stroke-width:2px
class RUN,LOG runtime
class EVOLVE evolve
class GATE gate
- Run —
castellan runorcastellan run --rlm - Log — episode JSON in
.castellan/episodes/ - Evolve — topology mutations from corpus
- Gate —
castellan drift-checkmanifest guardrails
castellan run --goal "reach target" --plugin gridworld
Full walkthrough: Quickstart.
Quick paths
| Goal | Page |
|---|---|
| First episode | Quickstart |
| Daily driver loop | Daily driver |
| Agent in panes | Agent guide |
| CLI surface | CLI reference |
Build this book locally
mdbook build book && mdbook serve book
See Deployment. Live site: castellan-docs.pages.dev.