codex-review
Based on hamelsmu/claude-review-loop. Rewritten with parallel Codex
reviews, self-review, file-scoped reviews, knowledge compounding, and AI anti-pattern detection.
A Claude Code plugin that adds automated review loops to your workflow. Every task gets independent reviews from multiple
parallel Codex agents, and every review compounds knowledge back into the codebase.
Why this fork
The original plugin reviews all uncommitted changes as a single diff. That works well for solo work on small repos, but
breaks down in a large monorepo where multiple agents work in the same branch simultaneously — each agent's review picks up
noise from everyone else's changes, and the reviewer has no module-level context.
This fork scopes every review to the files that a particular agent actually touched. A PostToolUse hook tracks each
Edit/Write operation per session, so when the stop hook fires, Codex only sees that agent's changes — not the entire diff. On
top of that, we auto-derive a dependency map for the touched modules (via codebase-map) and inject it into the review
prompt, giving each reviewer structural context for the code it's looking at.
The result: several agents can work in parallel on different parts of a monorepo, each getting a focused, context-rich review
of only their own work.
What it does
Always-on (every session)
- PostToolUse checks: code→comment replacement detection,
_param lazy refactoring detection
- Auto-format on save: runs project formatter (prettier/biome/eslint/ruff/gofmt/rustfmt) after every Edit/Write
- Self-review: randomized questions from 4 focus areas on every stop (implementation completeness, code quality,
integration, codebase consistency)
On-demand (/review-parallel)
Run N parallel Codex reviews on uncommitted changes — no review loop needed. 4 specialized agents (diff, holistic, security,
tests) review independently and produce a combined report.
Pre-implementation (/review-plan)
Run N parallel Codex agents in read-only mode against the existing codebase, given a plan/spec as input. 4 agents
assess risks, challenge complexity, and find corner cases before any code is written.
/review-plan docs/tasks/my-feature.md
Full loop (/review-loop)
Three-phase lifecycle:
- Task phase: Claude implements your task
- Review phase: Stop hook runs N parallel Codex reviews (+ lint/typecheck), Claude addresses feedback
- Compound phase: Claude extracts reusable knowledge, updates nearest AGENTS.md, logs learnings
Fork additions
Parallel Codex reviews (N separate processes)
Each review category runs as an independent codex exec review process. Dramatically more thorough than single-agent review
— tested at 330KB/21 findings across 4 agents vs 2.2KB from single agent.
Fallback: REVIEW_LOOP_SINGLE_AGENT=true for single process.
Self-review hook (from ClaudeKit)
Always-on Stop hook that forces Claude to self-review before stopping. Randomized questions from 4 focus areas avoid pattern
fatigue. Skips when codex-review loop is active (Codex handles it instead).
File-scoped reviews (parallel agent safe)
A PostToolUse hook tracks every file modified by Edit/Write tools during the session. When the Stop hook fires, Codex only
reviews files THIS agent changed — not the entire repo.
Multiple agents can work in parallel on different modules, each getting a review scoped to its own changes.
Project convention injection
Reads AGENTS.md or CLAUDE.md from repo root and injects project conventions into each Codex review prompt.
Auto-scoped dependency map
If codebase-map is installed, auto-derives impacted modules from changed files
and injects a focused dependency graph. Monorepo-agnostic — detects apps/, services/, packages/ boundaries.
Real-time anti-pattern checks
PostToolUse hooks fire on every Edit:
- Code→comment replacement — blocks replacing code with
// removed comments
- Unused parameter prefixing — blocks
param → _param lazy refactoring
AI anti-pattern detection (in Codex review)
The diff review agent checks for: mocks/stubs to pass tests, hardcoded values that should use constants, code bolted on
without integrating, over-engineered error handling, duplicate utility functions, unnecessary type assertions, feature flags
where direct replacement fits.
Parallel quality checks
Lint and typecheck run in parallel with Codex review — zero wasted time. Auto-detects: biome/eslint for JS/TS, ruff for
Python, tsc for typechecking.
Knowledge compounding
After addressing findings, Claude extracts reusable knowledge: routes lore to nearest AGENTS.md (Least Common Ancestor), logs
session learnings to progress.txt.
Review coverage
N parallel Codex processes, one per review category: