| name | codex-review |
|---|---|
| description | Run Codex to review a plan file and return structured feedback with a verdict. Triggers on: debate loop Codex review rounds. Returns VERDICT:APPROVED or VERDICT:NEEDS_CHANGES plus CODEX_SESSION token. |
| context | fork |
| allowed-tools | Bash |
Call Codex to review an implementation plan and return structured feedback with an approval verdict.
Activated once per debate round in the /plan-with-codex command, before Claude revision. The orchestrator calls this skill to get Codex's assessment of the current plan.
The scripts/ directory is relative to this skill's base directory (shown above as "Base directory for this skill").
bash <base_directory>/scripts/run_codex_review.sh \
--plan-file <path> \
--feedback-file <path> \
--revisions-file <path> \
--round <N> \
--codex-model <model> \
[--session-id <thread_id>] \
[--log-id <uuid>]| Argument | Required | Default | Description |
|---|---|---|---|
--plan-file |
Yes | -- | Absolute path to the plan file Codex should review |
--feedback-file |
Yes | -- | Path where full feedback text will be written |
--revisions-file |
No | -- | Path to Claude's revision summary (accepted/rejected findings). If present and round > 1, Codex reads it for context. |
--round |
No | 1 | Current debate round (affects review prompt intro) |
--codex-model |
No | gpt-5.4 | Codex model to use |
--session-id |
No | -- | Thread ID from a previous round for session resume |
--log-id |
No | auto-generated | UUID for the persistent log file. Pass the same ID across rounds to append to one log. |
The script prints structured tokens to stdout. Parse these to control the debate loop.
All stdout responses include three tokens: a verdict (or failure indicator), CODEX_SESSION, and LOG_ID. The raw Codex JSON stream is appended to ~/.closedloop-ai/plan-with-codex/<uuid>.jsonl. Pass the LOG_ID back via --log-id on subsequent rounds to keep all rounds in one log file.
VERDICT:APPROVED
CODEX_SESSION:abc-123-def
LOG_ID:550e8400-e29b-41d4-a716-446655440000
Action: Announce approval. Clean up sidecar files. Stop the debate loop.
VERDICT:NEEDS_CHANGES
CODEX_SESSION:abc-123-def
LOG_ID:550e8400-e29b-41d4-a716-446655440000
Action: Read the feedback file for full details. Pass to plan-agent for revision.
CODEX_FAILED:<reason>
CODEX_SESSION:abc-123-def
LOG_ID:550e8400-e29b-41d4-a716-446655440000
Action: Announce the failure reason. Ask the user to retry or abort. Do NOT increment the round counter.
CODEX_EMPTY
CODEX_SESSION:abc-123-def
LOG_ID:550e8400-e29b-41d4-a716-446655440000
Action: Announce empty response. Ask the user to retry or abort. Do NOT increment the round counter.
- Builds a review prompt asking Codex to analyze the plan for technical soundness, missing steps, architectural issues, security/performance risks, and unclear descriptions
- If
--session-idis provided, attemptscodex exec resumefor context continuity; falls back to a fresh session if resume fails - Parses the Codex JSON stream for
thread.started(thread ID) anditem.completed/agent_message(feedback text) - If session resume succeeds but no new
thread.startedevent appears, the input session ID is preserved and re-emitted (prevents losing session continuity) - Writes full feedback text to
--feedback-file; emits only machine-parseable tokens to stdout