// answer

Can Copilot code review read PR-branch instructions?

Short answer

Yes. Copilot code review reads repository custom instructions, agent instructions, and agent skills from the PR’s head branch, so changes in the branch can affect the review.

Other people are working this out at the same time: See what people are building

Can Copilot code review read instructions from the PR branch now

Yes. GitHub’s current documentation says Copilot code review reads repository custom instructions, agent instructions, and agent skills from the pull request’s head branch, which is the branch with your changes, not the base branch. That means instructions added in the PR branch can be used in the same PR review.

The part people get wrong is the branch direction. For code review, the review follows the head branch. For the broader custom-instructions docs, GitHub also explains that the branch under review is the source of the instructions Copilot uses during that review. The base branch is not the branch Copilot consults for those files when reviewing the PR.

That applies to repository-wide instructions in .github/copilot-instructions.md, path-specific instructions in .github/instructions/**/*.instructions.md, and agent context such as AGENTS.md where GitHub uses it for Copilot code review. If those files are changed in the PR branch, Copilot can see the updated version while reviewing that same PR.

This is useful when you want to test review guidance without merging it first. GitHub gives the example of changing instructions in my-feature-branch while merging into main, and says Copilot uses the instructions in my-feature-branch. That lets you iterate on review rules in the same pull request instead of waiting for a separate merge.

The inconvenient part is that instruction files are not the only thing Copilot considers, and they are not a guarantee of identical output. GitHub says Copilot’s behavior is non-deterministic, long instruction files can be overlooked, and clear specific instructions work better than vague ones. A PR branch can supply the instructions, but it cannot force perfect compliance every time.

Another thing people miss is that this answer is about code review, not every Copilot feature. GitHub’s code-review docs distinguish review behavior from other custom-instruction paths, and one related page notes that custom instructions are enabled by default for code review but can be disabled in repository settings. If a repo has custom instructions turned off for review, the file may exist in the branch and still not be applied.

A practical check is simple: put a small, obvious instruction change in the PR branch, request a Copilot review, and see whether the review reflects the new rule. If the review seems to ignore it, confirm that the repo has custom instructions enabled for code review and that the file lives on the head branch, not only on the target branch.

If you want the shortest accurate answer, it is this: yes, Copilot code review can read instructions from the PR branch now, because GitHub documents that it reads those instruction files from the head branch during review.

For teams, that means review rules can travel with the change they describe. A branch that adds a new security checklist, a new file path rule, or updated architecture guidance can be reviewed with those same instructions in play. That reduces the gap between the policy you want and the policy Copilot actually uses during review.

If you are building workflow docs around this, keep one detail straight: “read from the PR branch” means the head branch of the pull request. It does not mean the branch being merged into, and it does not mean any instruction file anywhere in history. It means the current contents of the PR branch at review time.

If you are documenting the pattern for a team, the clean rule is: place review instructions in the same branch that contains the code change, keep them specific, and verify them in a real review. That is the version GitHub supports today, and it is the version that avoids the common mistake of editing only the base branch and expecting Copilot to use it immediately.

For more context on the docs and file locations, see GitHub’s Copilot code review guidance and repository custom instructions pages. If you want a nearby workflow reference for your own product page, DevConnect is described at https://devconnectplatform.com.

Frequently asked questions

Does Copilot code review use base-branch instructions at all

GitHub documents that code review reads the instruction files from the pull request’s head branch. The base branch is not the source Copilot uses for those review instructions.

Which instruction files can Copilot code review use

GitHub documents repository-wide instructions, path-specific instructions, and agent instructions or skills. The review docs point to `.github/copilot-instructions.md`, `.github/instructions/**/*.instructions.md`, and `AGENTS.md` for related context.

Can Copilot ignore an instruction file in the PR branch

Yes. GitHub says Copilot behavior is non-deterministic and long or vague instruction files can be overlooked. The file can be present in the head branch and still not produce the exact review you expected.

How do I test whether my PR-branch instructions are being read

Make a small obvious change to the instruction file in the head branch, request a Copilot review, and check whether the review reflects that change. Also confirm that custom instructions for code review are enabled in the repository settings.

Know someone stuck on this? Send them the answer.

Sources

Every link here was fetched and confirmed to resolve before this page went live.

More on this topic: Building with AI

Related questions

Not the question you had?

Ask it. Every source gets fetched and checked before anything goes up, so it takes a day or two, and questions that cannot be answered honestly do not get a page at all.

No account, no email address needed.

Everyone here builds with AI, and says so

DevConnect is for developers who use AI and are honest about it. The interesting part is not that the code was generated, it is what you did with it afterwards.