Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ACP (Agent Client Protocol)

Castellan ships an ACP v1 stdio agent via castellan acp. Editors such as Zed can spawn Castellan as an external coordination agent — scheduler-primary runs that produce episodes, not chat transcripts.

MCP remains the primary Cursor integration path. See Cursor setup.

Capabilities

MethodStatus
initializeProtocol v1, camelCase agent capabilities
session/newBinds sessionIdcastellan-memory acp_sessions
session/forkFork session with parent lineage (parentSessionId persisted)
session/promptRuns CastellanEngine + persist_episode_bundle; emits session/update stream
session/resumeRestores checkpoint metadata (no chat replay)
session/loadReplays episode metadata via session/update notifications
session/cancelAborts in-flight prompt task
session/closeCancels + marks session closed
permissions/requestGovernance pipeline; set CASTELLAN_ACP_AUTO_DENY=1 in CI
promptDeprecated alias for session/prompt

Phase 3 (MOAT): mux-by-default when socket healthy; session/fork for parent-child lineage; EpisodeCheckpoint saved on every prompt.

Diagnostics

castellan acp doctor

Prints protocol version, agent capabilities, memory backend, mux health (mux_default_on, mux_effective, mux_socket_healthy), and env flags (CASTELLAN_MUX_AUTO, CASTELLAN_MUX_DISABLE, CASTELLAN_ACP_AUTO_DENY).

Zed smoke (5 steps)

  1. Build Castellan: cargo build --release -p castellan-cli
  2. Copy examples/zed-acp.json into your Zed settings agents list (adjust command path).
  3. Open a workspace with a .castellan/ directory (or let Castellan create one on first prompt).
  4. Start the Castellan agent in Zed and send: reach target with context plugin gridworld.
  5. Confirm the agent returns stopReason: completed, ≥3 session/update notifications, and .castellan/episodes/<goal_id>.json exists.

Mux episodes

BL-020: mux is the default when the multiplexer socket is healthy. Explicit "mux": true in prompt context forces mux; "mux": false opts out. Rollback env vars: CASTELLAN_MUX_AUTO=0 or CASTELLAN_MUX_DISABLE=1. ACP attaches pane_tree to persisted episodes for evolve flywheel compatibility.

Session fork

{"jsonrpc":"2.0","id":2,"method":"session/fork","params":{"sessionId":"<parent-id>"}}

Returns { "sessionId": "<child-id>", "parentSessionId": "<parent-id>" }. Child inherits cwd, plugin, and latest goal from parent.

Limitations

  • No full chat transcript replay on session/load — episode metadata only (MEMORY_ARCHITECTURE).
  • External editor MCP servers are bridged for castellan_* tools only in Phase 2; shell/file tools remain editor-side.
  • crates.io publish for library crates is dry-run only until the API stabilizes.