Codex CLI¶
Wrap Codex CLI with ait so each session
runs in an isolated Git worktree with full provenance.
Why wrap Codex with ait¶
- Codex changes are confined to an attempt worktree — your root checkout is untouched until you promote.
- Failed sessions remain available for inspection, not silently dropped.
- Successive Codex runs feed
ait's repo-local memory, so the next session can recall what was already tried.
Setup¶
ait init # detects `codex` on PATH, auto-installs hook + wrapper
ait adapter doctor codex # optional sanity check
ait init writes .codex/hooks.json and the bridge under
.ait/adapters/codex/ automatically when codex is on $PATH. Use
ait adapter setup codex to re-run the install explicitly.
Run Codex under ait¶
Direct invocation works after setup:
Or wrap explicitly with intent:
Repair and refresh¶
If the wrapper drifts (e.g. after upgrading Codex):