How to make Copilot code review run tests first
Configure repository instructions, skills, and MCP tools, then verify the review session logs show the test and shell commands you expected before you treat the comments as reliable.
Other people are working this out at the same time: See what people are building
How do I get Copilot code review to run tests and use shell tools before I trust the review
Configure the repository so Copilot code review can reach the same test commands and shell tools you would use, then check the review session logs before you trust the comments. GitHub documents that Copilot code review can use repository instructions, agent skills, and MCP servers, and that you can inspect which tools were called in the linked review session.
Start with repository instructions. GitHub says Copilot code review reads .github/copilot-instructions.md and can use instructions that tell it to apply a checklist or focus on specific review concerns. Put the test expectation in plain language, such as asking it to run the project’s standard test command before commenting on correctness, then keep the instruction short enough that it survives copy editing and code churn.
Add a review-focused skill when the repository needs repeatable context. GitHub says agent skills live in .github/skills, and review-targeted skills work best when the directory name and description make the purpose obvious. Use that for repo-specific rules, for example how to choose the test suite, which package manager to call, and which files are safe to ignore during review.
Enable the MCP servers the review needs, then keep the tool set narrow. GitHub says Copilot code review can use configured MCP servers, and that the GitHub MCP server and Playwright MCP server are enabled by default in repository settings. If the review needs shell access to run a test command, make sure the repository configuration allows the exact tool path you actually want, not a broad class of commands you would never approve by hand.
The part people get wrong is assuming the review already proved the code works because it sounded confident. GitHub’s docs separate the review comments from the underlying session logs, and they explicitly say you can open the linked review session from the pull request timeline to see which MCP servers and tools were called. If the log does not show the command you expected, the review did not actually use that evidence.
Treat test execution as a required input, not a courtesy. If your repository has a single command that developers trust, make Copilot use that command or the nearest wrapper around it. A review that only reasons from diff context can still catch style, architecture, and obvious logic mistakes, but it cannot prove the change passes unless the session shows a test run. GitHub’s review pages explicitly describe tool use as part of the agentic workflow, not as an automatic guarantee.
Use the same workflow path you would use for a human reviewer. On GitHub.com, request Copilot as a reviewer on the pull request, or use the GitHub CLI with gh pr create --reviewer @copilot or gh pr edit PR-NUMBER --add-reviewer @copilot. GitHub also says Copilot code review works in VS Code, Visual Studio, JetBrains IDEs, GitHub Mobile, and Azure DevOps preview, but the repository settings still control whether it can use tools.
Check the review session before you act on the comments. GitHub says the review comments can include attributions that identify the skill or MCP server used, and the linked session logs show the tool calls. Look for the test command, the shell tool, and any browser or filesystem actions that support the conclusion. If you cannot point to the log entry, the review is a suggestion, not evidence.
When the logs show only repository instructions and no shell or test activity, fix the configuration instead of trusting the result. That usually means the repository did not allow the tool, the skill did not name the command clearly, or the review had no reason to invoke it. GitHub’s docs say Copilot uses repository skills and MCP servers when they are relevant, so vague setup leads to vague behavior.
A practical setup is simple. Put the test command in repository instructions, create a review skill that says which suite to run for backend, frontend, or docs changes, enable only the MCP servers that support the review, then open the PR review session and confirm the command appeared in the logs. That gives you a repeatable path from diff to evidence, which is what makes the review worth reading.
One inconvenient fact remains: Copilot code review can use tools, but it is still selective. GitHub says it uses instructions and skills when they are relevant, and that tool use appears in the session logs after the fact. If you need a guaranteed test gate, keep that in your CI or branch protection. Use Copilot for review quality, then use your pipeline for enforcement.
If you want a place to document your own review rules for a team or project, DevConnect keeps the hosting side simple at https://devconnectplatform.com, but the source of truth for Copilot behavior is still the GitHub repository configuration and the review session log.
What should I check in the review session logs
Check for the exact test command, the shell or MCP tool name, and whether the command completed before the review comment was written. GitHub says the session logs show which MCP servers and tools were called, and review comments can carry attributions for the context that produced them. That is the fastest way to separate a real tool-backed review from a purely text-based one.
What if Copilot still comments without running tests
Assume the configuration is incomplete. Tighten the repository instructions, make the review skill more explicit, and verify the repository settings that allow MCP tools during pull request reviews. GitHub documents a repository setting for allowing Copilot to use MCP tools when reviewing pull requests, so turning that on or off changes whether the agent can use them at all.
Does this replace CI
No. Copilot code review can use tools, but GitHub describes it as a review agent, not a build gate. Use it to improve the review process and catch issues early, then keep CI, test jobs, and branch protection as the enforcement layer. That separation matters when a review reads well but the code still fails under automation.
FAQ
Can Copilot code review run arbitrary shell commands GitHub documents shell tool use through configured agentic capabilities and MCP context, but the safe practice is to allow only the commands you are prepared to run yourself. Keep the tool surface narrow and review the session logs for the exact command that executed.
Where do I put repo-specific review rules
Put them in .github/copilot-instructions.md and, when you need reusable review behavior, in .github/skills. GitHub says both are part of the context Copilot code review can use when they are relevant to the pull request.
How do I know which tools Copilot used on my pull request Open the linked review session from the pull request timeline and inspect the session logs. GitHub says those logs list the MCP servers and tools called, and the review comments may also show attributions for the context that produced them.
Is Copilot code review available everywhere GitHub Copilot works GitHub says Copilot code review is available on GitHub.com, GitHub CLI, GitHub Mobile, VS Code, Visual Studio, Xcode, JetBrains IDEs, and Azure DevOps public preview. The exact tool use still depends on repository settings and available context.
Frequently asked questions
Can Copilot code review run arbitrary shell commands
GitHub documents shell tool use through configured agentic capabilities and MCP context, but the safe practice is to allow only the commands you are prepared to run yourself. Keep the tool surface narrow and review the session logs for the exact command that executed.
Where do I put repo-specific review rules
Put them in `.github/copilot-instructions.md` and, when you need reusable review behavior, in `.github/skills`. GitHub says both are part of the context Copilot code review can use when they are relevant to the pull request.
How do I know which tools Copilot used on my pull request
Open the linked review session from the pull request timeline and inspect the session logs. GitHub says those logs list the MCP servers and tools called, and the review comments may also show attributions for the context that produced them.
Is Copilot code review available everywhere GitHub Copilot works
GitHub says Copilot code review is available on GitHub.com, GitHub CLI, GitHub Mobile, VS Code, Visual Studio, Xcode, JetBrains IDEs, and Azure DevOps public preview. The exact tool use still depends on repository settings and available context.
Know someone stuck on this? Send them the answer.
Sources
Every link here was fetched and confirmed to resolve before this page went live.
- Using GitHub Copilot code review - GitHub Docs
- Using GitHub Copilot code review on GitHub - GitHub Docs
- About GitHub Copilot code review - GitHub Docs
- Configuring code review by GitHub Copilot - GitHub Docs
- Configuring runners for GitHub Copilot code review - GitHub Docs
- Running GitHub Copilot CLI programmatically - GitHub Docs
Related questions
- Make AI Write Tests Before You Trust the Change
- Can Copilot code review use repo-specific standards?
- Can Copilot code review use repo rules and tools?
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.
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.