plugins/code-review/README.md
Automated code review for pull requests using multiple specialized agents with confidence-based scoring to filter false positives.
The Code Review Plugin automates pull request review by launching multiple agents in parallel to independently audit changes from different perspectives. It uses confidence scoring to filter out false positives, ensuring only high-quality, actionable feedback is posted.
/code-reviewPerforms automated code review on a pull request using multiple specialized agents.
What it does:
--comment flag)Usage:
/code-review [--comment]
Options:
--comment: Post the review as a comment on the pull request (default: outputs to terminal only)Example workflow:
# On a PR branch, run locally (outputs to terminal):
/code-review
# Post review as PR comment:
/code-review --comment
# Claude will:
# - Launch 4 review agents in parallel
# - Score each issue for confidence
# - Output issues ≥80 confidence (to terminal or PR depending on flag)
# - Skip if no high-confidence issues found
Features:
Review comment format:
## Code review
Found 3 issues:
1. Missing error handling for OAuth callback (CLAUDE.md says "Always handle OAuth errors")
https://github.com/owner/repo/blob/abc123.../src/auth.ts#L67-L72
2. Memory leak: OAuth state not cleaned up (bug due to missing cleanup in finally block)
https://github.com/owner/repo/blob/abc123.../src/auth.ts#L88-L95
3. Inconsistent naming pattern (src/conventions/CLAUDE.md says "Use camelCase for functions")
https://github.com/owner/repo/blob/abc123.../src/utils.ts#L23-L28
Confidence scoring:
False positives filtered:
This plugin is included in the Claude Code repository. The command is automatically available when using Claude Code.
/code-review# Create PR with changes
# Run local review (outputs to terminal)
/code-review
# Review the automated feedback
# Make any necessary fixes
# Optionally post as PR comment
/code-review --comment
# Merge when ready
# Trigger on PR creation or update
# Use --comment flag to post review comments
/code-review --comment
# Skip if review already exists
gh) installed and authenticatedIssue: Agents are slow on large PRs
Solution:
Issue: Review flags issues that aren't real
Solution:
Issue: /code-review runs but no comment appears
Solution: Check if:
Issue: Code links don't render correctly in GitHub
Solution: Links must follow this exact format:
https://github.com/owner/repo/blob/[full-sha]/path/file.ext#L[start]-L[end]
#L notationIssue: gh commands fail
Solution:
brew install gh (macOS) or see GitHub CLI installationgh auth loginThe default threshold is 80. To adjust, modify the command file at commands/code-review.md:
Filter out any issues with a score less than 80.
Change 80 to your preferred threshold (0-100).
Edit commands/code-review.md to add or modify agent tasks:
Uses gh CLI for:
Boris Cherny ([email protected])
1.0.0