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. Designed as a true second opinion: the reviewer’s job is to find ways the code will fail in production, not to compliment what works.

/code_review
/code_review <focus>

Examples:

/code_review
/code_review security
/code_review concurrency
/code_review error handling
ArgumentDescription
<focus>Free-text focus area, e.g. security, race conditions, error paths
--codexRequire Tier 1 (codex CLI). Fails loudly if codex is missing or unauthenticated
--claudeForce Tier 2 (Claude subagent) even when codex is available
--xhighCodex 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 automatically based on what’s available:

codex availablecodex missing
defaultTier 1 (codex)Tier 2 (Claude subagent)
--codexTier 1Stop with install instructions
--claudeTier 2Tier 2
  • Tier 1 — codex. Runs OpenAI’s Codex CLI in read-only mode for a true cross-model second opinion. The diff between the current branch and the base branch is the input; 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 review body is presented as-is — no summarizing, truncating, or softening of findings.
  • 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, so older versions are rejected at Step 0 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 no per-platform configuration is needed. Windows runs codex without the outer timeout 600 wrapper — the inner request timeout in codex itself enforces the bound — so 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.