Chapter 6. Pull Requests and Reviews — One More Look Before Merging
Required Read this to follow this stage.One-line summary: A PR (Pull Request) proposes merging the changes on your branch into
main. It gives you a place to discuss and review work before merging. Review your work even when you work alone. Use AI review (/code-review) too, but "no findings" does not mean your code is safe, and you decide whether to merge.
This chapter is based on the official GitHub and Claude Code documentation checked on November 1, 2026.
What Is a PR?
A PR proposes merging changes from one branch into another. It gives you a place to discuss and review work before it becomes part of the project.[1]
A PR page has these tabs.[2]
| Tab | What it shows |
|---|---|
| Conversation | Description, comments, and reviews |
| Commits | How the branch changed step by step |
| Checks | Results of automated tests and builds (Chapter 5) |
| Files changed | The changed lines where reviewers leave comments |
Source: GitHub official docs (excerpted)[2:1]
When you create a PR, write down what you changed and what problem it solves.[3]
Later, in Chapter 8, you will use issues (GitHub records where you write down to-dos or bugs). If a PR fixes an issue, link it by writing the issue in the PR description with a set keyword such as fixes #number. Then the issue closes automatically when the PR merges.[3:1] For now, it is enough to know that this kind of link exists.
Small PRs are easier to review and safer to merge. Before you ask someone else to review your work, review it yourself first. Read the changed lines, check that you did not change anything by mistake, and make sure builds and tests ran.[4]
You can also ask Claude Code to create a PR for you. The official docs recommend reviewing the PR Claude creates before submitting it, and asking Claude to highlight potential risks.[5]
Create a PR from the first-board branch. Before submitting it, highlight any potential risks in these changes first.Quick check
Which statement about a PR (Pull Request) is true?
Review Even When You Work Alone
The GitHub tutorial says that even when you work alone, building a habit of deliberately reviewing changes before merging keeps your project healthy and makes collaboration easier later.[6]
A review ends with one of three decisions.[7]
| Decision | Meaning |
|---|---|
| Comment | Leave feedback only |
| Approve | Ready to merge |
| Request changes | Must be fixed before merging |
Source: GitHub official docs[7:1]
The standard for a review is SPEC.md from Chapter 3. The official Claude Code best practices docs give this example of how to review after building.[8]
- Check against SPEC.md that every requirement is implemented.
- Report only gaps that affect correctness.
- Skip style, such as formatting and naming.
Why skip style? When you ask a reviewer to find problems, it always finds something.[9] If you try to fix everything it points out, you end up adding unnecessary clutter. If it looks only at correctness, only what you really need to fix is left.
In a new session, review the changes on the current branch against SPEC.md. Check whether every requirement is implemented and whether each verification criterion has a check. Tell me only about gaps that affect correctness. Skip style.Quick check
When getting a review against SPEC.md, why do the official docs say to "skip style"?
Getting a Review from AI
Claude Code has a review command, /code-review. If you type it in your working session, Claude reads the changes on your branch, looks for correctness problems, and tells you what it found in the conversation.[10] You can use it on any plan.[11]
For example, after you finish building the first screen, just type /code-review in the prompt box. You do not need to add any explanation. It looks at the changes on the current branch.
AI review has clear limits.
- AI review can miss bugs or security problems. Having no findings does not mean your code is error-free or safe.[12]
- Even the managed review that automatically posts reviews on GitHub PRs never approves or blocks a PR. People decide whether to merge.[13]
More details (click to expand)
- Usage: The review also runs inside your session, so it counts toward your plan's usage the same way the rest of the session does.[14]
- Desktop app: You can type
/code-reviewin the prompt box to get a review before you commit.[15] After you open a PR, you can see the PR and its automated check status in the session details panel. This feature requires the GitHub CLI (gh, a program for working with GitHub through commands) to be installed and signed in.[16] - Managed review: The feature that automatically posts reviews on GitHub PRs is for Team and Enterprise plans. Individuals can run
/code-reviewon any plan.[11:1]
If you learned in Stage 3 to "separate the writer from the checker," it is better to have Claude review in a new session, even if it is the same Claude. That way it is not pulled along by the context of the conversation where you built the feature.
Quick check
How should you take it when an AI review finds no issues?
Merging and Cleaning Up
Once the review is done and the verification checks pass, merge the PR. The final step of GitHub flow is deleting the branch. Even if you delete the branch, your PR and commit history are not deleted, so you do not need to worry.[17]
Later, as more people join, you can set branch protection rules such as "require approvals before merging."[18] You do not need to know about this while you practice alone.
Quick check
What happens if you delete the branch after merging a PR?
Try It Yourself
- Check that the
first-boardbranch is pushed to GitHub (Chapter 4). On the main page of your repository, click Pull requests → New pull request, selectfirst-boardas the branch to compare, and click Create pull request.[19] Write what you changed and why in the title and description. - Before creating it, ask Claude to highlight potential risks.
- In a new session, get a review against SPEC.md. Fix only correctness problems.
- Run
/code-reviewone more time, and skim the Files changed tab yourself even if there are no findings. - When the verification checks pass, merge the PR and clean up the branch.
Up next: In Chapter 7, you will publish the merged to-do board to the internet with GitHub Pages.
Key Takeaways
- A PR is a place to discuss and review changes before merging. Keep it small, write what you changed and why, and review it yourself first.
- Review your work even when you work alone. Use SPEC.md as your standard, fix only correctness gaps, and skip style.
- You can use
/code-reviewon any plan. Having no findings does not mean your code is safe, and people decide whether to merge. - Even if you delete the branch after merging, the PR and commit history remain.
Glossary
| Term | One-line meaning |
|---|---|
| Pull Request (PR) | A proposal to merge changes from a branch |
| Review | Examining changes before merging |
| Merge | Combining changes from a branch into another |
/code-review | Claude Code's review command |
Finished this chapter?
Progress is saved only in this browser. See your progress on the full table of contents.
Next chapter: Chapter 7. Deployment
References (19)
GitHub official docs, "About pull requests". "A pull request proposes merging code changes from one branch into another. As a collaborative feature, pull requests give you a place to discuss and review work before it becomes part of a project." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "About pull requests". "Checks shows the results of automated tests, builds, and other validations." / "Files changed shows the diff that reviewers comment on." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "GitHub flow". "When you create a pull request, include a summary of the changes and what problem they solve." / "If you link with a keyword, the issue will close automatically when the pull request merges." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "Helping others review your changes". "Small, focused pull requests are easier to review and safer to merge." / "A self-review can include reading the diff, checking for accidental changes, and making sure relevant builds or tests have run." docs.github.com (checked on 2026-11-01) ↩︎
Claude Code official docs, "Common workflows". "Review Claude's generated PR before submitting and ask Claude to highlight potential risks or considerations." code.claude.com (checked on 2026-11-01) ↩︎
GitHub official docs, "Reviewing your proposed changes". "Even when you work alone, a deliberate review builds a habit that keeps your software projects healthy and makes collaboration easier later." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "Quickstart for reviewing pull requests". "Approve signals that the changes are ready to merge." / "Request changes flags feedback the author must address before merging." docs.github.com (checked on 2026-11-01) ↩︎
The official example hands this review to a subagent (another Claude that Claude hands a separate piece of work to), while this guide adapts it to a new session. Claude Code official docs, "Best practices for Claude Code". "use a subagent to review the rate limiter diff against SPEC.md, check every requirement is implemented and the listed edge cases have tests, report gaps that affect correctness and skip style" code.claude.com (checked on 2026-11-01) ↩︎
Claude Code official docs, "Best practices for Claude Code". "A reviewer that's asked to find problems will always find something." code.claude.com (checked on 2026-11-01) ↩︎
Claude Code official docs, "Review locally with /code-review". "Claude reviews the changes on your branch, looks for correctness bugs, and reports what it found in your conversation." code.claude.com (checked on 2026-11-01) ↩︎
Claude Code official docs, "Code Review". "Plans: Team and Enterprise" / "Run
/code-reviewin your Claude Code session on any plan, or compare all the options." code.claude.com (checked on 2026-11-01) ↩︎Claude Code official docs, "Code Review". "Code Review uses AI to review code and may miss bugs, security vulnerabilities, or other issues. A review with no findings doesn't mean your code is error-free or secure." code.claude.com (checked on 2026-11-01) ↩︎
Claude Code official docs, "Code Review". "A review never approves or blocks the pull request, so the decision to merge stays with your team." code.claude.com (checked on 2026-11-01) ↩︎
Claude Code official docs, "Review locally with /code-review". "The review runs in your own session, so it counts toward your plan's usage or API billing the same way the rest of the session does." code.claude.com (checked on 2026-11-01) ↩︎
Claude Code official docs, "Desktop application". "To have Claude review your changes before you commit, enter
/code-reviewin the prompt box." code.claude.com (checked on 2026-11-01) ↩︎Claude Code official docs, "Desktop application". "After you open a pull request, it appears in the Changes card of the session details panel with the status of its CI checks." / "PR monitoring requires the GitHub CLI (
gh) to be installed and authenticated on your machine." code.claude.com (checked on 2026-11-01) ↩︎GitHub official docs, "GitHub flow". "Don't worry about losing information. Your pull request and commit history will not be deleted." docs.github.com (checked on 2026-11-01) ↩︎
By default, protection rules block force pushes (forcibly overwriting the history) and branch deletion. GitHub official docs, "About protected branches". "By default, each branch protection rule disables force pushes to the matching branches and prevents the matching branches from being deleted." docs.github.com (checked on 2026-11-01) ↩︎
GitHub official docs, "Quickstart for pull requests". "then click New pull request." / "For the compare branch, select the branch that contains your changes." / "Click Create pull request." docs.github.com (checked on 2026-11-01) ↩︎