This document covers both review modes: cross-model (Codex) and Claude-only. Both share the same verification loop, gate mechanism, and round limits.
Single-model code review has blind spots. A model reviewing its own output tends to share the same assumptions that produced the code in the first place. Cross-model review addresses this by having Codex independently review the diff while Claude verifies each finding against the actual source. Each model catches things the other misses, producing higher-confidence results than either alone.
The cross-model review (/qq:codex-code-review) runs as an automated loop with up to 5 rounds:
- Claude sends the diff to Codex CLI for review via
code-review.sh - Codex returns findings classified by severity (Critical, Moderate, Suggestion)
- The Review Gate activates -- Edit and Write operations are blocked
- Claude dispatches parallel subagents to verify each finding against the actual source code
- Each subagent performs an over-engineering check: is the proposed fix proportionate to the problem?
- Confirmed critical issues are fixed; over-engineered suggestions get simpler alternatives
- The gate unlocks once ALL verification subagents complete
- The loop repeats until no critical issues remain or 5 rounds are reached
flowchart TD
A["Codex reviews diff"] --> B["Claude verifies each finding"]
B --> C{"Confirmed?"}
C -->|No| D["Discard"]
C -->|Yes| E{"Over-engineered?"}
E -->|Yes| F["Simpler fix"]
E -->|No| G["Apply fix"]
D --> H{"More issues?"}
F --> H
G --> H
H -->|Yes| A
H -->|No| I["Done"]
The review gate is a mechanical constraint that prevents code edits while findings are unverified.
- Gate file:
$QQ_TEMP_DIR/review-gate-$PPID - Format:
<ts>:<completed>:<expected>— timestamp, number of completed verification subagents, total expected - Activation: The PostToolUse hook sets the gate after
code-review.sh,claude-review.sh,plan-review.sh, orclaude-plan-review.shruns - Effect: The PreToolUse hook blocks all Edit and Write operations on
.csandDocs/*.mdfiles - Release: The gate unlocks once ALL verification subagents complete (
completed >= expected), tracked by the PostToolUse Agent hook - Stop hook:
review-gate.sh stopprevents session exit while verification is still incomplete - Isolation: Each session uses
$PPIDto scope its gate file, so concurrent sessions do not interfere
The gate is cleaned up automatically when the review loop ends.
All review commands -- cross-model and Claude-only alike -- classify findings into three tiers:
| Priority | Scope | Action |
|---|---|---|
| P0 | Architecture changes, anti-patterns, lifecycle issues | Must review |
| P1 | Business logic, performance, error handling | Worth reviewing |
| P2 | Getters/setters, logging, config tweaks | Quick scan |
Only P0 (Critical) findings trigger automatic fixes and additional review rounds. P1 findings are fixed at discretion. P2 findings are reported but typically not acted on.
/qq:claude-code-review provides the same review loop using claude-review.sh, which invokes claude -p as a process-isolated reviewer. This is architecturally symmetric with the Codex path: a separate process performs the initial review, then verification subagents check each finding against the actual source. The verification step is structurally identical — parallel subagents verify each finding with the same over-engineering checks — but because the reviewer and verifiers share the same model family, the cross-model blind-spot advantage is reduced. The loop structure, review gate, round limits, and termination conditions are all shared.
The cross-model pattern extends beyond code. Both /qq:codex-plan-review and /qq:claude-plan-review apply the same review-verify-fix loop to design documents and implementation plans instead of code diffs. This catches architectural issues before they reach implementation.
- Codex review (
/qq:codex-code-review,/qq:codex-plan-review): Requires Codex CLI (npm install -g @openai/codex) - Claude review (
/qq:claude-code-review,/qq:claude-plan-review): Requires Claude CLI (claude) - MCP one-shot review:
qq_code_reviewandqq_plan_reviewMCP tools are available for non-Claude hosts (one-shot, no verification loop)
- Hook System -- review gate hooks (PreToolUse, PostToolUse, Stop)
- Architecture Overview -- where review fits in the plugin layers
- Configuration --
policy_profilecontrols review intensity