Skip to content

/code_review

Adversarial review of the current branch's diff

Run an adversarial review of the changes on your current branch against the base branch. The reviewer hunts for the ways your code will fail in production.

/code_review
/code_review <focus>

Examples:

/code_review
/code_review security
/code_review concurrency
/code_review error handling
Argument Description
<focus> Free-text focus area, e.g. security, race conditions, error paths
--codex Require Tier 1 (codex CLI). Fails loudly if codex is missing or unauthenticated
--claude Force Tier 2 (Claude subagent) even when codex is available
--xhigh Codex only: use model_reasoning_effort=xhigh (slower, ~23x more tokens)
-m <model> Codex only: pass a specific model through (e.g. -m gpt-5.1-codex-max)

The skill picks a tier from what it finds:

codex available codex missing
default Tier 1 (codex) Tier 2 (Claude subagent)
--codex Tier 1 Stop with install instructions
--claude Tier 2 Tier 2
  • Tier 1 (codex). Runs OpenAI’s Codex CLI in read-only mode for a cross-model second opinion. The skill feeds it the diff between the current branch and the base branch, and codex streams reasoning, tool calls, and the final review.
  • Tier 2 (Claude subagent). Spawns the adversarial-reviewer sub-agent with a fresh context window. Same model family as the caller, but the clean window plus a canonical adversarial persona surface findings the main thread misses.

The first line of the response tells you which tier ran.

  • Read-only. Codex runs with -s read-only; the subagent has no Edit or Write tools. The skill never modifies files.
  • Verbatim output. The skill prints the review body as-is. It never summarizes, truncates, or softens a finding.
  • One pass per invocation. No looping. Re-run with a tighter focus argument if you need another angle.
  • User-only. This command is disable-model-invocation: true; other agents cannot trigger it.
  • Cross-model synthesis. If you ran Claude’s own /review earlier in the conversation and Tier 1 ran, the skill appends a cross-model: block listing overlapping findings, codex-only findings, and claude-only findings.
  • hyprlayer >= 1.5.2. The skill streams codex’s --json output through hyprlayer codex stream, and Step 0 rejects older versions with an upgrade hint.
  • codex CLI (Tier 1 only). Install with npm install -g @openai/codex and authenticate via codex login or $CODEX_API_KEY / $OPENAI_API_KEY. Tier 2 has no external dependencies.

The skill ships parallel Bash (macOS / Linux) and PowerShell (Windows) helper scripts. Claude picks the right invocation from its system context, so you configure nothing per platform. Windows runs codex without the outer timeout 600 wrapper, since codex’s own request timeout enforces the bound. Set the Bash tool’s outer timeout to ~600s for parity.

The skill resolves the base branch in this order:

  1. gh pr view --json baseRefName (if a PR exists for the current branch)
  2. The repo’s default branch via gh repo view
  3. origin/HEAD
  4. main if origin/main exists, else master

If there is no diff against the resolved base, the command stops with nothing to review.