Home
cd ../playbooks
Developer ToolsAdvanced

Automated PR Code Review

High-signal automated PR review using parallel agents with a validation pass that filters out false positives before anything gets posted.

10 minutes
By AnthropicSource
#code-review#pull-request#github#multi-agent#false-positive-filtering#official

Your team's PR review either rubber-stamps everything with 'LGTM' or drowns authors in fifty nitpicks nobody acts on. What you actually need is a reviewer that only speaks up when it's found something real — and can prove it.

Who it's for: engineering teams with review bottlenecks, open-source maintainers handling high PR volumes, tech leads wanting consistent review quality, solo developers without a senior engineer to review their code

Example

"Review PR #482" → Skip check for closed/draft/already-reviewed, parallel CLAUDE.md compliance and bug-detection agents, a validation pass that discards unconfirmed findings, then either a clean terminal summary or precise inline GitHub comments — never both duplicated, never a guess presented as fact

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add automated-pr-code-review
# Automated PR Code Review

## Your Role

You run high-signal automated code review on pull requests using parallel agents and a validation pass that filters out false positives. Your goal is precision, not volume. A review that flags nothing is better than a review that flags three things wrong.

## Agent assumptions

Applies to every agent and subagent you launch — state this explicitly in each subagent prompt:

- All tools are functional and will work without error. Do not test tools or make exploratory calls.
- Only call a tool if it's required to complete the task. Every tool call should have a clear purpose.

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Runs a multi-stage PR review: skip-check, parallel review by four specialized agents (two for project-rule compliance, two for bugs and security), then an independent validation pass that discards any finding that can't be confirmed. Only validated, high-signal issues get reported — as a terminal summary by default, or as inline GitHub comments when you explicitly ask for it.


Quick Start

Step 1: Create a Project Folder

mkdir pr-review-setup && cd pr-review-setup

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ./

Step 3: Review a PR

claude

Then ask: "Review PR #123" — or add --comment to have findings posted as inline GitHub comments instead of just printed.

Requires the gh CLI installed and authenticated.


The Signal Bar

This is the core discipline of the workflow — what gets flagged and what doesn't:

Flagged:

  • Code that will fail to compile or parse
  • Code that will definitely produce wrong results regardless of input
  • Clear, unambiguous CLAUDE.md violations you can quote directly

Never flagged:

  • Code style or subjective quality opinions
  • Issues that depend on specific inputs or state
  • Pre-existing issues the PR didn't introduce
  • Anything a linter would catch
  • Pedantic nitpicks a senior engineer wouldn't raise
  • Issues explicitly silenced in code (e.g. a lint-ignore comment)

If a finding can't be validated with high confidence, it's dropped rather than reported. False positives erode trust faster than missed issues do.

Tips & Best Practices

  • Validate before reporting. Every bug/security finding goes through a second, independent agent whose only job is confirming it's real before it counts.
  • Cite your sources. Every CLAUDE.md violation links to the specific rule being broken — no vague "this seems off."
  • One comment per issue, ever. Never duplicate the same finding across multiple inline comments.
  • Committable suggestions only when they fully fix it. If a fix needs follow-up steps or spans multiple locations, describe it in prose instead of offering a one-click suggestion.
  • Link to code with the full git SHA, not a branch name — GitHub's inline Markdown renderer requires it to resolve correctly.

Limitations

  • Skips PRs that are closed, drafts, or where the reviewer has already commented
  • Requires gh CLI — the workflow explicitly avoids web fetch for GitHub interaction
  • Designed for precision over recall — it will stay silent rather than guess

$Related Playbooks

Developer Tools

Auto Repo Setup

Turn Claude Code into an environment doctor that diagnoses, fixes, and verifies a codebase so non-technical teammates can run it without understanding the stack.

10 minutes
Intermediate
Developer Tools

Artifacts Builder

Create elaborate multi-component HTML artifacts using React, Tailwind CSS, and shadcn/ui components with professional bundling.

15 minutes
Advanced
Developer Tools

Claude Code Cost Optimizer

A static audit of a project's Claude Code setup for the handful of well-known token-cost leaks — oversized CLAUDE.md prepended every turn, bloated memory files, never-invoked skills loaded into the index, unscoped subagent fan-out, and the cache-killing hook that silently ~10x's cost — each with a PASS/WARN/FAIL check and a concrete fix, ranked by biggest win per effort.

5 minutes
Beginner
Developer Tools

Cinematic GSAP + Lenis Motion System

Build a connected, premium web motion language with GSAP, ScrollTrigger, and Lenis smooth scroll — a full token system for eases/durations/staggers, Lenis-driven-by-the-GSAP-ticker setup, a reusable data-attribute markup API for text reveals and parallax, and reduced-motion handling built in from the start, not bolted on after.

15 minutes
Advanced
Developer Tools

CEO-Mode Plan Review

Review a technical or product plan the way a great CEO would — pick a mode (expand scope, cherry-pick expansions, hold scope, or cut ruthlessly), then apply nine prime directives and eleven cognitive patterns to catch every silent failure, missing edge case, and unnamed error before it ships.

10 minutes
Advanced
Developer Tools

Claude Code Project Architecture

A setup guide for structuring a Claude Code project's full toolkit — layered CLAUDE.md context, slash commands, sub-agents, skills, hooks, and plugins — each used for what it's actually good at instead of one mechanism for everything.

20 minutes
Intermediate
Developer Tools

Claude Model Migration Assistant

Migrate code and prompts between Claude models — update model strings, remove incompatible beta headers, and adjust prompts only for reported behavioral differences.

5 minutes
Beginner
Developer Tools

Claude Code Plugin Builder

End-to-end guided workflow for building Claude Code plugins — structure, commands, agents, skills, hooks, and MCP integration — with a validation checklist before you distribute.

15 minutes
Advanced
Developer Tools

CLAUDE.md Progressive Disclosurer

Slim down and restructure a bloated CLAUDE.md (or AGENTS.md) using progressive disclosure — move low-frequency detail to Level 2 references while keeping Level 1 lean, with zero information loss.

15 minutes
Intermediate
Developer Tools

Claude Usage Analyst

Analyze Claude Code token usage, cost, quota burn, model mix, and cache read/write using ccusage evidence — and explain in human terms why your quota got exhausted.

10 minutes
Beginner
Developer Tools

CLI Demo Generator

Generate professional animated CLI demos as GIFs using VHS terminal recordings — with self-bootstrapping setup, output filtering, and frame-level verification.

15 minutes
Intermediate
Developer Tools

Cloudflare Troubleshooting

Investigate and resolve Cloudflare issues with API-driven evidence — ERR_TOO_MANY_REDIRECTS, SSL mode mismatches, DNS, and proxy problems — instead of guessing.

15 minutes
Intermediate

Browse all Developer Tools playbooks →