ClaudeCodeMod

All shelves / Plugins

code-review

claude-code-plugins · 156.7k stars

Plugin Automated code review for pull requests using multiple specialized agents with confidence-based scoring to filter false positives

Install

In Claude Code
/plugin marketplace add anthropics/claude-code
/plugin install code-review@claude-code-plugins

Run inside Claude Code. Add its marketplace first. Check the repo's README before you run it.

Open the repo

What it adds

1 command

Commands 1

  • /code-reviewCode review a pull request

Files

README.md

Code Review Plugin

Automated code review for pull requests using multiple specialized agents with confidence-based scoring to filter false positives.

Overview

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.

Commands

/code-review

Performs automated code review on a pull request using multiple specialized agents.

What it does:

  1. Checks if review is needed (skips closed, draft, trivial, or already-reviewed PRs)
  2. Gathers relevant CLAUDE.md guideline files from the repository
  3. Summarizes the pull request changes
  4. Launches 4 parallel agents to independently review:
    • Agents #1 & #2: Audit for CLAUDE.md compliance
    • Agent #3: Scan for obvious bugs in changes
    • Agent #4: Analyze git blame/history for context-based issues
  5. Scores each issue 0-100 for confidence level
  6. Filters out issues below 80 confidence threshold
  7. Outputs review (to terminal by default, or as PR comment with --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:

  • Multiple independent agents for comprehensive review
  • Confidence-based scoring reduces false positives (threshold: 80)
  • CLAUDE.md compliance checking with explicit guideline verification
  • Bug detection focused on changes (not pre-existing issues)
  • Historical context analysis via git blame
  • Automatic skipping of closed, draft, or already-reviewed PRs
  • Links directly to code with full SHA and line ranges

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:

  • 0: Not confident, false positive
  • 25: Somewhat confident, might be real
  • 50: Moderately confident, real but minor
  • 75: Highly confident, real and important
  • 100: Absolutely certain, definitely real

False positives filtered:

  • Pre-existing issues not introduced in PR
  • Code that looks like a bug but isn't
  • Pedantic nitpicks
  • Issues linters will catch
  • General quality issues (unless in CLAUDE.md)
  • Issues with lint ignore comments

Installation

This plugin is included in the Claude Code repository. The command is automatically available when using Claude Code.

Best Practices

Using /code-review
  • Maintain clear CLAUDE.md files for better compliance checking
  • Trust the 80+ confidence threshold - false positives are filtered
  • Run on all non-trivial pull requests
  • Review agent findings as a starting point for human review
  • Update CLAUDE.md based on recurring review patterns
When to use
  • All pull requests with meaningful changes
  • PRs touching critical code paths
  • PRs from multiple contributors
  • PRs where guideline compliance matters
When not to use
  • Closed or draft PRs (automatically skipped anyway)
  • Trivial automated PRs (automatically skipped)
  • Urgent hotfixes requiring immediate merge
  • PRs already reviewed (automatically skipped)

Workflow Integration

Standard PR review workflow:
# 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
As part of CI/CD:
# Trigger on PR creation or update
# Use --comment flag to post review comments
/code-review --comment
# Skip if review already exists

Requirements

  • Git repository with GitHub integration
  • GitHub CLI (gh) installed and authenticated
  • CLAUDE.md files (optional but recommended for guideline checking)

Troubleshooting

Review takes too long

Issue: Agents are slow on large PRs

Solution:

  • Normal for large changes - agents run in parallel
  • 4 independent agents ensure thoroughness
  • Consider splitting large PRs into smaller ones
Too many false positives

Issue: Review flags issues that aren't real

Solution:

  • Default threshold is 80 (already filters most false positives)
  • Make CLAUDE.md more specific about what matters
  • Consider if the flagged issue is actually valid
No review comment posted

Issue: /code-review runs but no comment appears

Solution: Check if:

  • PR is closed (reviews skipped)
  • PR is draft (reviews skipped)
  • PR is trivial/automated (reviews skipped)
  • PR already has review (reviews skipped)
  • No issues scored ≥80 (no comment needed)
Link formatting broken

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]
  • Must use full SHA (not abbreviated)
  • Must use #L notation
  • Must include line range with at least 1 line of context
GitHub CLI not working

Issue: gh commands fail

Solution:

  • Install GitHub CLI: brew install gh (macOS) or see GitHub CLI installation
  • Authenticate: gh auth login
  • Verify repository has GitHub remote

Tips

  • Write specific CLAUDE.md files: Clear guidelines = better reviews
  • Include context in PRs: Helps agents understand intent
  • Use confidence scores: Issues ≥80 are usually correct
  • Iterate on guidelines: Update CLAUDE.md based on patterns
  • Review automatically: Set up as part of PR workflow
  • Trust the filtering: Threshold prevents noise

Configuration

Adjusting confidence threshold

The 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).

Customizing review focus

Edit commands/code-review.md to add or modify agent tasks:

  • Add security-focused agents
  • Add performance analysis agents
  • Add accessibility checking agents
  • Add documentation quality checks

Technical Details

Agent architecture
  • 2x CLAUDE.md compliance agents: Redundancy for guideline checks
  • 1x bug detector: Focused on obvious bugs in changes only
  • 1x history analyzer: Context from git blame and history
  • Nx confidence scorers: One per issue for independent scoring
Scoring system
  • Each issue independently scored 0-100
  • Scoring considers evidence strength and verification
  • Threshold (default 80) filters low-confidence issues
  • For CLAUDE.md issues: verifies guideline explicitly mentions it
GitHub integration

Uses gh CLI for:

  • Viewing PR details and diffs
  • Fetching repository data
  • Reading git blame and history
  • Posting review comments

Author

Boris Cherny (boris@anthropic.com)

Version

1.0.0

Facts

Kind
Plugin
Marketplace
claude-code-plugins
Group
Productivity
Stars
156.7k
Version
1.0.0
Author
Boris Cherny
Category
productivity
Marketplace repo
anthropics/claude-code
Files
3

Same name on this shelf 1

  1. 40code-reviewclaude-plugins-officialAutomated code review for pull requests using multiple specialized agents with confidence-based scoring to filter false positives48k

Same repo on other shelves

Skills

  1. 1664Skill Developmentanthropics/claude-code19.7k
  2. 1666Agent Developmentanthropics/claude-code19.6k
  3. 1941MCP Integrationanthropics/claude-code15.6k

Marketplaces

  1. 5anthropics/claude-codeanthropics/claude-codeClaude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.156.7k

From the same marketplace

  1. 13commit-commandsclaude-code-pluginsCommands for git commit workflows including commit, push, and PR creation156.7k
  2. 14explanatory-output-styleclaude-code-pluginsAdds educational insights about implementation choices and codebase patterns (mimics the deprecated Explanatory output style)156.7k
  3. 15feature-devclaude-code-pluginsComprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review156.7k
  4. 16frontend-designclaude-code-pluginsCreate distinctive, production-grade frontend interfaces with high design quality. Generates creative, polished code that avoids generic AI aesthetics.156.7k
  5. 17hookifyclaude-code-pluginsEasily create custom hooks to prevent unwanted behaviors by analyzing conversation patterns or from explicit instructions. Define rules via simple markdown files.156.7k
  6. 18learning-output-styleclaude-code-pluginsInteractive learning mode that requests meaningful code contributions at decision points (mimics the unshipped Learning output style)156.7k