x-harness emblemx-harness
Back to overview

Docs & Scaling Up

Everything in the multi-agent coordination layer is opt-in. You never need it for everyday cross-harness messaging, shared memory, or handoffs — but it's ready in the same zero-dependency binary when you run parallel worktrees.

Everyday CLI

After running node x-harness/bin/x-harness.mjs init, the x-harness CLI is linked into ~/.local/bin/x-harness.

# Setup & diagnostics
x-harness init                         # Wire MCP, hooks, skills & CLI shim
x-harness status                       # Inspect live agents, hooks & DB health

# Built-in 2-line terminal statusline (zero deps)
x-harness statusline                   # Render statusline for current session
x-harness statusline install           # Wire statusline into Claude Code / agy

# Unified cross-harness handoffs
x-harness handoff path --rotate        # Archive old latest.md, print fresh path

# Auto-wake idle session without tmux
x-harness watch --name agy-review      # Exits 0 with JSON when a message arrives

All 14 MCP Tools

Exposed over standard stdio MCP to Claude Code, Antigravity, Codex, OpenCode, and Cursor.

Messaging & Presence (8 tools)

ToolPurpose
inbox_whoamiShow handle, harness, role, workstream, branch, state, and unread count
inbox_registerClaim a short handle (e.g. claude-api, agy-review), summary, role, workstream, or PR URL
inbox_list_agentsList live sessions across harnesses with role, workstream emoji, state, and who-owes-whom reply status
inbox_sendDirect message or "*" broadcast (optional wait_for_reply_seconds + idle tmux auto-wake)
inbox_checkRead unread messages (marks read by default)
inbox_waitBlock up to 110s until a new unread message arrives
inbox_reportReport builder status (working, idle, stuck, needs_input, done + PR URL); logs board event & alerts live coordinator
memory_infoReturn canonical memory directory, MEMORY.md content, and topic files for the current repo

Workstream Coordination & Orchestration (6 tools)

ToolPurpose
coord_statusRead or atomically update workstream status (waiting, broken, in_flight, queued, done), view pending triage answers, and sync optional status-<ws>.md mirror
coord_boardRead or append to the workstream's append-only board log (note, report, decision, routed, answer, handback)
coord_sessionsList live builder/coordinator sessions in a workstream with state, PR URL, and who-owes-whom status
orch_checkZero-token Orchestrator gate across all workstreams (30m push safety net, 60m stuck lane nudge, queued lane start under caps, dead-coordinator restart)
orch_recordTransactionally record an Orchestrator action BEFORE acting (<= 3 lanes/ws, <= 10 lanes/day, <= 1 restart/day; denied halts without retrying)
orch_digestRender a concise <= 40-line cross-workstream rollup digest

Multi-Agent Fleet CLI

Manage parallel workstreams, answer human triage questions in a single TUI, run zero-token orchestrator checks, and route GitHub PR review/CI events.

# Workstream Coordinator status, board log & live sessions
x-harness coord status [workstream] [--json]
x-harness coord board <workstream> [--append "Decision..." --kind decision]
x-harness coord sessions [workstream]

# Human Triage Inbox (interactive TUI or scriptable CLI)
x-harness triage                                    # Interactive TUI (y/n/r/d/s/o)
x-harness triage --list                             # Plain-text summary
x-harness triage answer <ws> <id> yes               # Instant coordinator wakeup

# Zero-token Orchestrator gate & digest
x-harness orch check --json                         # 0 LLM tokens when should_wake=false
x-harness orch digest [--mark-looked]

# Cross-harness launcher (tmux or direct) & PR feedback router
x-harness launch --harness codex --role builder --workstream chat --tmux-session dev
x-harness pr-watch --once                           # Route new CI/review/conflict events via gh

Lifecycle Hooks

x-harness init wires lightweight hooks by default (pass --no-hooks to opt out). All hooks walk the process ancestor tree so sibling sessions in the same directory stay isolated.

4-Layer Architecture

All state, coordination logic, and decision gates live in zero-dependency Node/Bun + SQLite WAL, while every harness integration is a paper-thin adapter.

Layer 4
Thin Harness Adapters & Views

Claude Code plugin, Antigravity hooks & skills, Codex/OpenCode/Cursor MCP, and terminal views (x-harness status, triage, statusline).

Layer 3
Orchestrator (Multi-Workstream Oversight)

Deterministic zero-token gate (orch check), transactional rate caps (<=3 lanes/ws, <=10/day, <=1 restart/day), and <=40-line rollups.

Layer 2
Coordinator & Workstreams

Git worktree auto-grouping with deterministic FNV-1a emojis, structured workstream_items, append-only board_events, Human Triage TUI, and PR feedback routing.

Layer 1
Transport, Presence, Memory & Handoffs

SQLite WAL (state.db), PID liveness & ancestor-PID scoping, DMs & broadcasts, idle tmux auto-wake, canonical ~/.agents/memory, and once-only handoff pickup.