Recipes / Dev & code
Multi-agentWorkflowDev & code

Split work: Claude Code reasons, Codex executes

A backend developer on 20+ microservices routes reasoning-heavy debugging to Claude Code and repetitive, parallel work (tests, docs, edits) to Codex, with a task-state log between them.

From Sam Lai on DEV Community · Mar 2026

Setup time10 min
CostTwo subscriptions
RunsPer task
NeedsClaude Code, Codex
Last updated2026-10-17

What the source did

  • Gave both tools the same exception, code and logs for a legacy production bug; Claude Code traced the root cause.
  • Had Codex run tests across modules while the fix wrapped up.
  • Kept separate CLAUDE.md and AGENTS.md, plus a CHANGES.log recording status, files, remaining work and next step.
“Claude Code handles understanding. Codex handles execution.”— Sam Lai, DEV Community

Summary written by Agent Cookbook from the original post. See the original for the full context. How we source recipes

Our notes

What it takes
Claude Code for understanding (tracing a root cause through business logic) and Codex for execution (tests, docs, repetitive edits, running tests across modules). CLAUDE.md for Claude Code, AGENTS.md for Codex, CHANGES.log as shared task state, and heavier models only when he's genuinely stuck.
Where it breaks
Random files and vague instructions make both tools generic, so he keeps input tight: the interface, the key logs, the exception. At peak hours Claude Code sometimes slows down or drops mid-task, and switching to Codex without a CHANGES.log entry means re-explaining everything.
Human checkpoint
When the two give different answers, he compares the reasoning and makes the call himself.
Tools involved
Claude Code, Codex

✓ Verified Source link checked and still live. Notes by Thomas, editor. How we verify

Copy the prompt

Ours Our version, based on what Sam Lai described. Not their wording. Fill in the [BRACKETS].

ROUTER (decide per task): - Reasoning-heavy (root cause, business logic, change boundary) -> Claude Code - Mechanical / parallel (tests, docs, repetitive edits, follow-ups) -> Codex - Might switch mid-task -> write state to CHANGES.log first CLAUDE CODE: Here are the exception, the logs and [FILES]. Trace the call chain and explain why it fails in this scenario. Propose the smallest fix and list follow-up work as bullet tasks in CHANGES.log. CODEX: Read the latest CHANGES.log entry. Implement the listed follow-ups and add tests for [MODULES]. Run them and append Status, Files modified and Tests results.

Approval rule

🛡
You make the final call when the two agents disagree; neither pushes to shared branches.

Set it up

  1. Write the router rules at the top of CHANGES.log.
  2. Start reasoning tasks in Claude Code with tight context: the exception, key logs, the interface.
  3. Hand mechanical follow-ups to Codex via the log.
  4. When answers differ, compare reasoning yourself before choosing.

Common failures

⚠
  • Dumping whole folders as context makes both tools generic. Keep inputs tight.
  • Using the heaviest model for routine work slows everything down.

Variations

  • Reverse roles for a week and compare.
  • Add a third pass: one agent reviews the other's diff.

Get the 10 best agent setups. Free.

Plus new recipes every week. One email, no spam.

Unsubscribe anytime. Privacy

Related recipes

Same job: Dev & code

In these guides: Claude Code vs Codex →

Read original ↗