Codex + OpenClaw
Use Codex CLI as the coding engine from OpenClaw.
Prerequisites
- •
codexavailable in PATH - •authenticated Codex CLI session
- •run inside a git repo
- •when invoked through OpenClaw tools, prefer PTY execution
Quick checks
bash
codex --version git rev-parse --is-inside-work-tree
If not in repo:
bash
mkdir -p /tmp/codex-scratch && cd /tmp/codex-scratch && git init
Recommended execution patterns
One-shot edit
bash
codex exec "Implement <feature>, add tests, run checks, and summarize changes."
Long task (background pattern)
bash
codex exec "Build <feature> in small commits, run tests, then provide a concise report."
Use process logs to monitor progress and intervene only when needed.
Prompt template
text
Context: <project + goal> Constraints: - keep changes minimal and targeted - preserve style and architecture - add/update tests for behavior changes - run relevant checks before finishing Deliverables: - changed files with rationale - commands run + outcomes - remaining risks / TODOs
Quality guardrails
- •Prefer iterative changes over broad rewrites.
- •Never claim completion without command/test output.
- •If blocked by missing env/secrets/tools, stop and report exact blocker.
References
- •
references/codex-openclaw-notes.md - •Codex docs: https://developers.openai.com/codex
- •OpenClaw docs: https://docs.openclaw.ai