codex-review-loop
Skill323 starsChanged 8 days agoMITView on GitHub
When running as Claude Code in JETLS, have Codex review your work at implementation milestones and iterate on its findings. Use after finishing a coherent unit of a multi-step change (and its tests pass), before reporting a non-trivial change as complete, or when the user asks for a Codex review. Skip for trivial edits.
11 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- aviatesk/JET.jledited, first seen Nov 30, 2026
- upamune/skillstheir own version, first seen Nov 15, 2026
- SmartCarrion/codex-review-looptheir own version, first seen Nov 8, 2026
- crissmoldovan/agent-skillstheir own version, first seen Nov 1, 2026
- markoblogo/abvx-agent-skillstheir own version, first seen Nov 1, 2026
- pawaca/dsh-edgetheir own version, first seen Oct 11, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- aviatesk/JET.jl★ 88482% same
Wrote their own version · 10
- Soju06/codex-lb★ 3.5ksame name
- pawaca/dsh-edge★ 30same name
- markoblogo/abvx-agent-skills★ 16same name
- choi138/toki★ 9same name
- yamadashy/skills★ 7same name
- TimBroddin/skills★ 6same name
- crissmoldovan/agent-skills★ 2same name
- upamune/skills★ 1same name
- nimiusrd/agent-skills★ 0same name
- SmartCarrion/codex-review-loop★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 9 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Before reporting a non-trivial change as complete.
- Distinctive: line 25
When the user asks for it.
- Distinctive: line 41
Do not edit files while a Codex run is in progress.
- Distinctive: line 42
No git write operations as part of this loop.
- Very specific: line 48
If a run prints WORKTREE CHANGED, Codex modified the worktree.
- Distinctive: line 64
Run in the foreground with the Bash tool's maximum timeout (600000 ms).
- Distinctive: line 86
Keep the printed session id.
- Distinctive: line 99
No style nits unless they matter.
- Distinctive: line 113
If the run hits the timeout, the review scope was too large: narrow it to fewer files and run once more, keeping track of the files left …
- Distinctive: line 158
Ask Codex to verify the fixes, reconsider the rejections, and answer with the same output contract.
- Very specific: line 161
Stop when Codex returns VERDICT: LGTM, when the remaining findings are only ones you rejected with solid reasons or deferred, or at the …
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codex review loop
Get an independent review from Codex (OpenAI's coding agent CLI), judge its findings yourself, fix what is valid, and let the same Codex session re-check until it approves or the round limit is hit.
Extra review focus from the user, if any: $ARGUMENTS
When to run
- At milestones: a coherent unit of the task is done and its relevant tests and self diagnostics pass. Not after every edit.
- Before reporting a non-trivial change as complete.
- When the user asks for it.
Rules
- Codex must not modify the git worktree and should avoid writing files
elsewhere too. Writes that the commands it needs to run cannot avoid, such
as
juliaupdating~/.julia/compiled, are acceptable. - Codex can be wrong. Verify every finding against the code before acting on it. Reject findings that are incorrect or conflict with the user's instructions or project rules, and say why.
- Codex tends to flag edge cases that are possible only in theory. Judge each
finding by the criteria of the
reviewskill, and accept an edge case only after confirming that its triggering input is realistic by those criteria and actually reaches the code in question. Reject findings whose input is not realistic instead of complicating the implementation for them. - Do not edit files while a Codex run is in progress.
- No git write operations as part of this loop.
- At most 3 rounds per milestone. If Codex and you still disagree after that, stop and leave the decision to the user.
- A run counts as a completed review only if it exits with 0 and the first
line of its output is a
VERDICT:line. Ifcodexis not found, fails, or gives no verdict, stop and tell the user instead of working around it. - If a run prints
WORKTREE CHANGED, Codex modified the worktree. Stop and tell the user; do not revert anything yourself.
Sandbox
Outside Claude Code's sandbox, Codex runs in its own read-only sandbox
(-s read-only). Inside Claude Code's sandbox, which sets SANDBOX_RUNTIME,
Codex cannot create one, because the operating system does not nest
sandboxes. There, run Codex with --dangerously-bypass-approvals-and-sandbox
so that Claude Code's sandbox confines it instead. Codex then needs write
access to ~/.codex and network access to OpenAI; if it fails under the
sandbox, stop and tell the user what was denied. The commands below choose
the mode and check that the worktree did not change during the run.
Round 1
Run in the foreground with the Bash tool's maximum timeout (600000 ms). Pass the prompt on stdin via a heredoc. Stdout is only Codex's final message; the full log goes to a file.
log=$(mktemp "${TMPDIR:-/tmp}/codex-review.XXXXXX") || exit 1
if [ -n "$SANDBOX_RUNTIME" ]; then
mode=(--dangerously-bypass-approvals-and-sandbox)
else
mode=(-s read-only)
fi
fp() { { git status --porcelain=v1 -uall; git diff --binary HEAD; } | git hash-object --stdin; }
before=$(fp)
codex exec "${mode[@]}" - 2> "$log" <<'EOF'
<prompt>
EOF
rc=$?
[ "$(fp)" = "$before" ] || { echo "WORKTREE CHANGED during the Codex run"; rc=99; }
echo "exit=$rc session=$(sed -n 's/^session id: //p' "$log") log=$log"
exit "$rc"Keep the printed session id; later rounds resume that session.
The prompt must be self-contained, since Codex has none of your context.
Codex reads AGENTS.md itself, so do not restate project rules.
- Goal of the overall task and of this milestone.
- What changed in this milestone (files, key functions) and what was verified (tests and self diagnostics run, with results).
- Review target: the uncommitted changes (
git diff HEADand untracked files), or the commits the user asked to review, focusing on this milestone's files; the rest of the diff is context only. - What to look for: correctness bugs, design problems, and missing tests,
following the criteria of the
reviewskill. No style nits unless they matter. Do not modify any files. - Any extra focus from the user.
- This output contract:
First line exactly one of:
VERDICT: LGTM
VERDICT: CHANGES_REQUESTED
Then numbered findings, each as:
<n>. [high|medium|low] <path>:<line> — <problem> — <suggested fix>
Input: <triggering input and why it is realistic> (behavior findings only)
Verified: <how it was reproduced or traced> (behavior findings only)If the run hits the timeout, the review scope was too large: narrow it to fewer files and run once more, keeping track of the files left out. If it times out again, stop and report.
Evaluate and fix
For each finding, decide one of:
- accept: the finding is valid, so fix it.
- reject: the finding is invalid; give a concrete reason.
- defer: the finding is valid but out of scope for this change, e.g. a pre-existing issue whose fix would widen the change. Leave it unfixed and report it to the user.
Fix the accepted ones, then validate as AGENTS.md requires (relevant
tests and self diagnostics). Fix an accepted finding in the current working
tree only when the issue still exists there; if it does not, report it as
confirmed in the reviewed commit but already resolved. For commits outside
the current branch's history, report the findings and ask the user where to
apply fixes before making any.
Round 2 and later
Resume the same session so Codex keeps its context. resume does not
inherit the sandbox mode, so pass it again.
if [ -n "$SANDBOX_RUNTIME" ]; then
mode=(--dangerously-bypass-approvals-and-sandbox)
else
mode=(-c sandbox_mode=read-only)
fi
fp() { { git status --porcelain=v1 -uall; git diff --binary HEAD; } | git hash-object --stdin; }
before=$(fp)
codex exec resume "${mode[@]}" <session-id> - 2>> <log> <<'EOF'
<prompt>
EOF
rc=$?
[ "$(fp)" = "$before" ] || { echo "WORKTREE CHANGED during the Codex run"; rc=99; }
echo "exit=$rc"
exit "$rc"The prompt lists each finding by number with your disposition (fixed and how, rejected and why, or deferred and why) and the validation you ran. Ask Codex to verify the fixes, reconsider the rejections, and answer with the same output contract. Do not repeat the round-1 context.
Stop when Codex returns VERDICT: LGTM, when the remaining findings are
only ones you rejected with solid reasons or deferred, or at the round limit.
Report to the user
Briefly:
- Rounds run and the final verdict.
- The scope the final verdict covers, and any files left unreviewed, e.g. after narrowing the scope on a timeout.
- Findings fixed.
- Findings rejected, with reasons, and any unresolved disagreement.
- Findings deferred, for the user to decide on.
- The Codex session id, so the user can continue it with
codex resume <session-id>.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

