Use OpenAI Codex CLI to implement, refactor, test, and review code from the terminal. Trigger when the user asks to code with Codex, run Codex on a repo, automate coding tasks via Codex CLI, or orchestrate iterative coding sessions.
Use this skill to run Codex CLI as the coding engine.
codex installed and available in PATH.codex --version
git rev-parse --is-inside-work-tree
If not in a repo:
mkdir -p /tmp/codex-scratch && cd /tmp/codex-scratch && git init
# with OpenClaw exec tool: pty=true, set workdir to project
# IMPORTANT: Use --sandbox workspace-write to allow file modifications
codex exec --sandbox workspace-write "Add input validation to the signup endpoint and update tests."
# Use --sandbox workspace-write for write access
codex exec --sandbox workspace-write "Implement feature X with tests, then summarize changed files and remaining risks."
Use process monitoring to read logs and intervene only if needed.
Use this template when dispatching Codex:
Context: <project + goal>
Constraints:
- Keep changes minimal and targeted
- Preserve existing style
- Update/add tests for modified behavior
- Run relevant checks before finishing
Deliverables:
- Summary of edits by file
- Commands run and results
- Remaining risks / TODOs
references/codex-readme.md