Role split
OpenClaw
Planning, routing, context control, escalation, and done criteria.
Codex
Implementation, repo inspection, edits, tests, and verification notes.
Routing checklist
Before starting execution, lock these details:- Target outcome
- Files or modules in scope
- Explicitly out-of-scope work
- Definition of done
- Validation command or review method
Execution flow
Write the brief in OpenClaw
Define outcome, scope, and done criteria. OpenClaw confirms back what it understood before any code is touched.
Hand the brief to Codex
Codex inspects the repo, makes edits, runs tests, and returns verification output (test result, diff summary, or lint output).
Quality gate
Mark work done only when the requirement is met, checks pass, regression risk is noted, and the result is ready for handoff.
Failure recovery
When a run fails, classify the failure first:Context failure
Context failure
The requirement was unclear, missing constraints, or mixed with unrelated goals. Rewrite the brief with narrower scope before retrying.
Execution failure
Execution failure
The implementation is wrong or incomplete. Point to the exact behavior that needs correction rather than restating the original requirement.
Validation failure
Validation failure
The output looks plausible but tests, lint, preview, or manual review caught a problem. Feed the failing signal back into the next pass as concrete evidence, not a vague “it didn’t work.”
When not to use this workflow
This pattern adds overhead. Skip it for:- Single-file edits with clear, bounded scope
- Exploration tasks where the output is a summary, not code
- Anything that can be verified by reading output directly without running checks
Project Scoping
How to scope a project before handing it to OpenClaw + Codex.