PR Reviews & Commits
Pull requests are where code review, collaboration, and quality control happen. Claude Code integrates deeply with this workflow.
Creating Pull Requests
Section titled “Creating Pull Requests”Claude can create PRs with well-structured descriptions:
> Create a pull request for this branch.> We added rate limiting to all API endpoints.Claude will:
- Check the branch status and push if needed
- Analyze all commits on the branch
- Write a PR title and description
- Create the PR via
gh pr create
The PR description typically includes:
- Summary of changes
- What was changed and why
- Test plan or verification steps
Reviewing Pull Requests
Section titled “Reviewing Pull Requests”Quick Review
Section titled “Quick Review”> /review-pr 42Detailed Review with Focus
Section titled “Detailed Review with Focus”> Review PR #42. This touches our payment processing,> so focus on security and data handling.Claude will:
- Fetch the PR diff
- Read changed files for context
- Analyze with your specified focus areas
- Report findings by severity
What Claude Catches
Section titled “What Claude Catches”- Security vulnerabilities — injection, XSS, exposed secrets
- Logic errors — off-by-one, null pointer, race conditions
- Code quality — complexity, duplication, naming
- Performance — N+1 queries, missing indexes, unnecessary computation
- Style — inconsistency with project conventions
Addressing Review Feedback
Section titled “Addressing Review Feedback”When you receive review comments:
> Read the comments on PR #42 and fix the issuesClaude will:
- Fetch all review comments
- Group them by file
- Address each comment with code changes
- Create a new commit with the fixes
PR Descriptions That Matter
Section titled “PR Descriptions That Matter”A good PR description helps both human reviewers and future developers. Here’s what Claude typically generates:
## Summary- Add token bucket rate limiting to auth endpoints- Configure 10 requests/minute/IP for login and register- Add rate-limiter-flexible package
## Changes- `src/middleware/rateLimit.ts` — new rate limiting middleware- `src/api/auth.ts` — apply middleware to login/register routes- `package.json` — add rate-limiter-flexible dependency
## Test Plan- [ ] Verify login works normally under the limit- [ ] Verify rate limit triggers after 10 rapid requests- [ ] Verify rate limit resets after 1 minute- [ ] Verify other endpoints are unaffectedExercise
Section titled “Exercise”- Create a feature branch and make some changes
- Ask Claude to create a PR
- Review the PR description — is it accurate?
- Ask Claude to review its own PR (meta, but useful for learning)
- Practice the feedback-and-fix loop