Cook CLI: Orchestrate Claude Code, Codex, and OpenAI Like a Pro
If you are using Claude Code, Codex, or OpenCode for coding tasks, you are probably running them one prompt at a time. That is like using a power tool without any attachments—functional, but missing half the potential.
Cook is a free, open-source CLI tool that wraps your AI coding agents with powerful workflow primitives. Run multiple agents in parallel, add review gates, iterate on results, and compose complex automation pipelines—all from a simple command line.
What Cook Actually Does
Cook parses three types of tokens: work (the prompt), loop operators (iteration), and composition (parallel execution). You combine them into commands that do surprisingly complex things:
The Primitives That Matter
1. Repeat (xN)
Run the same work N times sequentially. Each pass sees the previous output, so the agent can build on its own work. This is perfect for iterative improvements:
2. Review Gate
After the work is done, a reviewer checks quality and a gate decides DONE or ITERATE. On ITERATE, it runs an "iterate" step, then repeats. You can customize prompts:
This is huge. It means your AI agent can self-correct until it meets your standards—no manual hand-holding required.
3. Versions (vN)
Run N identical cooks in parallel using isolated git worktrees, then pick the best result. This is essentially automated A/B testing for code:
4. VS (Comparison)
Run two different approaches in parallel, then pick the winner or merge results:
Why This Matters for Indie Hackers
As an indie hacker, you probably do not have a team of developers reviewing your code. Cook gives you:
- Automated quality gates — no more shipping broken code
- Parallel experimentation — test multiple approaches in the time it takes one to run
- Task automation — let agents work through a plan.md file autonomously
- Agent flexibility — mix and match Claude, Codex, and OpenCode in the same workflow
Getting Started
Installation is a two-step process:
Then run cook init in your project to scaffold the config files:
COOK.md— project instructions and agent prompt template.cook/config.json— agent/model/sandbox defaults.cook/Dockerfile— project dependencies for Docker sandbox mode.cook/logs/— session logs (gitignored)
The Bottom Line
Cook transforms your AI coding agent from a fancy autocomplete into a workflow engine. You can now build systems that:
- Generate multiple solutions and pick the best one
- Self-review and iterate until code passes your standards
- Run complex multi-step projects with minimal supervision
The best part? It is free and open source. No API keys, no subscriptions, just a CLI tool that makes your existing AI agents dramatically more powerful.
Want More AI-Powered Building Tips?
I share weekly insights on building with AI, automation tools, and indie hacking strategies. Check out my other guides on the blog, or reach out if you want to collaborate.