Skip to content
/

ORCH

orch-oxgeneral · oxgeneral/ORCH · ★ 68 · last commit 2026-05-19

Orchestrates teams of parallel AI agents (CTO + workers + reviewer) on a single codebase with YAML flat-file state, a TUI dashboard, and CI-friendly headless mode.

Best whenORCH is an AI agent runtime with a zero-dependency core engine — the value is the orchestrator tick loop + state machine, not the CLI or TUI that sit on top …
Skip ifManual agent tab-switching and copy-paste context routing, Unstructured task states (all transitions validated by canTransition())
vs seeds
superpowers' skill-pack pattern but inject at dispatch time rather than via CLAUDE.md auto-loading.
Primitive shape 32 total
Skills 27 Subagents 5
00

Summary

ORCH — Summary

ORCH (@oxgeneral/orch) is a TypeScript npm package that orchestrates teams of AI agents (Claude, Codex, OpenCode, Cursor) working on a single codebase in parallel, with a terminal TUI dashboard, a headless serve mode for CI/CD, and a Claude Code skill (/orch) for natural-language orchestration commands. The architecture is layered DDD (domain/application/infrastructure/CLI) with dependency injection, a state-machine task lifecycle (todo → in_progress → review → done), and an orchestrator tick-loop that reconciles PIDs, dispatches idle agents, and collects completed runs. All state lives in flat files under .orchestry/ — individual YAML files for tasks/agents/goals/teams, JSON for runs, atomic writes for corruption safety. The framework supports multi-agent parallel execution with role-based adapter selection (claude, opencode, codex, cursor, shell), 26 Markdown skills injected at agent dispatch, and a --once headless mode for CI pipelines. ORCH is most similar to claude-flow in its orchestrator-agent hierarchy, but uses flat-file YAML storage instead of SQLite, a TUI instead of a web dashboard, and does not implement any consensus protocols. The /orch Claude Code skill makes ORCH self-bootstrapping — the user types natural language and Claude translates it into orch CLI commands.

01

Overview

ORCH — Overview

Origin

Published as @oxgeneral/orch on npm (68 stars, MIT license, TypeScript, last commit 2026-05-19). The project positions itself against the "you're managing agents full-time" problem — founders/solo developers with Claude/Codex who spend 40-60% of their time routing agents rather than building.

Philosophy

"Open-source orchestration for zero-human companies, processes and departments." "Run multiple AI agents on one project — without babysitting any of them." "Set a goal at 10pm. Five agents decompose, implement, test, and review. You wake up to pull requests."

From CLAUDE.md:

"ORCH is an AI agent runtime — not just a CLI tool. The core engine (domain + application + infrastructure) has zero dependencies on CLI/TUI layers."

Key design choices:

  1. Zero infrastructure: No database server, no cloud, no Docker — just flat files in .orchestry/
  2. Multi-adapter: The same IAgentAdapter interface works for claude, codex, opencode, cursor, shell
  3. State machine formalism: Task transitions are validated by canTransition() — no ad-hoc status strings
  4. Skill injection: 26 Markdown skills loaded from skills/library/ are injected into agent prompts at dispatch time
  5. Natural language entry: The /orch Claude Code skill means users never need to memorize CLI flags

Target User

Solo founders, small engineering teams who want to run background agent work overnight without manual supervision.

02

Architecture

ORCH — Architecture

Distribution

  • Type: npm-package
  • Binaries: orchestry, orch, ao (all point to ./dist/cli.js)
  • Version: latest on npm as @oxgeneral/orch
  • Language: TypeScript (ESM + DTS bundles via tsup)

Install Methods

npm install -g @oxgeneral/orch
cd ~/your-project && orch    # Launch TUI
# Or headless:
orch serve --once --log-format json

Required Runtime

  • Node.js (version unspecified; uses ESM)

Directory Structure (layered DDD)

src/
├── domain/              # Models, state machine, errors
│   └── transitions.ts   # canTransition() — todo→in_progress→review→done
├── application/         # Services, orchestrator, event bus
│   └── orchestrator.ts  # Tick loop: reconcile→dispatch→collect
├── infrastructure/      # Adapters, storage, process manager, templates
│   ├── adapters/        # IAgentAdapter implementations: claude, opencode, codex, cursor, shell
│   ├── storage/         # YAML/JSON file stores, atomicWrite(), readJsonlTail()
│   ├── skills/          # SkillLoader — 26 Markdown skills
│   └── workspaces/      # Workspace isolation (worktree/shared/isolated modes)
├── tui/                 # Ink/React TUI dashboard
│   └── App.tsx          # Batched message queue (80ms flush), OOM protection
├── bin/
│   └── cli.ts           # Entry point → LightContainer or Container (DI)
├── cli/
│   └── commands/        # 16 CLI command modules
│       ├── agent.ts, config.ts, context.ts, doctor.ts, goal.ts, init.ts
│       ├── logs.ts, msg.ts, org.ts, run.ts, serve.ts, status.ts
│       ├── task.ts, team.ts, tui.ts, update.ts
└── container.ts         # DI: LightContainer (read-only) vs Container (full)

.orchestry/ State Directory

All state in flat files — no database server:

.orchestry/
├── tasks/          # Individual YAML files per task
├── agents/         # Individual YAML files per agent
├── goals/          # Individual YAML files per goal
├── teams/          # Individual YAML files per team
├── runs/           # JSON metadata + append-only JSONL events per run
├── context/        # Context JSON files
├── messages/       # Message JSON files
└── state.json      # Single orchestrator state file

Target AI Tools

Claude Code (claude adapter), Codex (codex adapter), OpenCode (opencode adapter), Cursor (cursor adapter), any shell command (shell adapter).

03

Components

ORCH — Components

CLI Commands (16)

Command Purpose
orch init [--name] Initialize .orchestry/ in current directory
orch agent <subcommand> Create/list/edit/delete agents; orch agent shop for pre-built configs
orch task <subcommand> Add/list/show/assign/cancel/approve/reject/retry/edit tasks
orch goal <subcommand> Manage high-level goals (decomposed into tasks by CTO agent)
orch team <subcommand> Manage agent teams
orch org deploy <template> Deploy a pre-built organization template (e.g., startup-mvp)
orch run [--all] [--watch] Run agents on tasks; --all for all ready tasks in parallel
orch serve Headless daemon for CI/CD
orch serve --once Process all todo tasks, exit when done
orch status Show orchestrator overview
orch logs [--follow] View run logs with JSONL tail
orch msg <subcommand> Send context messages between agents
orch context <subcommand> Manage project context
orch config <subcommand> View/edit ORCH configuration
orch doctor Check adapters and dependencies
orch update [--check] Check/install updates

Skill Library (26 Markdown skills in skills/library/)

Skill Purpose
autoplan.md Automated planning from goal
benchmark.md Performance benchmarking
browse.md Browser automation
canary.md Canary deployment
careful.md Careful/conservative mode
codex.md Codex-specific instructions
design-consultation.md Design review
design-review.md Design feedback
document-release.md Release documentation
freeze.md Code freeze
guard.md Safety guardrails
investigate.md Investigation/debugging
land-and-deploy.md Landing + deployment
office-hours.md Office hours mode
plan-ceo-review.md CEO-level plan review
plan-design-review.md Design plan review
plan-eng-review.md Engineering plan review
qa-only.md QA without fix
qa.md Full QA with fix
retro.md Retrospective
review.md Code review
setup-browser-cookies.md Browser auth setup
setup-deploy.md Deployment setup
ship.md Ship/release workflow
unfreeze.md Code unfreeze
upgrade.md Dependency upgrade

Claude Code Skill (skills/orch/SKILL.md)

A skill file auto-discovered by Claude Code:

  • Natural language → CLI commands translation
  • Full CLI reference embedded in skill
  • --json flag guidance for programmatic output
  • Handles: init, task management, agent management, goal management, team management, running agents

Agent Adapters (src/infrastructure/adapters/)

All implement IAgentAdapter.execute(params){ pid, events: AsyncGenerator<AgentEvent> }:

Adapter Agent
claude Claude CLI
opencode OpenCode (multi-provider)
codex OpenAI Codex
cursor Cursor IDE
shell Any shell command

Workspace Modes

Task-level workspace isolation:

  • shared — all agents share the working directory
  • worktree — each agent gets its own git worktree
  • isolated — fully isolated workspace

Pre-Built Organization Templates

orch org deploy <template> deploys named teams:

  • startup-mvp — CTO + Backend A/B + QA + Reviewer (5 agents)
  • Other templates available via orch agent shop
05

Prompts

ORCH — Prompts

/orch Skill (skills/orch/SKILL.md) — Verbatim Excerpt

---
name: orch
description: "AI agent orchestrator — manage teams of AI agents that work on your codebase 
in parallel. Use when the user wants to: run multiple agents, coordinate AI work, deploy 
agent teams, manage tasks/goals/agents, check orchestrator status, or mentions 'orch', 
'orchestry', 'agents team', 'agent orchestration'."
allowed-tools: Bash, Read, Glob, Grep, Write, Edit, Agent
argument-hint: "[command or natural language request]"
---

# ORCH — AI Agent Orchestrator

You are the user's assistant for **ORCH** (`@oxgeneral/orch`) — an AI agent runtime that 
coordinates teams of LLM agents working on a codebase in parallel.

Your role: interpret user intent and execute the right `orch` CLI commands. The user may 
speak in natural language — translate their intent into concrete actions.

## How to Work

1. **Natural language → CLI commands**: User says "add a task to refactor auth" → you run 
   `orch task add "Refactor auth module" -d "..." --scope "src/auth/**"`
2. **Always use `--json` flag** when you need to parse output programmatically
3. **Chain commands** when the user's request requires multiple steps
4. **Explain what you're doing** briefly before running commands
5. **Show results** in a readable format after commands complete

Prompting technique: Role assignment ("You are the user's assistant for ORCH") + translation directive (natural language → CLI) + explicit --json requirement for machine parsing. The trigger description is rich — 8 specific phrases the skill fires on.


/review Skill (skills/library/review.md) — Verbatim Excerpt

## Step 0: Detect base branch

Determine which branch this PR targets. Use the result as "the base branch" in all 
subsequent steps.

1. Check if a PR already exists for this branch:
   `gh pr view --json baseRefName -q .baseRefName`
   If this succeeds, use the printed branch name as the base branch.

## Step 1.5: Scope Drift Detection

Before reviewing code quality, check: **did they build what was requested — nothing more, 
nothing less?**

1. Read `TODOS.md` (if it exists). Read PR description.
2. Identify the **stated intent** — what was this branch supposed to accomplish?
3. Evaluate with skepticism:
   **SCOPE CREEP detection:**
   - Files changed that are unrelated to the stated intent
   - New features or refactors not mentioned in the plan
   - "While I was in there..." changes that expand blast radius
   
   **MISSING REQUIREMENTS detection:**

Prompting technique: Step-numbered procedure with explicit detection categories. The "Scope Drift Detection" step is a novel quality gate — it checks for both over-delivery (scope creep) and under-delivery (missing requirements) before code quality review.

09

Uniqueness

ORCH — Uniqueness

differs_from_seeds

ORCH is most similar to claude-flow — both implement a hierarchical orchestrator-worker pattern with parallel multi-agent execution and a CLI + dashboard surface. Key differences: ORCH uses flat YAML files in .orchestry/ instead of SQLite; it ships a terminal TUI (Ink/React) instead of a web dashboard; it does not implement hive-mind consensus protocols; and it is multi-adapter (claude/codex/opencode/cursor/shell) rather than claude-only. The /orch Claude Code skill that lets users type natural language is an inversion of claude-flow's pattern — ORCH is controlled through Claude rather than separately from it. Compared to taskmaster-ai (single-agent task decomposition via JSON), ORCH operates multiple simultaneous agents in parallel and has a state machine with explicit review gates. The 26 injected Markdown skills resemble superpowers' skill-pack pattern but are injected at agent dispatch time rather than via CLAUDE.md.

Distinctive Positioning

  1. Three binary aliases: orch, orchestry, ao — unusual commitment to CLI ergonomics
  2. Layered DDD architecture: Explicit domain/application/infrastructure/CLI separation with two DI container tiers (LightContainer for reads, Container for full orchestration) — the most formally architected project in this batch
  3. Scope Drift Detection in /review skill: The pre-landing review skill explicitly checks for both over-delivery (scope creep) and under-delivery (missing requirements) before code quality — a novel quality-gate pattern
  4. orch serve --once for CI: First-class CI integration with JSON structured logging and exit codes
  5. 1954 passing tests: The README badge claim suggests unusually high test coverage for a framework in this category
  6. Pre-built org templates: orch org deploy startup-mvp deploys a 5-agent team in one command

Observable Failure Modes

  • YAML file contention: Atomic writes prevent corruption, but many concurrent agents could create write pressure on the state directory
  • No distributed execution: All agents run on the same machine; no remote agent dispatch
  • Skill injection is all-or-nothing: Skills are injected based on agent config, not task context — a code-writing agent always gets the same skills regardless of the specific task
  • Review gate is manual by default: Unless --review-criteria is set, tasks stay in review until a human approves — no automated review completion
  • TUI OOM risk: Despite safeguards, very high-frequency agent event streams can still cause performance degradation
04

Workflow

ORCH — Workflow

Phases

Phase Command Artifact
1. Initialize orch init .orchestry/ directory
2. Deploy Team orch org deploy startup-mvp --goal "..." Agent YAML files, Goal YAML
3. Task Decomposition CTO agent decomposes goal Task YAML files with dependencies
4. Run Agents orch run --all --watch Run JSON + JSONL event logs
5. Review QA/Reviewer agents complete, tasks → review status Review task YAML
6. Approve orch task approve <id> Task status → done
7. Merge Manual (no auto-merge) PRs reviewed and merged by human

Orchestrator Tick Loop (3 phases per tick)

  1. Reconcile: Check PIDs, detect stalls, handle zombie processes
  2. Dispatch: Claim idle agents, launch adapter processes (with skill injection)
  3. Collect: Process completed runs, update stats, transition tasks via state machine

The tick loop runs a stateMutex (promise-chain mutex) for serializing state mutations.

Task State Machine

todo → in_progress → review → done
         ↓                    ↑
      retrying ───────────────┘
         ↓
       failed → (cancelled)

All transitions validated by canTransition(). Terminal statuses: done, failed, cancelled.

Agent Dispatch with Skills

When an agent is dispatched to a task:

  1. SkillLoader reads the agent's skills field list
  2. Matches skill names to files in skills/library/
  3. Injects Markdown content into agent prompts
  4. MCP skill names (e.g., testing-suite:generate-tests) passed directly to Claude CLI

Approval Gates

Gate Trigger Action
Task review Agent completes task → review status Human runs orch task approve <id> or orch task reject <id> [-r reason]
CI serve --once All tasks reach terminal status Process exits (code 1 if any failed)

Headless Serve Mode (CI/CD)

orch serve --once --log-format json --log-file orchestration.log
  • Processes all todo tasks
  • Exits when all reach terminal status
  • Exit code 1 if any failed
  • Structured JSON logs to stdout + optional file

Review Criteria Auto-Validation

Tasks can have --review-criteria test_pass,typecheck,lint — the adapter automatically runs these checks before transitioning to review status.

06

Memory Context

ORCH — Memory & Context

State Storage

All state in .orchestry/ — flat files only, no database server:

Task/Agent/Goal/Team State (YAML)

  • Individual YAML file per entity
  • Atomic writes via atomicWrite() (temp file + rename)
  • Parallel reads via Promise.all() for performance

Run Logs (JSONL)

  • JSON metadata per run
  • Append-only JSONL event stream per run
  • readJsonlTail() reads last N lines without loading full file (OOM protection)

Orchestrator State (JSON)

  • Single state.json file
  • Serialized writes via stateMutex (promise-chain mutex)

Memory Type

file-based — YAML + JSON + JSONL flat files. No SQLite, no vector store, no graph database.

Memory Persistence

Project-scope.orchestry/ is committed to the project repository, persisting across sessions and machines.

Context Injection

Two mechanisms:

  1. Skill injection: SkillLoader reads agent's skills field, injects Markdown content into prompts at dispatch time. Process-lifetime in-memory cache, path traversal prevention.
  2. Message context: orch msg commands let agents exchange context messages stored in .orchestry/context/ and .orchestry/messages/

Cross-Session Handoff

Full — all state persists in .orchestry/ files. A new session picks up where the last left off: tasks in review status remain in review, agents' run history is in JSONL logs.

Context Compaction

Not explicitly handled by ORCH — delegated to the underlying agent CLI's native compaction mechanisms. ORCH does not hook into agent context compaction events.

TUI OOM Protection

The Ink/React TUI uses a batched message queue (80ms flush interval) and caps detail strings at 2KB. RunId maps have an LRU cap of 500 to prevent memory bloat from high-frequency event streams.

07

Orchestration

ORCH — Orchestration

Multi-Agent Pattern

Hierarchical — the CTO agent (or a configured goal-decomposer) breaks goals into tasks; worker agents (Backend A, Backend B, QA, Reviewer) execute tasks in parallel; the Reviewer agent post-processes completed work. The orchestrator tick loop manages all of this automatically.

Orchestrator Tick Loop

Three phases per tick, protected by stateMutex:

  1. Reconcile: Check running PIDs, detect stalled processes, handle zombies, retry failed tasks (up to max-attempts)
  2. Dispatch: For each todo task with available agent: claim agent, inject skills, launch adapter subprocess, record PID
  3. Collect: For each completed PID: read JSONL output, update task status via state machine, emit stats

Agent Adapters

All implement IAgentAdapter:

execute(params) → { pid, events: AsyncGenerator<AgentEvent> }

Adapters: claude | opencode | codex | cursor | shell

Workspace Isolation

Task-level:

  • shared — all agents work in the same directory (collision risk, fast)
  • worktree — each agent gets a separate git worktree (clean isolation, slower setup)
  • isolated — fully isolated workspace

Multi-Model

Yes — different agents in the same team can use different adapters (and thus different models). Example from README:

CTO (claude)       → Decomposing goal
Backend A (claude) → Implementation
Backend B (codex)  → Parallel implementation  
QA (codex)         → Testing
Reviewer (claude)  → Review

No formal model_role_mapping config — model choice is embedded in agent configuration YAML (adapter field).

Execution Mode

Background-daemon for orch serve; interactive-loop for TUI (orch with no args); one-shot for orch serve --once.

ACP / WebSocket

Not applicable (ORCH is a Node.js local process manager, no external protocol server).

Dependency Management

Tasks support --depends-on <id1,id2> — dependent tasks only become in_progress when all dependencies reach done.

Max Concurrent Agents

Configurable per team definition. Default: all idle agents can run simultaneously.

Crash Recovery

Yes — the reconcile phase detects dead PIDs and can retry tasks (up to max-attempts). YAML state files survive process crashes.

08

Ui Cli Surface

ORCH — UI & CLI Surface

CLI Binary: orch / orchestry / ao

Three aliases for the same binary (./dist/cli.js):

  • orch — primary name
  • orchestry — original internal name
  • ao — short alias

Built on Commander.js with 16 subcommands. Supports --json flag for machine-readable output.

TUI Dashboard (Ink/React)

orch with no arguments (or orch tui) launches the full terminal TUI:

  • Real-time agent status and task list
  • Run progress with token counts
  • Task lifecycle visualization
  • Goal/team overview
  • Agent output streaming
  • Batched message queue (80ms flush interval, 2KB cap per detail string)
  • LRU cap of 500 RunId entries (OOM protection)

Built with Ink + React — runs in any terminal.

Headless Serve Mode

orch serve --once --log-format json|text --log-file <path>
  • Structured JSON logs to stdout (default) or human-readable text
  • --once processes all todo tasks and exits
  • Exit code 1 if any tasks failed
  • Designed for CI/CD pipelines

Claude Code Skill (/orch)

The skills/orch/SKILL.md is auto-discovered by Claude Code. Type /orch <natural language> and Claude translates the request into orch CLI commands and executes them. This makes ORCH self-bootstrapping in the Claude Code environment — no need to memorize CLI flags.

Observability

  • JSONL run logs: Every agent run produces an append-only JSONL event log in .orchestry/runs/
  • orch logs [--follow]: Stream run logs in real-time
  • orch status: Orchestrator overview (task counts, agent states, goal progress)
  • TUI: Live dashboard for interactive sessions
  • --log-file in serve mode: Append logs to file alongside stdout
  • OOM safeguards: readJsonlTail() reads only last N lines to prevent memory exhaustion on large logs

Related frameworks

same archetype · same primary tool · same memory type

Symphony (OpenAI) ★ 25k

A language-agnostic specification and Elixir reference daemon that continuously polls Linear and dispatches isolated Codex…

cli-agent-orchestrator (awslabs) ★ 634

tmux-based supervisor-worker orchestration across 7 AI coding CLIs, with MCP coordination primitives, persistent memory,…

Agent Orchestrator (ComposioHQ)
Continuous Claude ★ 3.8k

Compound learning across Claude Code sessions via PostgreSQL memory extraction from thinking blocks, YAML handoffs for session…

Flokay (Codagent Agent Skills) ★ 26

Full SDLC skill pack from idea evaluation through CI-green PR, with TDD Iron Law enforcement and external validator quality gates.

Superpowers ★ 207k

Enforces spec-first, TDD, and subagent-reviewed development as mandatory automatic workflows rather than optional practices.