
Cross Model Review
- 14 installs
- 25 repo stars
- Updated July 31, 2026
- hyperb1iss/hyperskills
Has a different AI model review code written by the current model, running the other model's CLI as a subprocess to catch different bug classes.
About
Runs cross-model code review where the authoring model's code is reviewed by a different model with different failure modes. A developer uses it for an unbiased second opinion on code or a PR.
- Identifies host and invokes the other model's CLI as subprocess
- Flags real CLI behaviors (yield_time_ms, -- separator, scope flags)
Cross Model Review by the numbers
- 14 all-time installs (skills.sh)
- +2 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #783 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
- Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hyperb1iss/hyperskills --skill cross-model-reviewAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 14 |
|---|---|
| repo stars | ★ 25 |
| Last updated | July 31, 2026 |
| Repository | hyperb1iss/hyperskills ↗ |
What it does
Has a different AI model review code written by the current model, running the other model's CLI as a subprocess to catch different bug classes.
Files
Cross-Model Code Review
Cross-model validation: the authoring model writes code, a different model reviews it. Different architectures, different training distributions, no self-approval bias.
Core insight: Single-model self-review is systematically biased. The same blind spots that let bugs through during writing let them through during review. Cross-model review catches different bug classes because the reviewer has fundamentally different failure modes.
How to read this skill: patterns and decision trees below are guidelines. Pick what fits, blend when needed. The rules marked ⚠️ are different: they're real CLI behaviors (yield_time_ms, the -- separator, scope flags), not procedural ceremony. Audited sessions show 366+ orphaned claude -p processes per session and ~7 minutes wasted per spiral when ⚠️ rules are skipped. Treat them as facts about the tool, not opinions about workflow.
Direction & Pre-Flight
Identify the host first. The host runs the _other_ model's CLI as a subprocess.
| Current host | You invoke | Direction |
|---|---|---|
| Claude Code | codex CLI | Claude writes → Codex reviews |
| Codex | claude CLI | Codex writes → Claude reviews |
| Pi (pi-nova pack) | /xreview (wraps codex exec) | Pi writes → Codex reviews |
Confirm the reviewer is reachable before the real call:
| Host | Verify command | Notes |
|---|---|---|
| Claude | codex --version | One-shot, no special flags |
| Codex | `printf 'say ok\n' \ | env -u ANTHROPIC_API_KEY claude -p --output-format text --no-session-persistence with yield_time_ms: 30000` |
| Pi | codex --version | Same binary as Claude host |
On Pi: prefer /xreview when the xreview extension is installed — it shells out to codex exec --sandbox read-only with stdin closed and injects Verdict, Findings, and Fix Queue back into the session. Scope explicitly: /xreview reviews the working tree, /xreview main reviews since a base ref; put any focused concern in the prompt before running it. Manual bash fallback follows the Claude-host rules below. Treat PASS as evidence only for the reviewed scope.
User defaults are authoritative. Both CLIs read configured defaults (~/.codex/config.toml, ~/.claude/settings.json). Never specify --model, -m, or -c model=. The only sanctioned override is reasoning effort, and only for spec review (see Effort Override Policy below).
---
⚠️ Codex → Claude: Four Non-Negotiable Rules
Rules 1–3 cause the overwhelming majority of cross-model review failures. They're not workflow preferences; they're how the claude -p shell tool behaves under Codex. Rule 4 doesn't break the review; it silently bills it to the wrong account. Get all four right on the first call.
Rule 1: yield_time_ms: 300000 on EVERY call
Codex's shell tool yields output back to the model after yield_time_ms elapses (default 1000 = 1 second). A real claude -p review takes 30 seconds to 5+ minutes. The default yields empty output + Process running with session ID NNNN before Claude has even started, and the model misreads this as failure.
The rule: every claude -p call uses yield_time_ms: 300000 (5 minutes). Initial call, every reaping call, every sanity ping beyond a one-line say ok. No exceptions.
{ "cmd": "claude -p --allowedTools \"Read,Glob,Grep,Bash(git *)\" -- \"PROMPT\"", "yield_time_ms": 300000 }Common cognitive trap: "My prompt is short, I only need 30s." Wrong. Claude session setup, network, and model compute dominate; prompt length barely factors in. Always 300000.
Consistency rule: once you're at 300000, stay at 300000. Reverting to 1000 between calls in the same session creates a fresh wave of orphans on top of any still running.
Rule 2: Process running with session ID NNNN is NOT an error: REAP, never retry
When Codex returns Process running with session ID NNNN, the process is alive and computing in the background. The yield fired before completion. This is normal output, not failure.
digraph reap {
rankdir=TB;
node [shape=box];
"Initial call" [style=filled, fillcolor="#e8e8ff"];
"Process running ID 84814" [style=filled, fillcolor="#fff8e0"];
"WRONG: re-invoke claude -p" [style=filled, fillcolor="#ffe8e8"];
"RIGHT: reap session_id 84814" [style=filled, fillcolor="#e8ffe8"];
"Process exited code 0" [style=filled, fillcolor="#e8ffe8"];
"New orphan ID 84815" [style=filled, fillcolor="#ffe8e8"];
"Initial call" -> "Process running ID 84814";
"Process running ID 84814" -> "WRONG: re-invoke claude -p" [label="retry"];
"Process running ID 84814" -> "RIGHT: reap session_id 84814" [label="reap"];
"WRONG: re-invoke claude -p" -> "New orphan ID 84815" [label="spawns new process"];
"RIGHT: reap session_id 84814" -> "Process exited code 0" [label="loop until exit"];
}Wrong (each retry spawns a fresh process; original keeps running):
{"cmd": "claude -p --allowedTools '...' -- 'PROMPT'", "yield_time_ms": 300000}
→ "Process running with session ID 84814"
{"cmd": "claude -p --allowedTools '...' -- 'PROMPT'", "yield_time_ms": 300000}
→ "Process running with session ID 84815" // 84814 still alive, orphaned
{"cmd": "claude -p --allowedTools '...' -- 'PROMPT'", "yield_time_ms": 300000}
→ "Process running with session ID 84816" // 84814 + 84815 both still alive
... 8 more retries ... 11+ orphans, ~7 minutes wall timeRight (reap the existing session by ID until exit):
{"cmd": "claude -p --allowedTools '...' -- 'PROMPT'", "yield_time_ms": 300000}
→ "Process running with session ID 84814"
{"session_id": 84814, "yield_time_ms": 300000} // reap, do NOT re-invoke claude -p
→ "Process running with session ID 84814" // still computing
{"session_id": 84814, "yield_time_ms": 300000} // keep reaping
→ "Process exited with code 0" // done, parse the outputReaping rules:
- Do NOT re-invoke
claude -p(creates a new process) - Do NOT change flags, prompts, or tools (reaping is a different operation entirely)
- DO call
{"session_id": NNNN, "yield_time_ms": 300000}repeatedly - Stop only when
Process exited with code Xappears
Rule 3: Variadic flags require the -- separator
The claude CLI has flags that take <value...> and greedily consume every following argument until the next flag. If your prompt follows one of these without a -- separator, the prompt gets swallowed as a flag value, the prompt arg goes missing, and Claude errors with Input must be provided either through stdin or as a prompt argument when using --print or hangs waiting on stdin.
Variadic flags: --allowedTools / --allowed-tools, --disallowedTools / --disallowed-tools, --tools, --add-dir, --betas, --file, --mcp-config, --plugin-dir.
Required form (default to this, works regardless of flag order):
claude -p --allowedTools "Read,Glob,Grep,Bash(git *)" -- "PROMPT"Two fallback shapes (use only if -- won't work in your context):
| Shape | Example |
|---|---|
| Prompt before flags | claude -p "PROMPT" --allowedTools "Read,Bash(git *)" |
| Stdin pipe | `echo "PROMPT" \ |
The codex CLI does not have this issue, its flags are non-variadic.
Rule 4: Strip ANTHROPIC_API_KEY so the review bills to your subscription
Codex — and most shells that touch the Anthropic API — export ANTHROPIC_API_KEY into the environment. Child claude -p calls inherit it, and Claude Code's auth precedence ranks the API key above your Pro/Max subscription OAuth. Interactive claude prompts once before using a stray key and remembers your choice; -p (non-interactive) mode uses the key silently, on every call. The review still works — it just bills per-token against the API instead of drawing from your plan. Nothing surfaces it until the invoice does, which is why interactive sessions can read "Max" in /status while the headless review path quietly meters to API.
The rule: prefix every spawning claude -p call with env -u ANTHROPIC_API_KEY. That strips the variable for just that call, so Claude falls through to the subscription credentials stored by /login.
{
"cmd": "env -u ANTHROPIC_API_KEY claude -p --allowedTools \"Read,Glob,Grep,Bash(git *)\" -- \"PROMPT\"",
"yield_time_ms": 300000
}The prefix goes on the spawning call only — reaping calls (Rule 2) are bare session_id polls with no command, so there is nothing to strip.
Precedence trap: CLAUDE_CODE_OAUTH_TOKEN ranks _below_ ANTHROPIC_API_KEY, so exporting an OAuth token does not rescue you while the key is present — stripping is mandatory either way. The fallback only lands on the plan if a prior interactive /login (Pro/Max) wrote ~/.claude/.credentials.json; without those creds, claude -p has nothing to fall through to.
---
⚠️ Claude → Codex: One Non-Negotiable Rule
Always pass a scope flag to codex review
A bare codex review (no scope) is the #1 cause of Claude → Codex failures: it hangs or produces 100KB+ blob output. Always specify exactly one scope flag:
| Want to review | Command |
|---|---|
| Branch since main | codex review --base main |
| Single commit | codex review --commit <SHA> |
| Working tree (unstaged) | codex review --uncommitted |
For anything outside this trio (spec docs, single files, custom scopes, personas), use codex exec "PROMPT" with explicit scope in the prompt, never bare codex review.
If codex review output exceeds ~100KB, the diff is too large for one pass. Split: codex review --commit <SHA1>, codex review --commit <SHA2>, or use codex exec with a narrowed prompt ("Review error handling only").
---
⚠️ Both Directions: Capture Output to a File
Never pipe a review to | tail -N or | head -N. Three reasons it fails:
1. The pipe buffers until EOF. tail (and head) read the entire upstream stream before producing output. The agent gets _nothing_ until the review process exits or times out, no progress signal, no early verdict, no way to tell if the call is alive. With claude -p, this compounds the yield_time_ms problem: the wrapping shell call holds output until claude exits, then tail finally runs. 2. Reviews don't put the verdict at the end. Findings are typically ordered by severity (BLOCKER first), with the summary/verdict near the top. tail -300 discards exactly the part you need. 3. A file lets a human watch progress live. tail -f /tmp/review.txt in another terminal shows the review streaming in real time, completely independent of the agent's call. The pipe pattern hides everything until exit.
Right pattern: pick a non-colliding filename, redirect to it, then read it back.
# Use mktemp so parallel/repeat reviews don't clobber each other.
# Bake the scope into the slug so the file is self-describing when you tail -f it.
out=$(mktemp -t codex-review-pre-pr.XXXXXX) && echo "$out"
# Claude → Codex
codex review --base main > "$out" 2>&1
codex exec --sandbox read-only "PROMPT" > "$out" 2>&1
# Codex → Claude (yield_time_ms: 300000 + env -u ANTHROPIC_API_KEY still required — Rules 1 & 4)
env -u ANTHROPIC_API_KEY claude -p --allowedTools "Read,Glob,Grep,Bash(git *)" -- "PROMPT" > "$out" 2>&1
git diff main...HEAD | env -u ANTHROPIC_API_KEY claude -p "PROMPT" > "$out" 2>&1If mktemp isn't handy, use a PID + timestamp slug: out=/tmp/codex-review-$$-$(date +%s).txt.
Echo the path before the redirect so the agent (and a human running tail -f) knows where to look. After the command exits, Read (or cat) the file. It persists across turns, re-read instead of re-running.
---
Review Modes Matrix
Match the row to what you're actually reviewing. The current skill historically documented 5 patterns; real usage covers many more.
| Mode | Scope | Claude → Codex | Codex → Claude |
|---|---|---|---|
| Pre-PR full | main...HEAD (all commits on branch) | codex review --base main | `git diff main...HEAD \ |
| Single commit | One SHA | codex review --commit <SHA> | `git show <SHA> \ |
| Commit range | <base>..HEAD (multi-commit slice, not all of main) | codex review --base <base> | `git diff <base>..HEAD \ |
| Branch-vs-branch | feat-a vs feat-b (stacked PRs) | codex review --base feat-a | `git diff feat-a...HEAD \ |
| Staged only | About-to-commit | `git diff --staged \ | codex exec "PROMPT"` |
| Unstaged WIP | Working tree | codex review --uncommitted | `git diff \ |
| Mixed state | Staged + unstaged + untracked | git status; codex exec "Review all current uncommitted work" | `git status; git diff HEAD \ |
| Single file / path | One file or directory | codex exec --sandbox read-only "Review only <path> for ..." | `git diff <path> \ |
| Spec / RFC / design doc | Markdown prose | codex exec -c model_reasoning_effort="xhigh" "Review docs/design/RFC.md ..." | `cat docs/design/RFC.md \ |
| Focused investigation | Custom (security, perf) | codex exec "You are a senior <DOMAIN> engineer. Analyze <CONCERN> ..." | claude -p --allowedTools "Read,Glob,Grep,Bash(git *)" -- "PROMPT" |
| Ralph loop | Implement → review → fix | Repeat any of the above × 3 max | Repeat any of the above × 3 max |
Billing: every claude -p in the Codex → Claude column assumes the env -u ANTHROPIC_API_KEY prefix from Rule 4 — the cells omit it for width. Drop the prefix and the review silently meters to the API instead of your subscription.
Common scope mistakes:
- Using
--base mainwhen you only want one commit (review noise from unrelated commits) → use--commit <SHA> - Using
git diffwhen you meantgit diff --staged→ reviewer sees WIP and produces noisy findings on incomplete code - Using piped diff for architecture review → diff lacks surrounding context; use
--allowedToolstool-access mode instead
---
Sandbox & Permission Flags
Both CLIs scope what the reviewer can read, write, and execute. Default to the most restrictive that does the job.
Codex sandbox modes
codex exec and codex review accept --sandbox <mode>:
| Mode | Read | Write | Network | Use for |
|---|---|---|---|---|
read-only | ✓ | ✗ | ✗ | Pure review (default for review work) |
workspace-write | ✓ | cwd only | ✗ | Review + apply suggested fixes |
danger-full-access | ✓ | ✓ | ✓ | Last resort; explicit user request only |
--full-auto (alias) | n/a | n/a | n/a | --ask-for-approval never --sandbox workspace-write |
--dangerously-bypass-approvals-and-sandbox | n/a | n/a | n/a | Last resort; full bypass |
Codex working-directory and ergonomics flags
| Flag | When |
|---|---|
-C <DIR> / --cd <DIR> | Run in another worktree without cd |
--skip-git-repo-check | Running from a non-repo directory |
--add-dir <DIR> | Extend read access to another path |
--ephemeral | One-shot session, no persistence |
--ignore-user-config | Skip ~/.codex/config.toml (unusual) |
--json / --output-last-message | Capture structured output to a file |
-c model_reasoning_effort="xhigh" | Spec/RFC review only (see Effort Override Policy) |
Claude permission flags (claude -p)
| Flag | When |
|---|---|
--allowedTools "Read,Glob,Grep,Bash(git *)" | Standard read-only review toolset (recommended) |
--add-dir <PATH> | Read access outside cwd |
--no-session-persistence | Sanity pings; one-shot calls |
--output-format text / json | Capture for parsing |
--dangerously-skip-permissions | Last resort; explicit user request only |
The default toolset for Codex → Claude is --allowedTools "Read,Glob,Grep,Bash(git *)". Add Bash(rg:*) if the reviewer needs grep across files. Resist write tools unless the review explicitly applies fixes.
---
Effort Override Policy
Code review defers to user config. Spec review overrides higher.
| What you're reviewing | Codex effort | Claude effort |
|---|---|---|
| Code (commit / diff / PR / WIP) | No flag, defer to ~/.codex/config.toml | No flag, defer to settings |
| Spec / RFC / design doc | -c model_reasoning_effort="xhigh" | max |
Why split: specs are higher-stakes than diffs, a subtle architectural mistake compounds across the eventual implementation. Code diffs are smaller scope and the user's configured effort is fine.
---
Piped Diff vs Tool Access (Codex → Claude)
For Codex-hosted sessions, choose based on depth:
| Approach | Command shape | When |
|---|---|---|
| Piped diff | `git diff ... \ | claude -p "PROMPT"` |
| Tool access | claude -p --allowedTools "Read,Glob,Grep,Bash(git *)" -- "PROMPT" | Architecture/security/cross-file deep-dive. Reviewer can trace data flow across files the diff doesn't show. |
Tool access costs more tokens but catches bugs that need surrounding context (signatures defined elsewhere, downstream consumers, similar patterns). Both shapes take the env -u ANTHROPIC_API_KEY prefix (Rule 4) so the cost lands on your subscription, not the API.
---
Multi-Pass Strategy
Thorough reviews benefit from multiple focused passes rather than one vague pass. Single passes dilute attention and produce shallow findings on each dimension. Each pass gets a specific persona and concern domain.
| Pass | Focus | Approach |
|---|---|---|
| Correctness | Bugs, logic, edge cases, race conditions | Structured review (codex review) or piped diff with general prompt |
| Security | OWASP Top 10:2025, injection, auth, secrets | Focused investigation with security persona |
| Architecture | Coupling, abstractions, API consistency | Tool-access mode for full file context |
| Performance | O(n²), N+1 queries, memory leaks | Focused investigation with performance persona |
| Change size | Strategy |
|---|---|
| < 50 lines, single concern | Single review pass |
| 50-300 lines, feature work | Review + security pass |
| 300+ lines or architecture change | Full 4-pass |
| Security-sensitive (auth, payments, crypto) | Always include security pass |
Run passes sequentially. Fix critical findings between passes to avoid noise compounding. Three review iterations is the practical ceiling; past that, returns diminish and you start re-litigating findings rather than fixing real bugs.
---
Prompt Engineering Heuristics
These apply to both directions; prompts are model-agnostic and reliably improve review signal:
1. Assign a persona. "Senior security engineer" beats "review for security" 2. Specify what to skip. "Skip formatting, naming style, minor docs gaps" prevents bikeshedding 3. Require confidence scores and act only on findings ≥ 0.7 4. Demand file:line citations. Vague findings without location aren't actionable 5. Ask for concrete fixes. "Suggest a specific fix" 6. One domain per pass. Security-only, architecture-only 7. Demand a verdict. "Verdict: patch is correct / incorrect" or "go / no-go"
Ready-to-use prompt templates for security, architecture, performance, error handling, and concurrency are in references/prompts.md.
---
Anti-Patterns
| Anti-Pattern | Why It Fails | Fix |
|---|---|---|
| Self-review (model reviews its own code) | Systematic bias, same blind spots | Cross-model: author and reviewer are different models |
| "Review this code" (no specifics) | Vague → bikeshedding | Domain prompt + persona + structured output |
| Single pass for everything | Context dilution | Multi-pass, one concern per pass |
| No confidence threshold | Noise floods signal | Only act on ≥ 0.7 |
| > 3 review iterations | Diminishing returns | Stop at 3, accept trade-offs |
Hardcoding --model / -m / -c model= | Overrides user config; stale model names | Defer to user config; only model_reasoning_effort for spec review |
claude -p --allowedTools "..." "PROMPT" (no --) | Variadic flag eats prompt → "Input must be provided" or hang | Always -- separator: claude -p --allowedTools "..." -- "PROMPT" |
yield_time_ms: 1000 (or any value < 300000) on claude -p | Yields empty output before claude responds; model treats as failure and retries | yield_time_ms: 300000 on EVERY call, no exceptions |
Reverting yield_time_ms mid-session (300000 → 1000 between calls) | New orphans pile on top of existing ones | Pick 300000 once, keep it for every call |
Re-invoking claude -p after Process running with session ID NNNN | Spawns a parallel claude; original still working | Reap with {"session_id": NNNN, "yield_time_ms": 300000} until exit code |
claude -p from Codex with ANTHROPIC_API_KEY in the env | Key outranks subscription OAuth; -p uses it silently → review bills per-token to the API, not your plan | Prefix the spawning call: env -u ANTHROPIC_API_KEY claude -p ... |
Bare codex review (no scope flag) | Hangs or produces 100KB+ blob output | Always pass --base <ref>, --commit <SHA>, or --uncommitted |
codex review output > 100KB | Diff too large for one pass | Split per commit, or use codex exec with narrower prompt |
timeout 30 codex review or timeout 30 claude -p | Reviews legitimately take 30s–5min | No timeout, or timeout 300 minimum |
| `codex exec "PROMPT" \ | tail -300 or claude -p "PROMPT" \ | tail -300` |
<<'EOF' heredoc when prompt references env vars | Single-quoted heredoc blocks expansion; vars stay literal | Use <<EOF (unquoted) when interpolation is needed |
Trying claude ultrareview first | Many orgs block ("Remote sessions are disabled by your organization's policy") | Local claude -p first; ultrareview is opt-in |
| Style/formatting comments in review | LLMs default to bikeshedding | Always include "Skip: formatting, naming, minor docs" |
| Piped diff for architecture review | Diff lacks surrounding context | Use tool-access mode (--allowedTools) |
MCP wrapper around codex / claude | Unnecessary indirection over a CLI binary | Call the reviewer CLI directly via Bash |
| Reviewing without repo context | Generic advice disconnected from codebase | Run from repo root so project memory + source files are visible |
| Effort override on routine code review | Wastes tokens, ignores user defaults | Spec review only; code review = no effort flag |
---
What This Skill is NOT
- Not a replacement for human review, can't evaluate product direction or UX
- Not a linter, use linters for formatting and style
- Not infallible, 5–15% false positive rate is normal; triage findings
- Not for self-approval, the entire point is cross-model validation
References
For ready-to-use prompt templates (security, architecture, performance, error handling, concurrency), see references/prompts.md.
Cross-Model Review Prompt Templates
Ready-to-use prompts for each review pass. These are model-agnostic — they work with any reviewer CLI.
Usage
Pass prompts as the final argument to the reviewer CLI:
# Claude-hosted session (Codex reviews)
codex exec "PROMPT_TEXT_HERE"
# Codex-hosted session (Claude reviews) — basic
# The `env -u ANTHROPIC_API_KEY` prefix is required: Codex exports the key, and
# `claude -p` would otherwise bill per-token to the API instead of your subscription.
env -u ANTHROPIC_API_KEY claude -p "PROMPT_TEXT_HERE"
# Codex-hosted session (Claude reviews) — with read-only tool access
# The `--` is required: --allowedTools is variadic and will swallow the prompt without it.
env -u ANTHROPIC_API_KEY claude -p --allowedTools "Read,Glob,Grep,Bash(git *)" -- "PROMPT_TEXT_HERE"
# Or pipe a diff into either
git diff main...HEAD | codex exec "PROMPT_TEXT_HERE"
git diff main...HEAD | env -u ANTHROPIC_API_KEY claude -p "PROMPT_TEXT_HERE"For Codex's structured codex review command, prompts aren't needed — it has its own review format.
Claude CLI gotcha: Variadic flags (--allowedTools, --allowed-tools, --disallowedTools, --tools, --add-dir, --betas, --file, --mcp-config, --plugin-dir) greedily consume every following argument until the next flag. Always either put the prompt before the flag, separate it with --, or feed it via stdin.
Codex sandbox gotcha: When Codex is the host, run claude -p with yield_time_ms: 300000. The default 1000ms yield returns empty output and Process running with session ID NNNN while claude is still working — do not retry, reap session_id: NNNN until it exits. See SKILL.md for details.
Billing gotcha: Codex exports ANTHROPIC_API_KEY, which outranks subscription OAuth in Claude Code's auth precedence. In -p mode the key is used silently, so the review bills per-token to the API instead of your Pro/Max plan. Prefix every spawning claude -p call with env -u ANTHROPIC_API_KEY. See SKILL.md Rule 4.
General Review
Best as the first pass. Broad coverage across all dimensions.
Review the changes between main and HEAD with extreme thoroughness. Prioritize:
1. Correctness — logic errors, edge cases, null handling, race conditions
2. Security — injection, auth gaps, secrets exposure, OWASP Top 10:2025
3. Performance — algorithmic complexity, N+1 queries, memory leaks
4. Maintainability — coupling, abstraction leaks, API consistency
For each finding:
- Cite exact file and line range
- Explain the bug/risk concretely (not "this could be improved")
- Suggest a specific fix
- Rate confidence 0.0-1.0
Skip: formatting, naming style, minor documentation gaps.
Overall verdict: "patch is correct" or "patch is incorrect" with justification.Security Deep-Dive
You are a senior application security engineer reviewing a code change.
Analyze the diff between the current branch and main for:
1. Injection vulnerabilities (SQL, XSS, command, LDAP, template)
2. Authentication & authorization flaws
3. Secrets / credential exposure (hardcoded keys, tokens in logs)
4. Insecure deserialization or data handling
5. SSRF, path traversal, open redirects
6. Cryptographic misuse (weak algorithms, improper randomness)
7. Dependency risks (known CVEs, typosquatting)
8. Error handling that leaks internal state
For each finding, provide:
- Severity: critical / high / medium / low
- Attack vector description
- Affected file and line range
- Concrete remediation with code example
- Confidence: 0.0-1.0
If no security issues found, state that explicitly with your confidence level.
Do NOT flag style or non-security concerns.Architecture Review
You are a principal software architect reviewing a code change for design quality.
Evaluate the diff between current branch and main:
1. Does this change respect existing architectural boundaries?
2. Are abstractions at the right level — not too leaky, not over-engineered?
3. Does coupling increase or decrease? Quantify if possible.
4. Is the API surface consistent with existing patterns in the codebase?
5. Does this change make the system harder to test, extend, or maintain?
6. Are there backwards compatibility concerns?
7. Would a different design achieve the same goal more cleanly?
For each concern:
- Reference specific files and patterns
- Explain the architectural principle being violated
- Suggest a concrete alternative approach
- Rate impact: blocks-merge / should-fix / nice-to-have
- Confidence: 0.0-1.0
Skip: implementation details, performance micro-optimizations, style.Performance Review
You are a performance engineer reviewing a code change for efficiency.
Analyze the diff between current branch and main:
1. Algorithmic complexity — is there O(n^2) where O(n) or O(n log n) suffices?
2. Database queries — N+1 patterns, missing indexes, unnecessary JOINs
3. Memory — leaks, unnecessary copies, unbounded growth
4. I/O — blocking calls on hot paths, missing async/streaming
5. Caching — missed opportunities, cache invalidation bugs
6. Bundle/binary size — unnecessary dependencies, tree-shaking failures
7. Concurrency — lock contention, thread-safety, deadlock potential
For each finding:
- Estimated impact magnitude (minor / moderate / severe)
- Affected hot path or user-facing scenario
- Concrete optimization with before/after code
- Whether a benchmark is warranted
- Confidence: 0.0-1.0
Skip: premature optimization, style preferences, sub-millisecond concerns in cold paths.Error Handling Review
You are reviewing a code change specifically for error handling correctness.
Analyze the diff between current branch and main:
1. Are all error paths handled? Check every function that can fail.
2. Do errors propagate correctly to callers? No silent swallowing.
3. Are error messages meaningful to the user/operator?
4. Are resources cleaned up in error paths (connections, file handles, locks)?
5. Are retries safe? Is the operation idempotent?
6. Are error types/codes consistent with the rest of the codebase?
7. Could any error cause cascading failures?
For each finding:
- The specific error path that's mishandled
- What happens when this error occurs (user impact)
- Concrete fix with code
- Confidence: 0.0-1.0Concurrency Review
You are reviewing a code change for concurrency correctness.
Analyze the diff between current branch and main:
1. Shared mutable state — is it properly synchronized?
2. Race conditions — could interleaving produce incorrect results?
3. Deadlock potential — are locks acquired in consistent order?
4. Atomicity — are compound operations atomic when they need to be?
5. Async correctness — are promises/futures properly awaited? Error handled?
6. Thread safety — are data structures safe for concurrent access?
7. Resource lifecycle — are connections/handles properly scoped?
For each finding:
- The specific interleaving or scenario that causes the bug
- Affected file and line range
- Concrete fix
- Confidence: 0.0-1.0
Skip: single-threaded code paths, non-concurrent modules.Custom Template Skeleton
For domain-specific reviews, use this skeleton:
You are a [specific role] reviewing a code change for [specific domain].
Analyze the diff between current branch and main:
1. [Specific check 1]
2. [Specific check 2]
3. [Specific check 3]
...
For each finding:
- [Required output field 1]
- [Required output field 2]
- Affected file and line range
- Concrete fix with code example
- Confidence: 0.0-1.0
Skip: [explicitly list what to ignore].