Copilot code review¶
Copilot reviews every pull request into main. This page records what it reads here, how it is
configured, and what was decided about it (#27).
What it reads¶
From the pull request's head branch, not from main:
| File | Here | Scope |
|---|---|---|
.github/copilot-instructions.md |
yes | every review: review focus, verification, settled decisions |
.github/instructions/*.instructions.md |
skills.instructions.md |
only when a changed file matches its applyTo |
CLAUDE.md (root) |
yes | the hard rules for scripts; written for Claude Code, read by Copilot as agent instructions |
AGENTS.md, GEMINI.md, REVIEW.md |
none | would also be read |
skills in .claude/skills/, .github/skills/, .agents/skills/ |
skill-audit |
loaded when Copilot judges them relevant |
It also opens other files of the repository while reviewing: past reviews cite
.claude/rules/writing-skills.md by line.
Keep each instruction file under 4,000 characters. GitHub's documentation once said that code review reads only the first 4,000 characters of an instruction file. The current pages do not mention it, so the limit stays as a safe ceiling.
Two more limits: links to outside pages are not followed, so copy what matters into the file, and instructions about the format of comments or the overview are ignored.
The split between the files:
copilot-instructions.mdsays what to look for and what is already settled.CLAUDE.mdholds the rules themselves, so they are written once.- A path-specific file carries what only matters for some paths.
Why the instructions say what they say¶
They come from what Copilot flagged on #28, #33 and #43 (27 inline findings across their pushes; #39 and #46 were approved without any):
- Useful, kept as focus: caps without pagination (
--limit 500, GraphQLfirst:) read as "none found"; repository-derived text in a double-quoted shell command; a plan path escaping its directory; a temporary file not removed whenghfails; a remote write before a fallible read; a new guarantee without a test that exercises it. - Wrong, now a "verify before you claim" rule: on #33 it said
gh search issueshas no-R(gh search issues --helplists-R, --repo). On #28 it treatedSTARTUP_FAILUREas pending becauseghdoes, missing that a run that never started never finishes. - Settled, re-raised on later pushes: SK-5 (owner narrowed it), and SK-31/SK-32 real-task and clean-machine runs that cannot run on native Windows and were moved to #31. The instructions now treat a rejected thread and a requirement tracked in a named issue as settled.
The head branch can steer the review¶
Because Copilot reads instructions and skills from the head branch, a pull request can change what its own reviewer is told—remove a rule, or add "approve this". That is by design (it lets an instruction change be tested in the pull request that makes it) and cannot be switched off.
Why it is acceptable here:
- The repositories are private; only the owner and the owner's agents push.
- Copilot's review is advice. Merging needs no approval from it; the owner merges.
copilot-instructions.mdasks Copilot to comment on any change to reviewer input and to treat a removed rule that would have flagged the same pull request as a finding. A malicious head could delete that sentence too, which is why the diff of these files is what a human checks.
What would change that: a public repository, outside contributors, or Copilot's review becoming a
required approval. Then the reviewer input would need a CODEOWNERS entry and a required owner
review for .github/, CLAUDE.md, .claude/ and plugins/*/skills/.
excludeAgent. No file carries excludeAgent: "code-review": everything Copilot reads here is
meant for it too. skills.instructions.md carries excludeAgent: "cloud-agent" because it is about
reviewing, not writing, skills. CLAUDE.md cannot carry frontmatter.
Ruleset¶
The Copilot review rule is part of the live ruleset main:
| Setting | Live value | Why |
|---|---|---|
| Review new pushes | off | A pull request gets one Copilot review, when it is marked ready (pr-watch request-review). A fix push is not reviewed again (Credits), and babysit-pr caps a pull request at 3 AI review rounds. |
| Review draft pull requests | off | pull-request opens every pull request as a draft. With this on, Copilot's one review would come when the draft is opened, before its checks ran, instead of on ready. |
.github/rulesets/main.json records the review-on-push value, but has the draft setting on, so
the file and the live ruleset disagree. Which one is intended is the owner's choice. The live ruleset also
differs from the file in the code owner review and the merge methods
(codeowners.md). It does require the validate check. Changing a
ruleset needs admin rights and is the owner's step (Settings → Rules → Rulesets).
To compare the live state with the file:
gh api repos/<owner>/claude/rules/branches/main --jq '.[] | "\(.type) \(.ruleset_id) \(.parameters // {})"'
Credits¶
Copilot's reviews are paid from the monthly premium-credit meter of the account that asks for
them—the account gh acts as when pr-watch request-review runs. Billing is by tokens: on the
first day of a month 5 reviews used 990 of 7000 credits, about 200 each, which would last about
35 reviews a month (#517). So pr-watch request-review spends them on purpose:
| Rule | What happens |
|---|---|
| One review per pull request | Copilot is asked when the PR is marked ready. After its review, request-review refuses; claude-review covers the later heads. |
| Small changes | A PR that changes only docs/, a plugin's README.md or a CHANGELOG.md, or only the "version" line of plugin manifests gets no request. |
| The meter | At 80 % of the entitlement used (gh api copilot_internal/user, quota_snapshots.premium_interactions), no request until the month resets or the owner says otherwise. |
| The owner's word | request-review --by owner --reason "…" asks again or past a skip; the 3-round cap still holds. |
A skipped request posts a [babysit-pr] Copilot review skipped: <reason> comment on the PR,
with a Head: <sha> line. For that head, and from an author with write access, pr-watch
snapshot and list (copilot_skipped) and the coordinator's merge check count it as the
review, the way they count a waiver. A later head is judged again, so code pushed after a
docs-only skip gets its review. The meter endpoint is internal and may change: when it
cannot be read, nothing stops, and the one-review rule still holds. claude-review is not limited
by any of this.
The Claude partner agent¶
GitHub's third-party coding agents (Agent HQ) include Claude, in public preview. It is enabled per
account or organisation under the Copilot cloud agent policies ("Allow Claude coding agent"), which
installs the anthropic code agent app. An issue can be assigned to it, it can be mentioned in a
pull request comment, or started from the Agents tab; it opens a pull request and requests a review
from the person who started it. It uses Actions minutes and AI credits. GitHub does not document
whether it reads CLAUDE.md or .claude/skills/.
Trying it on one small issue and comparing it with a local session plus babysit-pr needs the owner
to enable it. That is tracked in #52, separately from #27.