Codex
Codex CLI sessions start with your project's brief and save as you go.
In Codex CLI, every session starts with the brief, and your work is saved when a turn ends, before a
compaction and when the session closes. Type $gw to resume or save.
npx groundwork-ai init --adapter codex # or: npx groundwork-ai adapter add codexThen open Codex in the project, run /hooks, and trust Groundwork's hooks. Codex skips a project
hook until you have reviewed it, and asks again when one changes.
What happens when
| When | Hook | What happens |
|---|---|---|
| A session starts, resumes, is cleared, compacted or forked | SessionStart | The brief goes into the session |
| A turn ends | Stop | A checkpoint. If the handoff is behind, Codex continues with a reminder to save, once per commit |
| Before a compaction | PreCompact | A checkpoint only. The summary is not told what to keep |
| The session ends | SessionEnd | A last checkpoint |
You type $gw | Skill | Resume from memory, or save. /skills lists it too |
These hooks never block your work. If hooks are untrusted or switched off, AGENTS.md still tells
the agent to run brief first and to save with checkpoint.
Files it writes
| Path | What it is |
|---|---|
.codex/hooks.json | The hooks. Merged into your file, never replaced |
.agents/skills/gw/SKILL.md | The $gw command |
Codex reads AGENTS.md itself. On Windows, start Codex in the project root.
With the optional flow on
init --flow or flow on adds:
| Added | What it does |
|---|---|
gw-approve, gw-reject skills | Explicit invocation only (allow_implicit_invocation: false) |
.codex/agents/gw-*.toml | Tester, implementer and reviewer agents |
PreToolUse guard | Runs the commit gate, protects Groundwork's own files, and runs your guards for Bash and apply_patch |
What Codex does not enforce:
| Gap | What it means |
|---|---|
| The guard is not fail-closed | A guard that can't start lets the call through |
| Other tools aren't guarded | MCP tools and hosted tools such as web search are not checked |
| Approvals aren't bound to your message | The commit gate checks the card and its evidence. It can't tell that a human approved |
| The reviewer isn't read-only | That rule is an instruction. Codex has no per-agent read-only setting |
| Hooks can be switched off | Project config can disable them. The guard refuses the agent's edits to .codex/ config, for calls it sees |
init --flow and flow on print this list.
Status
Built from Codex's documentation, read on 2026-11-15. Not yet run inside a live Codex session. Treat
your first session as the test, then run npx groundwork-ai doctor.