Codex CLI vs Claude Code: 7 Real Tasks, Same Repo, 31 Days Later
Same monorepo. Same 7 tickets. 31 days. Codex CLI on one side, Claude Code on the other. Only 4 tickets finished cleanly on either agent, and the failures did not overlap the way I expected. The totals below are a rounding error. The split by task type is what actually decides which agent I hand a ticket to on a Wednesday afternoon.
I already have a longer piece on ChatGPT Codex vs Claude Code as products that covers the pricing ladders and the philosophy. This one is narrower and grimier: two CLI agents, seven real tickets from iris-hub, a spreadsheet, and a running tally of “which one made me want to close my laptop.” If you want the abstract framing, read that one first. If you want to know which agent I would hand a specific ticket to on a Wednesday afternoon, read this one.
One clarification: “Codex CLI” here means the current codex binary (v0.147.0, August 2026), not the deprecated codex exec --full-auto flow. OpenAI removed --full-auto and rerouted the same behavior through --sandbox workspace-write. If your muscle memory still types the old flag, the CLI will tell you.
The setup, so you can call BS
I picked 7 tickets from iris-hub that were already backlogged, tagged, and small enough to close in an afternoon each. The categories:
- Refactor — pull a 300-line function apart into three files, keep the tests green
- Test-gen — write missing unit tests for a
pinchtabwrapper module - Bug fix — a real Playwright flake I had ignored for a week
- Migration — swap a homegrown YAML loader for
pyyamlacross 14 call sites - PR review — audit an open PR that touched auth-adjacent code
- Doc sync — regenerate the
--helpblock in the README from the CLI itself - Green-field script — a one-off Notion → Zenn scraper, ~120 lines
For each ticket, I opened two branches: codex/<slug> and claude/<slug>. Each agent got the same prompt, the same AGENTS.md / CLAUDE.md file, the same permissions. I timed everything with hyperfine-esque discipline until the sixth day, and then like a normal person after that.
Same me driving both. Same coffee, same fatigue curve, same tendency to say “just merge it” at 5pm on Friday. If the answers below feel harsh on one side, remember I was rooting for both to win.
The scoreboard

| Task | Codex CLI | Claude Code | Winner |
|---|---|---|---|
| Refactor (3-file split) | Landed, but broke 2 tests I had to fix | Landed clean, tests green | Claude Code |
| Test-gen (wrapper) | 41 tests generated, 6 tautologies | 28 tests generated, 1 tautology | Claude Code |
| Bug fix (Playwright flake) | Guessed at retries, missed root cause | Traced to a race condition and patched | Claude Code |
| Migration (14 call sites) | Finished in 11 min, 100% clean diff | 18 min, one call site missed | Codex CLI |
| PR review (auth touch) | Long structured review, 2 real finds | Terser, 3 real finds, 0 false positives | Claude Code |
Doc sync (--help block) | One-shot, correct | Two rounds, correct | Codex CLI |
| Green-field script | Working script in one round | Working script in one round | Tie |
Add it up if you want: Claude Code 4, Codex CLI 2, tie 1. That number is misleading on its own; you can invert it by swapping two of my tickets for two others, and I would not fight you if you did. What matters is the shape of the win column. Claude Code kept winning where the agent had to hesitate: reviews, bug hunts, refactors where a wrong turn multiplies. Codex CLI kept winning where hesitation only adds latency: mechanical migrations and one-shot generations.
Where Claude Code refused to lose
Two ticket types stand out: the bug fix and the PR review. Both had the same shape — a small surface area, a plausible-but-wrong first hypothesis, and a correct fix hiding one level deeper.
On the Playwright flake, Codex CLI walked in, added retries and a longer waitForSelector, ran the test twice, saw green, opened the PR. That masks the problem instead of fixing it. Claude Code opened the test, read the fixture, noticed that two page.goto calls were racing against a shared cookie jar, and split them. The PR was three lines and the flake stopped. When I re-ran the “fix” from Codex CLI later that week, the flake came back at a lower rate. The refactored test from Claude Code has been green for 21 days.
The PR review was worse. Codex CLI’s review was long — headings, subheadings, code blocks — and correctly flagged two real issues. It also flagged four things that were fine, and I spent 20 minutes explaining to myself why they were fine. Claude Code’s review was terse, flagged three real issues, and did not flag anything I had to defend. The verified-finding rate mirrors what Anthropic’s own numbers claim for the Claude GitHub Action, and it lines up with the multi-agent review pattern I’ve been chewing on for months — the “verifier” step is doing real work, not just reading like it is.
This is the boring pattern the benchmarks miss. Terminal-Bench 2.0 rewards decisive throughput. Review work rewards a tool that stays quiet when it does not have a real answer.
Where Codex CLI refused to lose
The migration ticket was where I gave up defending my priors. 14 call sites, one YAML loader swap. Codex CLI finished in 11 minutes with a clean diff — one commit, no dead imports, no leftover shims. Claude Code took 18 minutes and missed one call site that was inside a try/except ImportError block. Not a subtle miss, but a real one. The other four call sites in the same file were rewritten correctly.
The --help block was the same story on a smaller scale. Codex CLI shelled into the CLI, captured the output, dropped it into the README between the fences, done. Claude Code wanted to reason about what the --help block should look like, and rewrote a few option descriptions before I asked it to just paste what the tool prints. Two rounds instead of one.
Neither of these is a benchmark story. They are time stories. When the ticket has no interesting decisions in it, Codex CLI closes it 30-50% faster than Claude Code, and the diff is cleaner because there is less “let me think about this” in the way. I run enough migrations and doc-regens in a month that this adds up.
The category I got wrong on paper
I had test-gen down as a Codex CLI category before I started. Faster model, more throughput, more tests, right?
Sort of. Codex CLI did generate more tests — 41 vs 28. Six of them were tautologies of the form “assert that mock returns mock.” Claude Code generated 28 tests, 1 tautology, and covered two edge cases I had not thought of (empty-string keys, cookie-jar timeout on 429). After I stripped the tautologies from the Codex CLI branch and added the missing edge cases by hand, the two branches had the same coverage delta on the module.
This isn’t a story about better tests. It’s about which metric your CI actually counts. If it counts tests, Codex CLI wins. If it counts coverage of behaviors you cared about, they tied, and Claude Code got there with less pruning.
Cost, briefly, because you will ask
Over 31 days, Codex CLI cost me roughly $58 in API calls (I’m on the pay-as-you-go path, not Codex Pro). Claude Code cost me nothing on top of the $100 Max 5x I was already paying for. If I priced Claude Code by its share of my Max spend, call it $30 for this experiment.
That isn’t a fair comparison. Codex Pro at $200/month would flatten the API line to zero for me too. But it is the shape my wallet actually saw. Neither agent is expensive enough on its own to change the answer. The real question is which one you have on retainer.
What I actually do now
- Refactors that touch behavior, PR reviews, and bug hunts: Claude Code. The pattern-matching on “this looks fine but is not” is where the hesitation pays off.
- Migrations, doc-regens, one-shot generation, anything mechanical I can queue and walk away from: Codex CLI. The lack of hesitation is a feature when there is nothing worth hesitating about.
- Green-field spikes: whichever one I opened first. They are indistinguishable at that size.
- CI-adjacent workflows: Claude Code Action for PR review, Codex for scheduled maintenance PRs. No overlap.
I run both. I stopped running experiments to pick a winner around day 18, when I noticed I was reaching for one over the other without checking the leaderboard first. If you are still on one, the next step is to install the other for a week and see which tickets stop hurting.
The broader agent framing I keep coming back to is that these are less “tools you rank” and more harnesses you configure to your workload. The tickets on your board are not all the same shape, so a single agent will always be wrong for some of them.
If you want the full playbook for turning Claude Code into a reliable teammate (CLAUDE.md patterns, Plan Mode, hooks, and the team-workflow bits that only show up after a year of daily use), that lives in Practical Claude Code.
Related book Practical Claude Code The field guide for engineers who use Claude Code every day — CLAUDE.md, Plan Mode, and team workflows from a year of real production use View the book page → Was this article helpful?