A Claude Code plugin that sends your implementation plans to GPT for iterative review. It loops — reviewing, fixing, and resubmitting — until only minor issues remain.
/review-plan [path-to-plan]
- Finds your plan — checks the argument, then session plan, then
~/.claude/plans/, then*plan*.mdin your working directory - Detects the project root — resolves upward from the plan or session cwd looking for
.git,package.json,go.mod, etc. - Runs a preflight check — globs a few file paths from the plan to verify the codebase matches
- Sends to GPT via Codex — delegates to
mcp__codex__codexwith the plan-reviewer system prompt - Parses the JSON review — extracts verdict, issues (with severity/category), open questions, and summary counts
- Presents formatted results — renders a clean markdown template with severity table, issues, and recommendations
- Fixes the plan — edits the plan file directly to address all CRITICAL, HIGH, and MEDIUM issues
- Loops — resubmits via
mcp__codex__codex-reply(session resume) until the verdict is ACCEPTABLE - Final report — summary of iterations, issues fixed, remaining items, and open questions
- Session resume — Iteration 1 uses a fresh Codex call; iteration 2+ resumes the thread via
codex-reply, preserving reviewer context and reducing redundant work - Automatic fallback — If session resume fails, falls back to a fresh call with full parameters
- Codebase verification — When the project root is confidently detected, GPT verifies file paths, function signatures, and interfaces the plan references (criterion 11)
- JSON output — The reviewer returns structured JSON, parsed into user-facing markdown templates. Malformed JSON triggers one automatic retry before failing gracefully
- All-severity fixes — Fixes CRITICAL, HIGH, and MEDIUM issues every iteration, not just the top severity. This minimizes unnecessary loop iterations
- No iteration cap — Loops until clean. Pauses at 8 iterations to ask if you want to continue
plugins/plan-review-loop/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest (v2.0.0)
├── commands/
│ └── review-plan.md # Orchestrator — the full review loop logic
└── prompts/
└── plan-reviewer.md # GPT system prompt — review criteria + JSON output format
.claude-plugin/
└── marketplace.json # Marketplace listing (v2.0.0)
User ──▶ /review-plan ──▶ Find plan ──▶ Detect project root ──▶ Preflight check
│
┌────────────────────────────────────────────┘
▼
Verification gate
(enabled/disabled)
│
▼
┌──▶ Send to GPT (Codex) ──▶ Parse JSON ──▶ Present template
│ │
│ ┌────────┴────────┐
│ ACCEPTABLE REVISE
│ │ │
│ Final report Edit plan file
│ │
└──────────────────────────────────────────────────────────┘
| Iteration | Method | Parameters |
|---|---|---|
| 1 | mcp__codex__codex |
prompt + developer-instructions + sandbox + cwd |
| 2+ (active) | mcp__codex__codex-reply |
threadId + follow-up prompt |
| 2+ (fallback) | mcp__codex__codex |
full params (same as iteration 1) |
The threadId is extracted from the Codex tool result envelope after iteration 1. If codex-reply errors, the loop falls back to a fresh call and attempts to establish a new session.
Controlled by a gate that checks three conditions:
enabled = cwdConfident || preflightHitCount >= 2 || preflightHasUniqueDeepHit
When enabled, the reviewer (criterion 11) verifies:
- File paths exist in the codebase
- Function signatures and exports match what the plan assumes
- Named symbols are searchable
When disabled, the reviewer skips all codebase checks and does a plan-only review.
- Internal consistency
- Bugs & logic errors
- Completeness
- Side effects & schema changes
- Import & load-time safety
- Blast radius control
- Improvements
- Open questions
- Security & privacy
- Dependencies & ordering
- Codebase verification (only when enabled)
- REVISE — any CRITICAL or HIGH issues, or more than 4 MEDIUM/LOW
- ACCEPTABLE — zero CRITICAL/HIGH and at most 4 MEDIUM/LOW
- Claude Code CLI
- OpenAI Codex CLI with MCP server running — provides
mcp__codex__codexandmcp__codex__codex-replytools
claude plugin install sheeki03/plan-review-loop# Review the plan from your current session
/review-plan
# Review a specific plan file
/review-plan ./plans/migration-plan.md
# Typical workflow
/plan Build a caching layer for the API # write the plan
/review-plan # review and fix iterativelyMIT