Docs/Core concepts

Architecture

A vendor-neutral orchestrator composes terminals, state, routing, tasks, approvals, and safe Git workspaces.

Component map

Human lead
dashboard + CLI
orchestrator corelifecycle · routing · supervision · approvals
adapter contract
Claude CodeCodexOpenCodeCopilotAntigravity
tmux terminalsSQLite stateJSONL historyGit worktrees
Dependency rule

internal/domain is the shared vocabulary. Only the orchestrator composes state, tmux, adapters, messaging, and tasks. Vendor-specific behavior stays inside internal/adapter/*.

Two sources of truth, deliberately

CURRENT STATE

.clishake/state.db

SQLite in WAL mode materializes agents, tasks, messages, approvals, and session state for fast concurrent queries.

COMPLETE HISTORY

.clishake/events.jsonl

An append-only audit record captures every mutation with an actor, subject, timestamp, payload, and correlation ID.

Message flow

routing model
lead types "@builder work 3"
  └─ orchestrator.Send(...) 
       ├─ parse + resolve selector
       ├─ persist message
       ├─ deliver through adapter
       └─ append sent / delivered / failed events

File-mode adapters receive JSONL envelopes. Interactive TUI adapters receive literal input through tmux after readiness is verified.

Supervision loop

  1. Consume outputResume from a persisted per-agent byte offset.
  2. Check the processInspect pane, dead status, PID, and adapter health.
  3. Classify exitsSeparate intentional stops, clean completion, and crashes.
  4. Apply restart policyUse exponential backoff and crash-loop protection.