Use this workflow when a task needs planning, implementation, and validation without mixing every responsibility into one chat.

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
Run this checklist in OpenClaw before handing off to Codex. Incomplete briefs waste cycles — a vague scope passed to Codex produces confident-looking output that solves the wrong problem.

Execution flow

1

Write the brief in OpenClaw

Define outcome, scope, and done criteria. OpenClaw confirms back what it understood before any code is touched.
2

Hand the brief to Codex

Codex inspects the repo, makes edits, runs tests, and returns verification output (test result, diff summary, or lint output).
3

Review output in OpenClaw

OpenClaw checks the verification output against the done criteria. If the check passes, the task closes. If not, the failure gets classified before the next attempt.

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:
The requirement was unclear, missing constraints, or mixed with unrelated goals. Rewrite the brief with narrower scope before retrying.
The implementation is wrong or incomplete. Point to the exact behavior that needs correction rather than restating the original requirement.
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.