# copilot-instructions.md for an agent-to-agent review loop

URL: https://codepanel.ai/agents/files/copilot-instructions

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](/agents/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](/agents/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](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions), VS Code's [custom instructions](https://code.visualstudio.com/docs/agent-customization/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:

```text
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](/agents/files/agents-md#the-review-section) 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](/agents/files/cursor-rules) scope with `globs` |
| `.codepanel/rules.md` | What reviewers check a change against; [Repo context](/docs/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](/docs/other-agents) and [VS Code and GitHub Copilot](/docs/vs-code).

## Agents that read copilot-instructions.md

- [Copilot in VS Code](/agents/vs-code) reads `.github/copilot-instructions.md` ([code.visualstudio.com](https://code.visualstudio.com/docs/agent-customization/custom-instructions)).
- [GitHub Copilot CLI](/agents/copilot-cli) reads `.github/copilot-instructions.md` ([docs.github.com](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions)).
