Codex Review vs Adversarial Review: Understanding the Difference Between `/codex review` and `/codex adversarial-review`
Both /codex review and /codex adversarial-review are read-only slash commands that invoke the same shared plugin runtime in the openai/codex-plugin-cc repository, but the standard review checks for implementation defects while the adversarial review challenges design assumptions and trade-offs with an optional focus parameter.
Understanding the difference between Codex review and adversarial review endpoints is essential for selecting the right automated code analysis approach. While both commands execute through identical runtime mechanics and file-handling logic in the openai/codex-plugin-cc codebase, they differ fundamentally in intent, prompt framing, and input flexibility. This guide examines the under-the-hood implementation details that distinguish these two review modes.
Shared Runtime Architecture
Both commands operate as review-only slash commands that run through the shared plugin runtime. They utilize identical mechanics for selecting the review target—whether the working-tree, a branch diff, or an explicit --base reference—and follow the same execution-mode logic for foreground versus background processing.
According to the source code in plugins/codex/commands/review.md and plugins/codex/commands/adversarial-review.md, both endpoints enforce the same constraints: they perform no patching or fixing operations and return verbatim output from the Codex model. When neither --wait nor --background flags are supplied, both commands execute a "size-estimate → ask user" flow, where the plugin estimates diff size and recommends either waiting for results or running in a background task.
Key Differences in Purpose and Implementation
Review Intent and Framing
The standard /codex review command performs a straightforward code review targeting implementation defects, style issues, and bugs. It maintains a neutral framing—simply instructing the model to "run a review"—using the prompt template defined in plugins/codex/prompts/stop-review-gate.md.
In contrast, /codex adversarial-review actively challenges the overall design, implementation approach, trade-offs, and assumptions. This command uses the prompt template in plugins/codex/prompts/adversarial-review.md to explicitly frame the review as a challenge to the current approach, encouraging the model to surface design-level concerns rather than just localized bugs.
Focus Text Support
A critical functional difference is the focus text parameter. The standard review command does not accept extra free-form focus arguments. The adversarial review command, however, accepts an optional focus … argument that allows users to direct scrutiny toward specific concerns.
For example, trailing words like performance security become the focus argument, directing the adversarial review to scrutinize those specific aspects. This functionality is parsed in the command definition at plugins/codex/commands/adversarial-review.md.
Command Flags and Execution Hooks
Both commands support identical base flags: --wait, --background, --base <ref>, and --scope auto|working-tree|branch. However, the adversarial review additionally accepts the optional focus text after these flags.
Under the hood, the implementation diverges in the companion script invocation:
- Standard review calls:
node …/codex-companion.mjs review "$ARGUMENTS" - Adversarial review calls:
node …/codex-companion.mjs adversarial-review "$ARGUMENTS"
Both invocations target the shared runtime script at plugins/codex/scripts/codex-companion.mjs, but pass different command identifiers that trigger distinct prompt templates.
Practical Usage Examples
The following examples demonstrate the syntax differences and execution modes for both endpoints.
Run a standard review immediately in the foreground:
/codex review --wait
Run an adversarial review against the main branch with foreground execution:
/codex adversarial-review --wait --base main
Launch a standard review with automatic background detection (the plugin estimates diff size and recommends execution mode):
/codex review
Execute an adversarial review focused on specific concerns:
/codex adversarial-review --scope branch --base develop performance security
In the adversarial example, the trailing words performance security serve as the focus argument, restricting the adversarial analysis to those specific domains.
Source Code Structure
The differentiation between these endpoints is maintained across several key files in the openai/codex-plugin-cc repository:
plugins/codex/commands/review.md: Defines the standard review command logic and execution flow.plugins/codex/commands/adversarial-review.md: Defines the adversarial review command, including focus text parsing.plugins/codex/scripts/codex-companion.mjs: The shared runtime entry point invoked by both commands.plugins/codex/prompts/adversarial-review.md: Contains the prompt template that establishes the adversarial "challenge" tone.plugins/codex/prompts/stop-review-gate.md: Contains the prompt template for standard review framing.
Summary
- Both
/codex reviewand/codex adversarial-revieware read-only commands that share the same target selection, execution mode logic, and runtime constraints inopenai/codex-plugin-cc. - The standard review provides neutral, implementation-focused analysis for bugs and style issues.
- The adversarial review challenges design assumptions and trade-offs using a distinct prompt template.
- Only the adversarial review accepts optional focus text to target specific concerns like performance or security.
- Both commands invoke
codex-companion.mjsbut pass different command identifiers (reviewvsadversarial-review). - When executed without
--waitor--background, both use a size-estimation heuristic to recommend the appropriate execution mode.
Frequently Asked Questions
Can I use focus text with the standard /codex review command?
No. The standard review command defined in plugins/codex/commands/review.md does not accept extra free-form focus arguments. Only the adversarial review command supports trailing focus text to direct the model's attention toward specific concerns.
Do both commands modify code or create patches?
No. Both commands are strictly review-only operations that enforce no patching or fixing constraints. They return verbatim output from the Codex model without altering the underlying codebase.
Which command should I use for detecting security vulnerabilities?
Use /codex adversarial-review with a focus text argument specifying "security". While the standard review checks for implementation defects, the adversarial review's challenge framing and focus parameter make it better suited for scrutinizing security assumptions and trade-offs in the design.
How does the plugin decide between foreground and background execution?
If you omit both --wait and --background flags, the plugin estimates the diff size and presents two options: "Wait for results" or "Run in background", marking the recommended choice based on the estimated workload. This logic applies identically to both review commands according to the source implementation.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →