How do I use Ward with Codex?
Updated
Run ward integrate codex in your project. Ward writes .codex/hooks.json and .codex/hooks/ward.sh and checks the code Codex writes.
What does the integration install?
| Codex event | What happens |
|---|---|
PreToolUse (Bash, apply_patch) |
With the guard enabled, denies protected changes |
PostToolUse (apply_patch) |
Runs the quality check. Failures exit 2, so Codex gives them to the model |
Stop |
Runs the quality check and spec validation. Findings continue the turn once |
Codex runs project hooks only after you review and trust them with /hooks. Refreshing the integration changes the hooks, so Codex asks again.
Keep ward on your PATH.
What does the agent see when a check fails?
After a patch, failures exit with code 2, and Codex gives them to the model. When the turn ends, findings continue the turn once. If they remain, they are only reported.
How do I install and remove it?
ward integrate codex
ward integrate codex --remove
Generated files carry a Ward ownership marker. Ward refreshes only its own files and reports any file you wrote as a conflict.
Is it tested?
The generated files pass tests against Codex CLI 0.163.0’s documented hook contract. A live run is not recorded yet. Ward is in alpha, so the CLI and the configuration may change before 1.0.
Where do I go next?
Ready to try it? Install Ward and run ward init in your project.