Free toolGenerate .mcp.json configs for Claude Code, Cursor & Codex →
G

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.md
  • AGENTS.md

AGENTS.md: Yes on most surfaces (cloud agent, CLI, VS Code chat, code review); not Copilot Chat on GitHub.com.

Who reads what

AgentRules filesAGENTS.md
ClaudeCLAUDE.md, .claude/rules/*.mdOnly when no CLAUDE.md / CLAUDE.local.md exists (default, v2.1.277+); or import it with @AGENTS.md
CodexAGENTS.md, AGENTS.override.mdYes: 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.mdYes on most surfaces (cloud agent, CLI, VS Code chat, code review); not Copilot Chat on GitHub.com
AntigravityAGENTS.md, GEMINI.md, .agents/rules/*.mdYes: AGENTS.md or GEMINI.md at any directory level, always on
Convert your rules file →

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

Featured spot on the rules libraryReach developers choosing tools for their coding agent. Labeled, and it never affects ratings.

Guides, pricing & comparisons