There are a number GitHub integrations which allow AI to review pull requests. Tools such as Copilot Code Review, Claude Code GitHub Actions, Graphite Diamond make this process automatic, with comments left directly on the PR. I’ve found these to be very useful in catching code issues. Human reviews should, of course, also always be done.
There are scenarios where you may want to get an AI review on a PR locally. Maybe your organization isn’t set up for any of these automated tools, or there’s a specific model you want to use. There are a few ways to accomplish this, all fairly straightforward.
The first two methods are geared toward GitHub, while the last one can be used with any repository host you may use.
Review the Diff File
- On any GitHub PR, add
.diffto the end of the PR’s URL. This will generate a diff file, which you can save locally. - Attach the diff file to the command prompt in whatever tool you’re using (such as Cursor or Claude Code). Make sure you’re on the same branch as the pull request.
- Ask for it to review the diff.
Using the GitHub CLI
I prefer this method, as the GitHub CLI can pull in more information about the PR, such as the description, to get more context.
- Install and login to the GitHub CLI (link above).
- Copy the URL of the PR.
- Paste the URL into your tool’s command prompt and ask for a review using the GitHub CLI. Example:
Review this pull request. Call out any issues and provide suggestions as needed. Don't make changes and don't attempt to build. Use the GitHub CLI. @https://github.com/someusername/somerepo-ios/pull/1.
Asking Directly
An advantage of this method is it can be done before opening a pull request.
- In your AI tool, simply ask it to review the current branch against the target branch (e.g. develop or main). Example:
Compare the current branch against the develop branch. Call out any issues and provide suggestions as needed. Don't make changes and don't attempt to build.