Autonomous review loop for Claude Code.
Codex reviews your code changes or implementation plan → Claude analyzes the feedback → Claude fixes code / revises plan → re-submits to Codex → repeats until approved. You observe the summary; Claude drives the loop.
Existing Codex ↔ Claude integrations are one-shot: Codex reviews, you read the report, you fix manually, you re-run Codex. This manual relay loop is the bottleneck — not the review itself.
codex-feedback-loop closes the loop:
You invoke /codex-feedback-loop
↓
Auto-detect: git diff → Code Mode | plan in context → Plan Mode
↓
Claude captures changes/plan → sends to Codex
↓
Codex returns findings (VERDICT: REVISE)
↓
Claude analyzes each finding:
• Accept → fix the code / revise the plan
• Skip → document why (false positive, project convention, etc.)
↓
Claude re-captures state → re-submits to Codex
↓
Repeat until VERDICT: APPROVED or max 5 rounds
↓
You see: what was fixed/revised, what was skipped, final status
| Feature | codex-feedback-loop | One-shot review tools |
|---|---|---|
| Multi-round iteration | Up to 5 rounds with session persistence | Single pass |
| Dual mode | Auto-detects code vs plan review | Code only or plan only |
| Autonomous fixing | Claude edits source files / revises plans between rounds | Manual fixes required |
| Critical analysis | Claude triages findings (accept/skip with reasoning) | Raw report dump |
| Project-aware | Respects CLAUDE.md / .claude/rules/ conventions | Generic advice |
| Diff-aware | Auto-detects branch vs main, includes uncommitted | Manual scope |
- Claude Code (CLI)
- OpenAI Codex CLI v0.1.0+ (
npm install -g @openai/codex)- Requires:
codex exec,codex exec resume,-s read-only,-o <file>flags
- Requires:
- Authenticated Codex session (
codex login)
# Clone into Claude Code skills directory
git clone https://github.com/Alx-707/codex-feedback-loop.git ~/.claude/skills/codex-feedback-loop
# Or copy manually
cp -r codex-feedback-loop ~/.claude/skills/Restart Claude Code. The /codex-feedback-loop skill will be available.
claude --plugin-dir ./codex-feedback-loop# Auto-detect mode: has diff → code review, no diff → plan review
/codex-feedback-loop
# Force plan review (even if there are code changes)
/codex-feedback-loop plan
# Use a different Codex model
/codex-feedback-loop o4-mini
# Review only specific paths (code mode)
/codex-feedback-loop -- src/lib/ src/app/api/The skill auto-detects what to review:
planargument → Plan Mode (explicit override)git diffhas changes → Code Mode (most common)- No diff, but plan in conversation → Plan Mode
- Neither → Nothing to review
- Capture — Detects your branch, captures
git diffagainst the base branch (+ any uncommitted changes) - Review — Sends the diff to Codex with a structured adversarial review prompt covering 5 perspectives:
- Correctness — Logic errors, edge cases, wrong assumptions
- Security — Input validation, injection, auth, data exposure
- Consistency — Config drift, dead code, stale references
- Performance — N+1, memory leaks, missing cleanup
- Maintainability — Naming, complexity, error handling, test gaps
- Analyze — Claude reads Codex's findings and independently triages each one:
- Accept — Valid issue, will fix
- Skip — False positive, style preference, or contradicts project rules (with documented reason)
- Fix — Claude edits the actual source files using minimal, targeted changes
- Re-submit — Captures the new diff, resumes the Codex session with context of what was fixed
- Repeat — Steps 3-5 loop until
VERDICT: APPROVEDor 5 rounds
- Capture — Extracts the implementation plan from the current conversation context
- Review — Sends the plan to Codex for evaluation on correctness, risks, missing steps, alternatives, and security
- Revise — Claude addresses each issue Codex raised, rewrites the plan
- Re-submit — Resumes the Codex session with the revised plan
- Repeat — Steps 3-4 loop until
VERDICT: APPROVEDor 5 rounds
- Blindly apply all Codex suggestions
- Refactor surrounding code or add unrelated improvements
- Override project conventions defined in CLAUDE.md
- Commit changes — fixes are left unstaged for your review
Rounds 2+ use codex exec resume with the captured session ID, so Codex has full context of prior reviews. If a session expires, Claude falls back to a fresh call with round history in the prompt.
The adversarial review prompt asks Codex to examine changes from 5 angles, with structured output per finding:
- File + line: exact location
- Severity: critical / high / medium / low
- Category: which perspective
- Issue: what's wrong
- Fix: specific suggested fix
Formatting/style issues are explicitly excluded — those belong to linters.
Default: gpt-5.2 with --reasoning-effort high. Override per invocation:
/codex-feedback-loop o4-miniHardcoded at 5 to prevent infinite loops. Edit skills/codex-feedback-loop/SKILL.md to change.
Narrow the review scope:
/codex-feedback-loop -- src/lib/security/ src/app/api/contact/This project builds on ideas from several open-source projects:
-
codex-plan-review by @LuD1161 — The iterative VERDICT loop, session ID management, and
codex exec resumepattern. codex-feedback-loop extends this from plan review to a unified code + plan review with autonomous fixing. -
codex-review by @astomodynamics — Multi-command architecture (
/codex-bugs,/codex-security,/codex-architect), proactive agent patterns, and the delegation skill framework. Informed the structured multi-perspective review prompt. -
claude-codex-review by @pauhu — Adversarial review from multiple viewpoints (security, correctness, compliance, performance, maintainability) and the 5-phase workflow (scope → read → check → merge → report). Shaped the review perspective design.
-
claude-delegator by @jarrodwatts — Expert-level system prompts and the concept of Claude synthesizing (not transparently passing) GPT output. Influenced the triage step where Claude independently evaluates each finding.
None of the above projects implement the autonomous fix loop — where Claude analyzes feedback, edits real source files, and re-submits without human intervention. That's the gap codex-feedback-loop fills. The unified mode detection further simplifies usage: one command, auto-detects whether to review code or a plan.
The review prompt is in skills/codex-feedback-loop/review-prompt.md. Edit this file to:
- Add project-specific review criteria
- Change severity definitions
- Adjust which issues to ignore
codex-feedback-loop/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── skills/
│ └── codex-feedback-loop/
│ ├── SKILL.md # Skill definition (unified code + plan review)
│ └── review-prompt.md # Adversarial review prompt (code mode, customizable)
├── LICENSE # MIT
└── README.md
This is a pure prompt-based plugin — no runtime code, no dependencies, no build step. The logic lives in SKILL.md as structured instructions that Claude Code interprets. The review prompt is separated into review-prompt.md for easy customization.
MIT