# Cook Adds Review Loops and Parallel Racing to AI Coding Agents

> Cook adds review loops, parallel racing, and task-list progression on top of AI coding agents like Claude Code, Codex, and OpenCode.

Published: 2026-03-19
URL: https://daniliants.com/insights/cook-workflow-loops-for-claude-code-codex-opencode/
Tags: claude-code, agentic-workflows, code-review, iteration-loops, parallel-agents, multi-agent, developer-tools

---

## Summary

Cook is a composable workflow DSL for AI coding agents (Claude Code, Codex, OpenCode) that adds review loops, sequential passes, parallel racing, and task-list progression on top of single-shot agent calls. It enables multi-pass iteration, quality gates, and branch-and-pick patterns without manual orchestration.

## Key Insight

The key value is in the composition model - three categories of tokens that wrap left to right:

1. **Loop operators** for iteration quality:

- `xN` - run N sequential passes, each seeing previous output (refinement)
- `review` - adds a review-then-gate loop with customizable prompts and max iterations
- `ralph` - outer gate for task-list progression (reads project state, advances through a plan)

1. **Composition operators** for exploring solution space:

- `vN` / `race N` - run N identical cooks in parallel git worktrees
- `vs` - run two different approaches in parallel worktrees
- Resolvers: `pick` (choose winner), `merge` (synthesize), `compare` (write comparison doc)

1. **Per-step agent/model control** - different agents for different steps (e.g., Codex for work, Claude for review), configured via CLI flags or `.cook/config.json`.

The `ralph` pattern is particularly powerful for autonomous task execution: the agent reads a plan file, works on the next task, passes through review, then ralph decides whether to advance or stop. This is a structured version of the "loop until done" pattern that keeps agents on track.

Sandbox modes: agent-native (default, no Docker) or Docker with restricted network. OpenCode only works in Docker mode.