~/groundwork

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 codex

Then 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

WhenHookWhat happens
A session starts, resumes, is cleared, compacted or forkedSessionStartThe brief goes into the session
A turn endsStopA checkpoint. If the handoff is behind, Codex continues with a reminder to save, once per commit
Before a compactionPreCompactA checkpoint only. The summary is not told what to keep
The session endsSessionEndA last checkpoint
You type $gwSkillResume 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

PathWhat it is
.codex/hooks.jsonThe hooks. Merged into your file, never replaced
.agents/skills/gw/SKILL.mdThe $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:

AddedWhat it does
gw-approve, gw-reject skillsExplicit invocation only (allow_implicit_invocation: false)
.codex/agents/gw-*.tomlTester, implementer and reviewer agents
PreToolUse guardRuns the commit gate, protects Groundwork's own files, and runs your guards for Bash and apply_patch

What Codex does not enforce:

GapWhat it means
The guard is not fail-closedA guard that can't start lets the call through
Other tools aren't guardedMCP tools and hosted tools such as web search are not checked
Approvals aren't bound to your messageThe commit gate checks the card and its evidence. It can't tell that a human approved
The reviewer isn't read-onlyThat rule is an instruction. Codex has no per-agent read-only setting
Hooks can be switched offProject 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.

On this page