GitHub / Microsoft · VS Code agent mode · JetBrains, Visual Studio & others · Copilot CLI · Copilot coding agent (github.com)
GitHub Copilot rules files explained
Which instruction files GitHub Copilot reads (.github/copilot-instructions.md, .github/instructions/*.instructions.md, AGENTS.md), where to put them, and how to convert from other agents.
Files Copilot reads
.github/copilot-instructions.md.github/instructions/*.instructions.mdAGENTS.md
AGENTS.md: Yes on most surfaces (cloud agent, CLI, VS Code chat, code review); not Copilot Chat on GitHub.com.
Who reads what
| Agent | Rules files | AGENTS.md |
|---|---|---|
| Claude | CLAUDE.md, .claude/rules/*.md | Only when no CLAUDE.md / CLAUDE.local.md exists (default, v2.1.277+); or import it with @AGENTS.md |
| Codex | AGENTS.md, AGENTS.override.md | Yes: global ~/.codex/AGENTS.md plus one AGENTS.md (or AGENTS.override.md) per directory from the repo root down |
| Cursor | .cursor/rules/*.mdc, AGENTS.md, .cursorrules (legacy) | Yes, in the project root and in subdirectories (nested files combine) |
| Copilot | .github/copilot-instructions.md, .github/instructions/*.instructions.md, AGENTS.md | Yes on most surfaces (cloud agent, CLI, VS Code chat, code review); not Copilot Chat on GitHub.com |
| Antigravity | AGENTS.md, GEMINI.md, .agents/rules/*.md | Yes: AGENTS.md or GEMINI.md at any directory level, always on |
Copilot's three kinds of repository instructions
GitHub documents three ways to give Copilot repository instructions. Repository-wide instructions go in .github/copilot-instructions.md. Path-specific instructions go in one or more NAME.instructions.md files under .github/instructions, each starting with frontmatter whose applyTo key takes globs such as "app/models/**/*.rb" or "**/*.ts,**/*.tsx". Agent instructions can live in AGENTS.md files anywhere in the repository, where the nearest one in the directory tree takes precedence, or in a single CLAUDE.md or GEMINI.md at the root. Files are plain Markdown written in natural language.
On GitHub.com, path-specific instructions currently apply only to Copilot cloud agent and Copilot code review. For code review, your personal setting to use custom instructions must be on, which is the default.
You do not have to start from scratch: GitHub publishes a prompt that asks Copilot cloud agent to onboard a repository by writing .github/copilot-instructions.md, and the first time cloud agent opens a pull request in a repository it leaves a comment linking to that generation step.
Source: docs.github.com · Checked Oct 24, 2026
Guides, pricing & comparisons
How to add an MCP server to GitHub Copilot in VS Code
Portable agent skills: one SKILL.md for every coding agent
GitHub Copilot CLI yolo mode: --allow-all and safer tool rules
Agent Skills moves to the Agentic AI Foundation: what changes
MCP security: the risks in MCP servers and how to lock them down
GitHub Copilot CLI: install, sign in and start using it
GitHub Copilot coding agent (now cloud agent): how to use it
GitHub Copilot agent mode: how to use it in your IDE
GitHub Copilot skills: create, install and use agent skills
Fix spawn npx ENOENT when starting an MCP server
MCP connection closed: find why a server will not connect
Claude Code vs GitHub Copilot: documented features compared
Cursor vs GitHub Copilot: documented features compared
OpenAI Codex vs GitHub Copilot: documented features compared
GitHub Copilot pricing and AI credits
AGENTS.md vs CLAUDE.md vs Cursor rules
AGENTS.md templates for Laravel and Next.js
MCP servers that work in every coding agent