copilot-instructions.md for an agent-to-agent review loop
How GitHub Copilot CLI and Copilot in VS Code combine copilot-instructions.md with AGENTS.md, CLAUDE.md and GEMINI.md, and where the review loop belongs.
.github/copilot-instructions.md holds repository-wide instructions for GitHub Copilot. Copilot CLI and Copilot in VS Code read it alongside AGENTS.md and the other instruction files they support, and combine them all, with no file overriding another. For a review loop, keep the loop in AGENTS.md, which both read, and use this file only for what concerns Copilot alone.
Who reads it, and with what
| Agent | Reads alongside it | How the files combine |
|---|---|---|
| GitHub Copilot CLI | .github/instructions/**/*.instructions.md, AGENTS.md, CLAUDE.md, GEMINI.md, from the root, the working directory, the directories between and those on the path to a file it works on |
All of them, with identical copies removed and no precedence order |
| Copilot in VS Code | .github/instructions/**/*.instructions.md, AGENTS.md, and CLAUDE.md in the Local harness |
Additive; VS Code's docs say not to rely on any order to settle a conflict |
Sources: Copilot CLI's custom instructions, VS Code's custom instructions.
Since nothing wins, two files that disagree leave the model to pick. The review loop written in AGENTS.md and again, slightly differently, in copilot-instructions.md is the usual way that happens.
What Copilot CLI loads, checked
Copilot CLI 1.0.98 lists every instruction source it would load with copilot instruction list, without starting a session. In a test repository with .github/copilot-instructions.md, AGENTS.md, CLAUDE.md and GEMINI.md at the root, it listed all four as repository instructions, and a .github/instructions/ts.instructions.md file as well. Run from src/, it added a nested src/AGENTS.md as a working-directory instruction.
Duplicates collapse in two ways:
| Setup | Listed as |
|---|---|
| CLAUDE.md a symlink to AGENTS.md | One source, AGENTS.md + CLAUDE.md |
| copilot-instructions.md a byte-for-byte copy of AGENTS.md | .github/copilot-instructions.md only |
In CodePanel's own repository, where AGENTS.md is a symlink to CLAUDE.md and there is no copilot-instructions.md, it listed a single source:
Repository instructions:
• AGENTS.md + CLAUDE.md
from AGENTS.md + CLAUDE.md
A copy that has drifted by a character is no longer identical, and both versions load: with one ! added, Copilot CLI listed both files.
What belongs in which file
| File | Put there |
|---|---|
| AGENTS.md | The review loop and how to work in the repository, for every agent. AGENTS.md covers the section |
.github/copilot-instructions.md |
Only what applies to Copilot and no other agent, or nothing |
.github/instructions/**/*.instructions.md |
Conventions for some paths, scoped with applyTo the way Cursor rules scope with globs |
.codepanel/rules.md |
What reviewers check a change against; Repo context |
Both agents follow references from this file: Copilot CLI expands @path references in copilot-instructions.md, AGENTS.md and CLAUDE.md, and VS Code resolves Markdown links relative to the file. A copilot-instructions.md that only needs to say "read AGENTS.md" adds nothing, since both read AGENTS.md anyway.
Copilot CLI picks up a changed file in a new or resumed session, not the running one.
The agent name in the review section
CodePanel counts Copilot CLI and Copilot in VS Code as two agents, so the name on each rating matters. Copilot CLI's MCP client identifies itself as copilot-cli, and that is the name rate_finding falls back to when the agent passes none. A review section shared by both should tell the agent to use --agent copilot-cli in the terminal and --agent vs-code in the editor, so each one's ratings stay together. Setup for both is in Other MCP clients and VS Code and GitHub Copilot.
Agents that read copilot-instructions.md
- Copilot in VS Code reads
.github/copilot-instructions.md(code.visualstudio.com). - GitHub Copilot CLI reads
.github/copilot-instructions.md(docs.github.com).
Read next
AGENTS.md for an agent-to-agent review loop
What to put in AGENTS.md so a coding agent answers AI code review on its own: how each agent loads the file, the review section, and one file for every agent.
CLAUDE.md for an agent-to-agent review loop
What to put in CLAUDE.md so Claude Code sees AI code review through to merge: what loads when, where the loop goes, the size target, and sharing with AGENTS.md.
Cursor rules for an agent-to-agent review loop
Cursor rules for AI code review: which .mdc rule type to use, scoping a rule with globs like a .codepanel/rules.md section, and when to use AGENTS.md.
GEMINI.md for an agent-to-agent review loop
What Gemini CLI loads from GEMINI.md, why it skips AGENTS.md by default, and three ways to give it the same review instructions as every other agent.