Reconstruct what you changed during this conversation, then delegate the actual review to a single subagent running the code-review skill with a user-specified model.
IMPORTANT: Steps 1-2 run in the current agent (the master). Only Step 3 spawns a subagent.
Workflow
Step 1: Parse the user request
Extract:
- Model: The model ID from user's request. Validate against available models.
- Review instructions: Any text after "Review instructions:" — pass verbatim.
- Change scope: What should be reviewed. Default: all changes in this conversation.
Step 2: Gather context from your own changes
Reconstruct the diff from conversation history:
Compose a unified diff of all changes (Edit, Write, Bash, etc.). Group by file.
- If no changes: Inform user and stop.
Read final state of changed files for surrounding context.
Check related context:
- Test files related to changed files (skip
node_modules, .git, dist, build)
- Config changes that affect behavior
- Related type definitions or interfaces
Do NOT show gathered context to user. Use only for the subagent.
Step 3: Spawn the review subagent
spawn_subagent:
skill: "code-review"
model: <model from user request>
prompt: |
Review the changes below using "code-review" skill.
CONSTRAINTS:
- Read-only review. Do NOT edit files.
- All context is provided below. Read files only if clearly incomplete.
- Review independently and objectively.
## Review Instructions
{user's review instructions, verbatim}
## Changes
{reconstructed diff, grouped by file}
## Additional Context
{links to related files, tests, type definitions, requirements}
Step 4: Relay the result — READ-ONLY, NO ACTIONS
CRITICAL: Output the subagent's review AS-IS. Do NOT:
- Summarize, rephrase, reorder, or filter
- Fix, improve, or refactor based on findings
- Add your own commentary or caveats
One-line model attribution is acceptable. You may offer to implement recommendations, but let the user decide.
Model Mapping
When user says "review with [model name]", map to a valid model ID:
| User says |
Model ID |
| opus, claude opus |
claude-3-opus |
| sonnet, claude sonnet |
claude-3.5-sonnet |
| gpt-4, gpt4 |
gpt-4 |
| gpt-4o |
gpt-4o |
| gemini |
gemini-2.0-flash |
| deepseek |
deepseek-chat |
If the model name is unrecognized, ask for the exact model ID.
Error Handling
- Subagent fails or times out: Inform user. Suggest retry or different model.
- No changes in conversation: Inform user and stop.
- Incomplete review: Relay what was returned. Note it may be incomplete.
- Model not available: Offer alternative from the mapping table.
- User requests unknown model: Map fuzzy names to model IDs using the mapping table. If no match, ask user to provide the exact model ID string.
- Subagent returns malformed output: The review subagent may return text instead of structured findings. Relay what was returned and note the format deviation.
- Diff context exceeds subagent limits: For very large changesets, split the diff by file or module and run multiple sequential subagent reviews. Inform user you are splitting the review.
- Network or infrastructure failure during spawn: Retry once with the same configuration. If it fails again, offer to switch to a different model or perform the review inline.
- Subagent produces factually incorrect findings: Relay findings as-is but append a note that some claims could not be verified against the codebase. Do not filter or censor.
Anti-Patterns
| Pattern |
Problem |
Fix |
| Using cross-review for general PR review |
User did not name a model. cross-review is for explicit model-named delegation only. |
Use the standard code-review skill instead. |
| Summarizing or filtering subagent output |
The user requested an independent review. Any distortion defeats the purpose. |
Relay output verbatim. Add only a 1-line model attribution. |
| Acting on findings without user approval |
The master agent is read-only in this workflow. Fixing issues automatically breaks the delegation contract. |
Offer to implement recommendations but wait for user to decide. |
| Skipping context gathering (Step 2) |
Sending only the diff without file context produces shallow reviews that miss type errors and behavioral changes. |
Always read final file state and related test/config files before spawning the subagent. |
| Delegating to the same model the user is already talking to |
If user says "review with sonnet" and master agent IS sonnet, this is circular. |
Use a different model than the one running the master agent. |
| Requesting review of unchanged code |
cross-review only works on changes made in the current conversation. |
If the user wants PR review from git, use the code-review skill directly. |
Model Comparison Methodology
When to use which model
| Model |
Strengths |
Best for |
| Claude Opus 4 |
Deep reasoning, security analysis, architectural review |
Complex refactors, auth code |
| GPT-5 Codex |
Code generation patterns, syntax accuracy |
Implementation review, template checking |
| Gemini 2.5 Pro |
Multi-modal, context window size |
Large PRs (200+ files), full-repo context |
| DeepSeek V4 |
Fast, cost-effective, strong at bug detection |
Routine PRs, quick checks |
Confidence Scoring
Assign confidence (0.0-1.0) to each finding:
confidence = (models_agreeing / total_models) * evidence_score
evidence_score:
1.0 = exact line + code excerpt proves the bug
0.7 = logic analysis suggests probable issue
0.4 = speculative (pattern matching without code walk)
0.1 = style preference
Findings with confidence < 0.5 should be:
- Marked as "suggestion" not "finding"
- Never block a merge
- Phrased as questions: "Did you consider...?"
Result Merging Strategy
- Group by file + line range (+-5 lines)
- If all 3 models agree: high confidence, use as primary finding
- If 2 of 3 agree: medium confidence, note the dissenting model's view in details
- If 1 of 3: low confidence, verify against code manually before including
- Merge descriptions: take the most specific one, append key insights from others
- Remove duplicates: same finding described differently -> keep clearest description
Handling Conflicts
When models disagree:
- Don't default to majority -- investigate the code yourself
- The dissenting model may have caught something the others missed
- Present both views: "Claude suggests X, Gemini suggests Y"
- Let the human reviewer decide
Checklist
Sources
- MCP Protocol specification (modelcontextprotocol.io) — subprocess agent spawning and message passing
- OpenAI API model list documentation (platform.openai.com/docs/models) — supported model IDs and capabilities
- Anthropic Claude model documentation (docs.anthropic.com/en/docs/about-claude/models) — model IDs and feature comparison
- Google Gemini API model documentation (ai.google.dev/models/gemini) — Gemini model identifiers and rate limits
- DeepSeek API documentation (platform.deepseek.com/api-docs) — model IDs and context window limits
- Conventional Comments specification (conventionalcomments.org) — structured review comment formatting
- "Software Engineering at Google" by Titus Winters, Tom Manshreck, Hyrum Wright (O'Reilly, 2020) — code review best practices at scale
1---2name: cross-review3description: Delegate code review to a subagent running a specific model. Use ONLY when user explicitly names a model to review changes ("review with opus", "use sonnet to review", "review with gemini"). The root agent reconstructs changes from conversation history and spawns a subagent with the code-review skill using the specified model. Do NOT use for general code review (use code-review skill instead), for reviewing PRs from git history, or when no model is specified by the user.4license: MIT5---67Reconstruct what you changed during this conversation, then delegate the actual review to a single subagent running the `code-review` skill with a user-specified model.89IMPORTANT: Steps 1-2 run in the current agent (the master). Only Step 3 spawns a subagent.1011## Workflow1213### Step 1: Parse the user request1415Extract:16- **Model**: The model ID from user's request. Validate against available models.17- **Review instructions**: Any text after "Review instructions:" — pass verbatim.18- **Change scope**: What should be reviewed. Default: all changes in this conversation.1920### Step 2: Gather context from your own changes2122Reconstruct the diff from conversation history:23241. Compose a unified diff of all changes (Edit, Write, Bash, etc.). Group by file.25 - **If no changes**: Inform user and stop.26272. Read final state of changed files for surrounding context.28293. Check related context:30 - Test files related to changed files (skip `node_modules`, `.git`, `dist`, `build`)31 - Config changes that affect behavior32 - Related type definitions or interfaces3334Do NOT show gathered context to user. Use only for the subagent.3536### Step 3: Spawn the review subagent3738```39spawn_subagent:40 skill: "code-review"41 model: <model from user request>42 prompt: |43 Review the changes below using "code-review" skill.4445 CONSTRAINTS:46 - Read-only review. Do NOT edit files.47 - All context is provided below. Read files only if clearly incomplete.48 - Review independently and objectively.4950 ## Review Instructions51 {user's review instructions, verbatim}5253 ## Changes54 {reconstructed diff, grouped by file}5556 ## Additional Context57 {links to related files, tests, type definitions, requirements}58```5960### Step 4: Relay the result — READ-ONLY, NO ACTIONS6162CRITICAL: Output the subagent's review AS-IS. Do NOT:63- Summarize, rephrase, reorder, or filter64- Fix, improve, or refactor based on findings65- Add your own commentary or caveats6667One-line model attribution is acceptable. You may offer to implement recommendations, but let the user decide.6869## Model Mapping7071When user says "review with [model name]", map to a valid model ID:7273| User says | Model ID |74|-----------|----------|75| opus, claude opus | claude-3-opus |76| sonnet, claude sonnet | claude-3.5-sonnet |77| gpt-4, gpt4 | gpt-4 |78| gpt-4o | gpt-4o |79| gemini | gemini-2.0-flash |80| deepseek | deepseek-chat |8182If the model name is unrecognized, ask for the exact model ID.8384## Error Handling8586- **Subagent fails or times out**: Inform user. Suggest retry or different model.87- **No changes in conversation**: Inform user and stop.88- **Incomplete review**: Relay what was returned. Note it may be incomplete.89- **Model not available**: Offer alternative from the mapping table.90- **User requests unknown model**: Map fuzzy names to model IDs using the mapping table. If no match, ask user to provide the exact model ID string.91- **Subagent returns malformed output**: The review subagent may return text instead of structured findings. Relay what was returned and note the format deviation.92- **Diff context exceeds subagent limits**: For very large changesets, split the diff by file or module and run multiple sequential subagent reviews. Inform user you are splitting the review.93- **Network or infrastructure failure during spawn**: Retry once with the same configuration. If it fails again, offer to switch to a different model or perform the review inline.94- **Subagent produces factually incorrect findings**: Relay findings as-is but append a note that some claims could not be verified against the codebase. Do not filter or censor.9596## Anti-Patterns9798| Pattern | Problem | Fix |99|---------|---------|-----|100| Using cross-review for general PR review | User did not name a model. cross-review is for explicit model-named delegation only. | Use the standard `code-review` skill instead. |101| Summarizing or filtering subagent output | The user requested an independent review. Any distortion defeats the purpose. | Relay output verbatim. Add only a 1-line model attribution. |102| Acting on findings without user approval | The master agent is read-only in this workflow. Fixing issues automatically breaks the delegation contract. | Offer to implement recommendations but wait for user to decide. |103| Skipping context gathering (Step 2) | Sending only the diff without file context produces shallow reviews that miss type errors and behavioral changes. | Always read final file state and related test/config files before spawning the subagent. |104| Delegating to the same model the user is already talking to | If user says "review with sonnet" and master agent IS sonnet, this is circular. | Use a different model than the one running the master agent. |105| Requesting review of unchanged code | cross-review only works on changes made in the current conversation. | If the user wants PR review from git, use the `code-review` skill directly. |106107## Model Comparison Methodology108109### When to use which model110111| Model | Strengths | Best for |112|-------|-----------|----------|113| Claude Opus 4 | Deep reasoning, security analysis, architectural review | Complex refactors, auth code |114| GPT-5 Codex | Code generation patterns, syntax accuracy | Implementation review, template checking |115| Gemini 2.5 Pro | Multi-modal, context window size | Large PRs (200+ files), full-repo context |116| DeepSeek V4 | Fast, cost-effective, strong at bug detection | Routine PRs, quick checks |117118### Confidence Scoring119120Assign confidence (0.0-1.0) to each finding:121```122confidence = (models_agreeing / total_models) * evidence_score123124evidence_score:125 1.0 = exact line + code excerpt proves the bug126 0.7 = logic analysis suggests probable issue127 0.4 = speculative (pattern matching without code walk)128 0.1 = style preference129```130131Findings with confidence < 0.5 should be:132- Marked as "suggestion" not "finding"133- Never block a merge134- Phrased as questions: "Did you consider...?"135136### Result Merging Strategy1371381. Group by file + line range (+-5 lines)1392. If all 3 models agree: high confidence, use as primary finding1403. If 2 of 3 agree: medium confidence, note the dissenting model's view in details1414. If 1 of 3: low confidence, verify against code manually before including1425. Merge descriptions: take the most specific one, append key insights from others1436. Remove duplicates: same finding described differently -> keep clearest description144145### Handling Conflicts146147When models disagree:148- Don't default to majority -- investigate the code yourself149- The dissenting model may have caught something the others missed150- Present both views: "Claude suggests X, Gemini suggests Y"151- Let the human reviewer decide152153## Checklist154155- [ ] Valid model name passed (not an alias or unsupported ID)156- [ ] Diff or context reconstructed accurately from conversation history157- [ ] Subagent has the code-review skill loaded158- [ ] Review result captured from subagent output (not assumed)159- [ ] Fallback model specified if primary model is unavailable160161## Sources162163- MCP Protocol specification (modelcontextprotocol.io) — subprocess agent spawning and message passing164- OpenAI API model list documentation (platform.openai.com/docs/models) — supported model IDs and capabilities165- Anthropic Claude model documentation (docs.anthropic.com/en/docs/about-claude/models) — model IDs and feature comparison166- Google Gemini API model documentation (ai.google.dev/models/gemini) — Gemini model identifiers and rate limits167- DeepSeek API documentation (platform.deepseek.com/api-docs) — model IDs and context window limits168- Conventional Comments specification (conventionalcomments.org) — structured review comment formatting169- "Software Engineering at Google" by Titus Winters, Tom Manshreck, Hyrum Wright (O'Reilly, 2020) — code review best practices at scale