Skip to main content
command CX Codex

code-review · carlrannaberg — Claude Code command: six parallel review agents

code-review fans out six review agents at once and merges what they find: architecture, code quality, security, performance, tests, docs. Useful before a large branch lands.

MIT ★ 763 updated 2026-03-31

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/code-review.md
Open on GitHub

What code-review does

The command opens by reading repo state: short status, diff stats, the last few commits. Then it asks the model to size up the change, meaning which systems it touches, what depends on them, how risky the deploy looks. The argument you pass decides how much of that machinery fires.

Six review angles exist, each handed to a code-review-expert subagent through Task and run concurrently. Which ones start depends on what changed: docs only get the documentation agent, test files get testing plus code quality, config files get security and architecture, source files get all six. Findings come back together and the command checks whether two agents are pushing opposite fixes.

Allowed tools are narrow: Task plus read-only git (git status, git diff, git log). So a hint like PR #123 is just text for the agents to reason about; the command never talks to GitHub itself.

What it helps with

  • review a branch across six angles before it merges
  • spot missing input validation and sloppy secret handling
  • check that tests fail when they should, not just that they exist
  • catch breaking API changes and stale README sections
  • flag expensive queries and heavy algorithms in new code

Example prompts for the agent

  • Run /code-review on recent changes before I merge into main.
  • Run /code-review over src/components, focus on architecture and code quality.
  • Have /code-review look at every *.ts file in the project.

How to install code-review

Manually: put the files in place

.claude/commands/code-review.md

Call it with /code-review. For all projects use ~/.claude/commands/

Questions about code-review

How do I install code-review in Claude Code?

Drop the command file into your project at .claude/commands/code-review.md. It then shows up as /code-review.

What does code-review do?

It runs several code-review-expert subagents at the same time, one per review angle, and pulls their findings into a single pass.

Which agents run if I only changed tests?

Two: testing quality and code quality. Documentation alone gets one agent, config files two, source files all six.

Source text

code-review.md · MIT
---
description: Multi-aspect code review using parallel code-review-expert agents
allowed-tools: Task, Bash(git status:*), Bash(git diff:*), Bash(git log:*)
argument-hint: '[what to review] - e.g., "recent changes", "src/components", "*.ts files", "PR #123"'
---

# Code Review

## Current Repository State
!`git status --short && echo "---" && git diff --stat && echo "---" && git log --oneline -5`

## Pre-Review Analysis: Think This Through End-to-End

Before launching review agents, analyze the complete impact and context:

### Impact Assessment
- **System Impact**: What systems, services, or components could be affected by these changes?
- **Deployment Context**: What's the risk level and timeline for these changes?
- **Integration Points**: Are there external dependencies, APIs, or team workflows involved?
- **Stakeholder Impact**: Who depends on the code being reviewed?

### Review Strategy Coordination
Based on impact assessment and **$ARGUMENTS**, determine:
- **Critical vs. Nice-to-Have**: Which review aspects are CRITICAL vs. optional for this change?
- **Potential Conflicts**: Could findings from different review areas suggest competing solutions?
- **Shared Context**: What context should all review agents be aware of?
- **Appropriate Rigor**: What level of analysis matches the change scope and risk?

## Review Strategy

Based on **$ARGUMENTS** and the impact assessment above, determine which review agents are needed:

If reviewing "changes" or recent modifications:
1. Analyze the file types that have been modified
2. Launch only relevant review agents:
   - **Documentation files only** (*.md, *.txt, README): Launch only Documentation & API Review agent
   - **Test files only** (*test.*, *.spec.*, tests/): Launch Testing Quality Review and Code Quality Review agents
   - **Config files only** (*.json, *.yaml, *.toml, .*rc): Launch Security & Dependencies Review and Architecture Review agents
   - **Source code files** (*.ts, *.js, *.py, etc.): Launch all 6 review agents
   - **Mixed changes**: Launch agents relevant to each file type present

If reviewing a specific directory or broad scope:
- Launch all 6 review agents for comprehensive coverage

Use the Task tool to invoke the appropriate code-review-expert agents concurrently with enhanced thinking trigger instructions:

## 1. Architecture & Design Review
```
Subagent: code-review-expert
Description: Architecture review with end-to-end analysis
Prompt: Review the architecture and design patterns in: $ARGUMENTS

CONTEXT: [Include findings from Pre-Review Analysis above - system impact, deployment context, integration points]

Primary Focus: module organization, separation of concerns, dependency management, abstraction levels, design pattern usage, and architectural consistency. Check available experts with claudekit for domain-specific patterns.

THINK THIS THROUGH END-TO-END:
- Trace architectural impacts: How does this change affect all dependent systems?
- Map the complete data/control flow through the architecture
- Identify what breaks when components fail or change
- Consider the full deployment and integration pipeline
- Analyze how this fits into the broader system architecture

Check available experts with claudekit for domain-specific patterns.
```

## 2. Code Quality Review
```
Subagent: code-review-expert
Description: Code quality review  
Prompt: Review code quality and maintainability in: $ARGUMENTS
Focus on: readability, naming conventions, code complexity, DRY principles, code smells, refactoring opportunities, and consistent coding patterns. Pull domain-specific quality metrics from available experts.
```

## 3. Security & Dependencies Review
```
Subagent: code-review-expert
Description: Security and dependencies review with alternative hypothesis analysis
Prompt: Perform security and dependency analysis of: $ARGUMENTS

CONTEXT: [Include findings from Pre-Review Analysis above - system impact, deployment context, integration points]

Primary Focus: input validation, injection vulnerabilities, authentication/authorization, secrets management, dependency vulnerabilities, license compliance, version pinning, and supply chain security. Use security insights from domain experts if available.

CONSIDER ALTERNATIVE HYPOTHESES:
- Beyond obvious vulnerabilities, what other attack vectors exist?
- How else could these security controls be bypassed or exploited?
- What assumptions about user behavior, data flow, or system boundaries could an attacker violate?
- Are there alternative explanations for apparent security measures?
- What if the current security model is fundamentally flawed?

Use security insights from domain experts if available.
```

## 4. Performance & Scalability Review
```
Subagent: code-review-expert
Description: Performance and scalability review
Prompt: Analyze performance and scalability in: $ARGUMENTS
Focus on: algorithm complexity, memory usage, database queries, caching strategies, async patterns, resource management, load handling, and horizontal scaling considerations. Get performance patterns from relevant experts.
```

## 5. Testing Quality Review
```
Subagent: code-review-expert
Description: Testing quality review
Prompt: Review test quality and effectiveness for: $ARGUMENTS
Focus on: meaningful assertions, test isolation, edge case handling, failure scenario coverage, mock vs real dependencies balance, test maintainability, clear test names, and actual behavior verification (not just coverage metrics). Check for testing-expert insights if available.
```

## 6. Documentation & API Review
```
Subagent: code-review-expert
Description: Documentation and API review
Prompt: Review documentation and API design for: $ARGUMENTS

Focus on: README completeness, API documentation, breaking changes, code comments, JSDoc/TypeDoc coverage, usage examples, migration guides, and developer experience. Evaluate API consistency and contract clarity.

Documentation Review Guidelines:
- Consider purpose and audience: Who needs this information and why?
- Evaluate effectiveness: Does the documentation achieve its goals?
- Focus on clarity: Can users understand and apply the information?
- Identify real issues: Missing information, errors, contradictions, outdated content
- Respect intentional variation: Multiple examples may show different valid approaches
```

## Post-Review Consolidation: Consider Alternative Hypotheses

After all agents complete, apply alternative hypothesis thinking before consolidating:

### Cross-Pattern Analysis
- **Competing Solutions**: Do findings from different review areas suggest conflicting solutions or approaches?
- **Alternative Explanations**: Are there alternative explanations for patterns seen across multiple review areas?
- **Root Cause Investigation**: Could the same underlying issue be manifesting in multiple review aspects?
- **Intentional Trade-offs**: What if apparent "problems" are actually intentional design decisions with valid reasoning?

### Prioritization with Context
- **Real vs. Theoretical Issues**: Which issues matter given the actual deployment context and timeline?
- **Conflicting Recommendations**: How do we sequence fixes that might conflict with each other?
- **Alternative Approaches**: If obvious fixes prove problematic, what are the alternative solutions?

Then consolidate findings into this structured format:

```
🗂 Consolidated Code Review Report - [Target]

📋 Review Scope
Target: [directory/files reviewed] ([X files, Y lines])
Focus: Architecture, Security, Performance, Testing, Documentation

📊 Executive Summary
Brief overview of code quality, key strengths, and critical issues requiring attention.

🔴 CRITICAL Issues (Must Fix Immediately)
1. 🔒 [Security/🏗️ Architecture/⚡ Performance/🧪 Testing/📝 Documentation/💥 Breaking] [Issue Name]
   File: [path:line]
   Impact: [description]
   Solution:
   ```[code example]```

2. [Additional critical issues with type icons...]

🟠 HIGH Priority Issues
1. [Type icon] [Issue name]
   File: [path:line]
   Impact: [description]
   Solution: [recommendation]

2. [Additional high priority issues...]

🟡 MEDIUM Priority Issues
1. [Type icon] [Issue name] - [file:line]
   Extract into: [suggested refactoring]

2. [Additional medium priority issues...]

✅ Quality Metrics
Include only aspects that were actually reviewed based on the file types and agents launched:
┌─────────────────┬───────┬────────────────────────────────────┐
│ Aspect          │ Score │ Notes                              │
├─────────────────┼───────┼────────────────────────────────────┤
│ [Only include relevant aspects based on what was reviewed]      │
│ Architecture    │ X/10  │ [Clean separation, coupling issues]│
│ Code Quality    │ X/10  │ [Readability, consistency, patterns]│
│ Security        │ X/10  │ [Critical vulnerabilities, if any] │
│ Performance     │ X/10  │ [Bottlenecks, scalability concerns]│
│ Testing         │ X/10  │ [Coverage percentage, test quality]│
│ Documentation   │ X/10  │ [API docs, comments, examples]     │
└─────────────────┴───────┴────────────────────────────────────┘

For example:
- Documentation-only review: Show only Documentation row
- Test file review: Show Testing and Code Quality rows
- Config file review: Show Security and Architecture rows
- Full code review: Show all relevant aspects

✨ Strengths to Preserve
- [Key strength with evidence]
- [Additional strengths...]

🚀 Proactive Improvements
1. [Pattern/Practice Name]
   ```[code example]```

2. [Additional improvements...]

📊 Issue Distribution
- Architecture: [X critical, Y high, Z medium]
- Security: [X critical, Y high, Z medium]
- Performance: [X critical, Y high, Z medium]
- Testing: [X critical, Y high, Z medium]
- Documentation: [X critical, Y high, Z medium]

⚠️ Systemic Issues
Repeated problems that need addressing:
- [Problem pattern] (X occurrences)
  → [Actionable fix/next step]
- [Additional problems with solutions...]
```

After all agents complete, consolidate findings into this format. Focus on actionable feedback with specific file locations and code examples. Use type icons:
🔒 Security | 🏗️ Architecture | ⚡ Performance | 🧪 Testing | 📝 Documentation | 💥 Breaking Change

© carlrannaberg · MIT · carlrannaberg/claudekit

Similar slash commands

All slash commands for Code review and refactoring →

code-review by other authors comes first.

code-review official Anthropic Runs a multi-agent code review on a pull request, filters out false positives, and checks changes against local CLAUDE.md rules. CX Codex +1 5,537installs code-review Affaan Mustafa code-review is a Claude Code command that checks uncommitted changes for security flaws and code-quality issues. It reports findings and blocks commits when it detects CRITICAL or HIGH severity problems. CX Codex +1 ★ 6,739repo stars code-review Community code-review inspects recent repository changes using git context. It spots security flaws, performance bottlenecks, and test gaps before you push code. CX Codex +1 ★ 2,003repo stars ponytail-review DietrichGebert ponytail-review is a Claude Code skill that reviews code changes for bugs, risks, and unnecessary complexity. It responds to requests to inspect a commit, PR, branch, or files. CX Codex +1 75,500installs code-review-excellence Seth Hobson The code-review-excellence skill guides pull request reviews, catches logic and security issues, and helps teams give specific feedback. Use it for review standards or developer mentoring. CX Codex +1 30,193installs differential-review trailofbits differential-review reviews code changes for security issues using Git history and test coverage. Use it for commits, diffs, and pull requests that need a written review report. CX Codex +1 10,700installs pull-request-review autohandai pull-request-review — a skill that reviews a pull request or branch diff: checks the change against the issue, hunts correctness and security defects, and returns prioritized comments. CX Codex +1 ★ 219repo stars review-pr SeifBenayed review-pr walks a branch diff against a checklist: bugs, security, performance, tests. Ends with a verdict — approve, request changes or discuss. CX Codex +1 ★ 116repo stars review garrytan review is a Claude Code skill that checks local changes, a branch, or a PR before merge. It examines the diff and writes a review report. CX Codex +1 514installs

From the same set54

The whole set →
create-subagent create-subagent builds a domain-focused subagent with defined tasks, tools, boundaries, and project context checks. Use it when a one-off command is too narrow. CX Codex +1 ★ 763repo stars research research fans a question out to parallel subagents, reads their saved reports from /tmp, and merges the lot into one cited file. CX Codex +1 ★ 763repo stars cleanup cleanup finds disposable debug scripts, test files, and generated reports from Claude Code sessions and prompts before removing them. CX Codex +1 ★ 763repo stars oracle oracle — a subagent for difficult debugging, architecture reviews, security audits, commit checks, and second opinions when a problem needs deeper analysis. CX Codex ★ 763repo stars database-expert database-expert — a subagent for optimizing database queries, index layouts, connection pools, and migrations across PostgreSQL, MySQL, MongoDB, and SQLite. CX Codex ★ 763repo stars refactoring-expert The refactoring-expert subagent finds code smells and applies small refactoring steps without changing external behavior. Use it for duplication, long methods, and tangled conditionals. CX Codex ★ 763repo stars vitest-testing-expert vitest-testing-expert — a Claude subagent for Vitest work: Vite config, moving tests off Jest, and running them in a real browser. CX Codex ★ 763repo stars react-expert react-expert diagnoses hook violations, render loops, and memory leaks in React 18 and 19 codebases. Fixes component issues using progressive steps. CX Codex ★ 763repo stars

Project sponsors

Companies that keep this analytics open