Back to the blog
TutorialsOctober 18, 20267 min read

GitHub Copilot Code Review: How It Works, Custom Instructions and Local Reviews

How GitHub Copilot code review works on Pull Requests, how to customize it with copilot-instructions.md, and how to review your branch locally with Copilot CLI before pushing.

"Copilot" covers several products: completions in the IDE, the chat, the cloud agent, the code review on GitHub.com and Copilot CLI in the terminal. For reviewing code, two of them matter: Copilot code review on GitHub and Copilot CLI. This guide shows how each works, how to customize the review and where each one fits.

How to request a Copilot review on a Pull Request

  • Open or create a Pull Request on GitHub.com.
  • In the right sidebar, under Reviewers, click Request next to Copilot.
  • Wait for the review, then read and resolve its comments like a human reviewer's.

By default Copilot leaves a "Comment" review, so it does not count toward required approvals. Its suggestions can be applied in a few clicks. Replies you write to Copilot's comments are visible to teammates but are not read by Copilot.

Customize the review with instruction files

Repository-wide instructions live in .github/copilot-instructions.md. Keep them short and concrete: GitHub notes that Copilot is non-deterministic and that very long instruction files are followed less reliably.

.github/copilot-instructions.md
# Review guidance

- Flag endpoints that do not check the caller's permissions.
- Flag user input used without validation.
- Flag SQL built with string concatenation.
- Every bug fix should include a regression test.
- Ignore formatting; the linter enforces it.

For rules that only apply to part of the code, add a path-specific file under .github/instructions/ with an applyTo pattern.

.github/instructions/api.instructions.md
---
applyTo: "src/api/**/*.ts"
---

- Validate request bodies with a schema before using them.
- Return errors in the shared { error: { code, message } } shape.

Review before you push with Copilot CLI

The GitHub review only runs after a PR exists. To catch problems on your branch first, run Copilot CLI in your local clone and give it an explicit scope.

Terminal — start Copilot CLI in your repository
cd path/to/your-repo
copilot
Copilot CLI prompt
Review the changes on this branch compared with origin/main
(git diff origin/main...HEAD). For each changed function, check its
callers and tests. Report bugs, security issues and missing tests with
file and line. Do not modify any files.

GitHub review vs local review

  • When: GitHub review runs on an open PR; a local review runs before you push.
  • Where the code is read: GitHub review runs on GitHub; Copilot CLI reads your local checkout.
  • Output: GitHub review posts PR comments; a local review stays private until you decide what to share.

Many teams use both: a private review on the branch, then the PR review as a second pass.

How CodeCrab fits in

CodeCrab is a desktop app that uses your existing Copilot CLI sign-in (or Claude Code, Cursor or Codex) to run pre-push reviews, review teammates' PRs and explain reviewer feedback in My PRs, with a history of every review on your laptop. See setting up Copilot CLI in CodeCrab, or compare the same workflow in Cursor and Claude Code.

Quick questions

Does Copilot code review approve PRs?

By default it leaves comment reviews that do not count toward required approvals.

Can I request Copilot from a script?

Yes, through the REST API by requesting copilot-pull-request-reviewer[bot] as a reviewer.

Does Copilot read AGENTS.md?

Copilot agents can use AGENTS.md; for code review, put guidance in the Copilot instruction files above.

Try it on your next Pull Request

Free Public Beta — runs 100% on your machine. No code leaving your laptop.

Download CodeCrab

KEEP READING