# Cook (Orchestration CLI) Cook is an open-source CLI for **orchestrating AI coding agents**, built by Robert Corwin (rjcorwin). The headline pitch: stop manually copy-pasting prompts to drive multi-step Claude Code / Codex / OpenCode workflows, and instead express the workflow as a composable token expression that Cook executes for you. > A simple CLI for orchestrating [[Claude Code]], [[OpenAI Codex|Codex]], and [[OpenCode]]. The category is **agent orchestration**, not agent execution. Cook does not include a model; it drives external [[AI Agent Harness|harnesses]] in isolated [[Git Worktree|git worktrees]], with quality gates, parallel races, and review loops as first-class primitives. ## Core Abstraction Three primitive types compose into workflows: - **Work** ; an individual agent invocation - **Loop operators** ; iteration patterns: `xN` (run N times), `review` (iterate until reviewer passes), `ralph` (task-list progression gate) - **Composition** ; parallel branches with resolvers: `vN` (race N versions), `vs` (head-to-head), `pick` (select best), `merge` (combine outputs) This token language is the differentiator vs `make`, `npm scripts`, `just`, or shell loops, which have no notion of "race three agents and pick the winner" or "iterate until a reviewer agent approves." ## Key Capabilities - **Review loops with auto-iteration** until a quality gate passes - **Parallel agent racing** with winner selection - **Head-to-head comparisons** between competing implementation strategies - **Task-list progression** via the `ralph` gate (named after [[Ralph TUI|Ralphmania]]-style flows) - **Sandboxing**: [[Docker]] mode and agent-native sandboxes - **Rate-limit resilience** with automatic retry - **Per-step agent / model configuration** ; mix Sonnet for plans, Haiku for fan-out, Opus for adjudication ## Configuration & Files `cook init` scaffolds: - `COOK.md` ; the workflow definition - `.cook/config.json` ; agent defaults, sandbox modes, Docker networking, retry strategy - `Dockerfile` ; sandbox image A workflow lives in `COOK.md` as a token expression; running `cook run` executes it against the configured harnesses. ## Installation ```bash npm install -g @let-it-cook/cli cook init cook run ``` [[Claude Code]] integration ships as a `/cook` slash command, so you can invoke things like `/cook race 3 implementations with review, pick the best` from inside a Claude session. ## Where It Fits - **vs raw [[Claude Code]] / [[OpenAI Codex|Codex]]**: those are great for single interactive sessions; Cook turns repeated workflows into one declarative artifact - **vs `make` / shell loops / Python `subprocess`**: those have no concept of "agent," "review," or "race"; you can fake it but you'll rebuild Cook badly - **vs [[OpenClaw Sub-Agents|OpenClaw sub-agents]]**: OpenClaw orchestrates *inside* its gateway with messaging context; Cook orchestrates *outside* harnesses as a build-tool replacement - **vs Ralphmania, Ossature, Dagu.sh**: same neighborhood; Cook's review/race/pick primitives feel more polished per HN consensus - **vs [[Crabbox]]**: Crabbox provides the *machine* the agent runs on; Cook provides the *workflow* the agent runs ## Trade-offs - **Trust trade-off**: races and reviewer loops defer judgment to the model. Operator review still matters - **Cost discipline**: parallel agent racing burns N× tokens per pass ; rate-limit/retry helps but doesn't change the bill ## References - Documentation: https://rjcorwin.github.io/cook/ - GitHub: https://github.com/rjcorwin/cook - npm: https://www.npmjs.com/package/@let-it-cook/cli - Hacker News discussion: https://news.ycombinator.com/item?id=47434024 ## Related - [[Claude Code]] - [[OpenAI Codex]] - [[OpenCode]] - [[Aider]] - [[Ralph TUI]] - [[AI Agent Harness]] - [[OpenClaw Sub-Agents]] - [[Crabbox]] - [[Docker]] - [[Git Worktree]] - [[Cook AI Agent]] — unrelated tool by a different author with the same name