orca
orca/v1Observable agent lanes with one machine-readable contract. Dispatch Codex, Claude, or Cursor work; inspect durable evidence; answer blocked questions; and resume the same native session with verified continuity.
npm install -g orcastrator# Discover the installed contract firstorca contractorca agents# Dispatch an internal Codex workerorca dispatch --agent codex --cwd . "Review the current diff"Mental Model
Orca is a substrate for orchestrators, not an orchestrator itself. The caller decides what work to delegate and how to judge it. Orca owns native session binding, durable state, process control, continuity checks, and a stable JSON boundary across agents.
orca contract and trust it over remembered behavior. Run orca agents before routing work so capability and caveat decisions use the live adapter manifests.| lane | Orca's durable unit of delegated work. |
| native session | The Codex thread, Claude session, or Cursor chat bound to a lane. |
| event stream | Append-only evidence with gap-free sequence numbers. |
| envelope | The final, versioned JSON result emitted by every lane verb. |
Dispatch Surfaces
lane โ internal worker (default)
A worker intended to report its result back to a coordinating agent or script. It remains durable so it can be inspected and resumed.
orca dispatch --agent codex --cwd . "Investigate the flaky test"task โ user-followable Codex thread
A deliberately named thread intended for direct follow-up in Codex clients that share the same CODEX_HOME. Task surface is Codex-only and requires a non-empty --label.
orca dispatch --agent codex --surface task \ --label "HAPPY-123 โ Fix API" \ --cwd /path/to/existing/worktree \ "Implement HAPPY-123 and run its focused tests"--cwd. Persistent lane threads can also appear in Desktop because the requested source is a host-normalized hint, not a visibility filter.orca dispatch
orca dispatch --agent <agent> [--surface lane|task] [--model <model>] [--cwd <dir>] [--label <label>] [--timeout <ms>] <prompt>Create a lane and drive one native agent turn until it completes, fails, is killed, times out, or blocks on a question.
| --agent | Required adapter: codex, claude, or cursor. |
| --surface | Ownership surface. Defaults to lane; task is Codex-only. |
| --model | Adapter-specific model override. |
| --cwd | Agent working directory. Defaults to the current directory. |
| --label | Orca label; required native title for task surface. |
| --timeout | One deadline shared by connection, session binding, and the turn. |
Dispatch prints a handle line immediately after lane creation, then exactly one final envelope. Capture the handle when another process may need to inspect or kill the lane before the turn settles.
{"v":1,"kind":"handle","laneId":"lane_a3f81c02","agent":"codex"}{"v":1,"kind":"lane","ok":true,"status":"completed","lane":{"id":"lane_a3f81c02","agent":"codex","surface":"lane"},"delivery":"confirmed","nativeStatus":"completed","semanticOutcome":"unknown","result":{"text":"..."}}orca inspect
orca inspect <laneId> [--follow] [--since <seq>] [--wait-for blocked|done] [--timeout <ms>]Read current state and durable events, optionally following until a target state is reached.
orca inspect lane_a3f81c02orca inspect lane_a3f81c02 --since 7orca inspect lane_a3f81c02 --followorca inspect lane_a3f81c02 --wait-for blocked --timeout 600000--since N returns events with a sequence greater than N. Terminal states also satisfy --wait-for blocked, so always read the returned status instead of assuming the lane actually blocked.
orca answer
orca answer <laneId> <text>Submit an answer to a blocked lane's pending question.
orca answer lane_a3f81c02 "Use the staging database"Answering a lane that is not blocked returns invalid_state (exit 4). Only Codex currently supports question parking, and that model behavior remains best-effort.
orca resume
orca resume <laneId> [--timeout <ms>] <prompt>Start a follow-up turn on the same native session and fail loud if continuity cannot be verified.
orca resume lane_a3f81c02 "Now add tests for the edge cases"Completed and parked blocked lanes can resume. Failed, killed, and lost lanes cannot. A blocked lane with a live question poller rejects resume to prevent two processes from driving one native session.
orca lanes
orca lanesList known lane records newest-first in a kind:list envelope.
orca lanesorca kill
orca kill <laneId>Terminate a queued, running, or blocked lane using the persisted native process identity.
orca kill lane_a3f81c02Killing an already-killed lane is idempotent. Killing a completed, failed, or lost lane returns invalid_state.
orca agents
orca agentsReturn the live adapter manifests used for evidence-based routing.
orca agents | jq '.agents[] | {agent, capabilities, caveats}'| codex | App Server threads, thread-ID continuity, best-effort question parking, optional browser use, and named task surface. |
| claude | One-shot claude -p, session-ID continuity, no question parking, and permissions that can deny writes by default. |
| cursor | Cursor chat continuity, worktree support, no question parking, and a first-output heartbeat for cold starts that can take 30โ100 seconds. |
Model lists and measured overhead can change. Read the manifest instead of hard-coding them.
orca contract
orca contract [--schema envelope|event|manifest]Return the versioned command contract, exit codes, notes, and JSON Schemas.
orca contractorca contract --schema envelopeorca contract --schema eventorca contract --schema manifestBlocked Question Flow
# Terminal states also satisfy this wait; inspect status.orca inspect lane_a3f81c02 --wait-for blocked --timeout 600000orca answer lane_a3f81c02 "Postgres"orca resume lane_a3f81c02 "Continue with that answer"blocked is a successful state: ok:true, exit 0. It means the turn stopped at an explicit input boundary, not that the adapter failed.
Envelope Semantics
Three independent axes prevent protocol delivery from being mistaken for task success:
| delivery | Whether the native agent acknowledged the turn. |
| nativeStatus | What the native protocol or process reported. |
| semanticOutcome | An explicit validator result. Without a validator it stays unknown; Orca never infers correctness from prose. |
{ "v": 1, "kind": "lane", "ok": true, "status": "completed", "lane": { "id": "lane_a3f81c02", "agent": "codex", "surface": "task", "agentSessionId": "019f..." }, "delivery": "confirmed", "nativeStatus": "completed", "semanticOutcome": "unknown", "result": { "text": "..." }, "timing": { "wallMs": 6557, "startupMs": 2050 }}- A command never exits 0 with
ok:false. usageandtimingcover one dispatch or resume turn, not lane history.- Continuity proves session identity, not semantic compliance. Read
statusandresult.text. - stderr is diagnostic and non-contractual; stdout carries the handle and envelope.
Exit Codes
| 0 | Success, including status:"blocked". |
| 2 | usage_error โ malformed command line. |
| 3 | agent_unavailable, adapter_error, or agent_failed. |
| 4 | invalid_state, lane_not_found, or continuity_unverified. |
| 5 | timeout โ the turn deadline was exceeded. |
Durable State
Lane state lives under $${ORCA_HOME:-~/.orca}/lanes/<laneId>/. Set ORCA_HOME to isolate tests and automation from personal history.
lane.json # durable lane recordevents.ndjson # append-only evidence streamanswer.txt # transient blocked-answer handoffAgent Skill
Give an agent a compact operator guide. It starts with live contract discovery and keeps routing, question, continuity, and task-surface caveats close to the commands.