Can you automate a second AI model reviewing the first one's work?
Last updated 2026-08-18 · Confidence: documented — both vendors’ current CLI docs; the sandboxed-subprocess caveat is inferred.
Yes: both agents are shell commands, so either can invoke the other — tell Codex to run Claude Code on every draft, and write that rule into AGENTS.md so it holds without re-prompting.
Both agents run as one-shot shell commands
Section titled “Both agents run as one-shot shell commands”Claude Code has a non-interactive mode: claude -p "<prompt>" reads stdin, prints the answer, and exits — its own docs show a review pattern, piping git diff into claude -p "you are a typo linter…". Codex has the equivalent in codex exec "<task>", which streams the final message to stdout. Since each is just a command, an agent that can run shell commands can call the other and read its verdict — the loop works in either direction.
Making the review non-optional
Section titled “Making the review non-optional”Codex reads AGENTS.md automatically at session start, global (~/.codex) and per-repo files merged. A standing rule there — “before returning any document, run claude -p 'review this draft' on it and incorporate the comments” — applies to every session in that scope. Alejo recommends this Codex→Claude Code loop as feasible, and more generally suggests naming a couple of candidate solution paths when asking an AI to solve a tooling problem like this one.
Setup costs and sandbox friction
Section titled “Setup costs and sandbox friction”- Claude Code installs with one command (
curl -fsSL https://claude.ai/install.sh | bash, or npm) — Codex can run it, though the install needs network and writes outside the workspace, which Codex’s sandbox gates (see Agent isolation). - It needs its own login: a Pro, Max, Team, Enterprise, or Console account — a ChatGPT subscription doesn’t cover it.
- Codex’s default workspace-write sandbox “asks before using the internet or going beyond the workspace boundary”, and each
claudecall needs the network to reach its API.
Sources
Section titled “Sources”- Run Claude Code programmatically — code.claude.com
- Advanced setup — code.claude.com
- Non-interactive mode — learn.chatgpt.com
- Sandboxing — learn.chatgpt.com
- Custom instructions with AGENTS.md — learn.chatgpt.com