Cook: Why Your AI Agent Needs a Review Loop
**TL;DR:** Cook is a new CLI that adds review loops, parallel racing, and task progression to Claude Code, Codex, and OpenCode. It solves the "one-shot prompt" problem — instead of hoping your agent gets it right the first time, you can now build systematic iteration into every task.
TL;DR: Cook is a new CLI that adds review loops, parallel racing, and task progression to Claude Code, Codex, and OpenCode. It solves the "one-shot prompt" problem — instead of hoping your agent gets it right the first time, you can now build systematic iteration into every task.
The Problem I Hit Every Day
I run an AI assistant 24/7. It writes articles, manages tasks, publishes content. And here's what I learned: single prompts fail.
Not because the models are bad — they're incredible. But complex work needs iteration. A draft needs review. Code needs testing. The gap between "generate once" and "iterate until done" is where most AI workflows break.
Enter Cook.
What Cook Actually Does
Cook wraps your AI agent calls with three primitives:
1. Loop Operators — Run work multiple times
cook "Add dark mode" x3 # 3 sequential passes
cook "Add dark mode" review # review→gate loop until DONE2. Composition — Race parallel approaches
cook "Add dark mode" v3 "least code" # run 3 versions, pick best
cook "Auth with JWT" vs "Auth with sessions" pick "best security"3. Task Progression — Move through a checklist
cook "Work on next task in plan.md" \
ralph 5 "DONE if all tasks complete, else NEXT"The magic is in composition. You can chain these:
cook "Add dark mode" review v3 "cleanest result"
# = race 3 versions, each with its own review loop, pick cleanestWhy This Matters for Always-On Agents
If you've built an agent that runs continuously (like I describe in my AGENTS.md guide), you know the pain:
- **One-shot prompts are fragile** — You can't anticipate every edge case
- **Manual review doesn't scale** — You can't personally check every output
- **Iteration is expensive** — Re-running full prompts wastes tokens
Cook solves all three:
- **Built-in review loops** replace manual checking
- **Racing parallel versions** increases quality without linear cost
- **Task progression** enables autonomous multi-step work
The Architecture That Impressed Me
Cook runs each parallel branch in isolated git worktrees. This means:
- Version A and Version B don't interfere
- You can merge the winner cleanly
- Failed branches are discarded without polluting your repo
The resolver step (pick, merge, or compare) then decides what to keep.
This is exactly how I wish I could run my own agent sometimes — try three approaches, pick the best, move on.
Quick Setup
npm install -g @let-it-cook/cliOr add it as a Claude Code skill:
mkdir -p .claude/skills && \
cp -r $(npm root -g)/@let-it-cook/cli/skill .claude/skills/cookThen initialize your project:
cook init
# Creates COOK.md, .cook/config.json, and logs directoryWhen to Use Cook vs Raw Prompts
| Use Raw Prompts | Use Cook | |-----------------|----------| | Quick questions | Multi-step tasks | | Single file edits | Full feature implementation | | Exploration | Production code | | When you'll review manually | When you want autonomous iteration |
For my daily content workflow, I'd use Cook for the writing→review→publish pipeline. For quick lookups, raw prompts are fine.
The Bigger Picture
Cook joins a growing ecosystem of "AI orchestration" tools:
- **OpenClaw** — always-on assistant infrastructure
- **NemoClaw** — Nvidia's enterprise sandbox for OpenClaw
- **Superpowers** — TDD-driven agent development
- **Cook** — workflow loops for iteration
The pattern is clear: the future isn't better single prompts, it's better workflows around prompts.
We're moving from "ask once, hope for the best" to "design a system that iterates until quality threshold is met."
Try It Today
- Install: `npm install -g @let-it-cook/cli`
- Init: `cook init` in your project
- Run: `cook "Your task" review`
Start with the review loop. Once you see how it catches issues you'd normally fix manually, you'll never go back to one-shot prompting.
Links:
- [GitHub](https://github.com/rjcorwin/cook)
- [Documentation](https://rjcorwin.github.io/cook/)
- [npm](https://www.npmjs.com/package/@let-it-cook/cli)
This is part of my series on building always-on AI systems. Previously: [The Ultimate AGENTS.md Guide](https://ai-insider.io/ultimate-agents-md-guide/) — how I structure the AI assistant that runs my daily operations.