Ask Claude to Review a Pull Request and Give Structured Feedback
Code reviews are one of the highest-leverage activities on a team, but they take time and attention that's hard to sustain. Claude reads a PR and gives the kind of thorough review that catches real issues.
"Review this PR: https://github.com/your-org/your-repo/pull/42"
Claude reads the diff, understands the context of the changes, and produces structured feedback:
**Critical**
- The new endpoint doesn't check authorization — any authenticated user
can delete any other user's data (src/controllers/DataController.php:47)
**Bugs**
- The pagination offset is off by one — page 2 shows the first item of
page 1 again (src/services/SearchService.php:83)
**Suggestions**
- The three database queries in the loop could be a single eager load
- Consider adding an index on `status` + `created_at` for the new query
**Style**
- The new helper function doesn't follow the existing naming convention
You can customize what Claude focuses on:
# Security-focused review
"Review this PR specifically for security issues — auth, injection, data exposure"
# Performance-focused review
"Review this PR for performance — N+1 queries, missing indexes, expensive operations"
# Architecture review
"Does this PR follow our existing patterns? Check against the conventions
in UserController and OrderService"
# Junior-friendly review
"Review this PR with detailed explanations — the author is new to the team
and learning our patterns"
You can also review just a diff without a PR URL:
# Review staged changes before you submit
git diff main | claude -p "review this diff for issues before I open a PR"
# Review a specific commit
git show abc123 | claude -p "review this commit"
For the most useful reviews, tell Claude what matters to your team:
"Review this PR. Our priorities: 1) correctness, 2) security, 3) test coverage,
4) readability. Don't nitpick formatting — our linter handles that."
Every PR deserves a thorough review. Claude gives every change the same careful attention, whether it's Friday at 5pm or Monday morning.
via Claude Code
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.