Repository custom instructions give Copilot repository-specific guidance on GitHub. Three types are supported: repository-wide, path-specific and agent instructions.
What it does
Where GitHub Copilot custom instructions runs and what it adds, from its documentation
Repository-wide instructions in .github/copilot-instructions.md
Path-specific instructions in NAME.instructions.md under .github/instructions
Agent instructions via AGENTS.md files anywhere; nearest one wins
Alternatively a single CLAUDE.md or GEMINI.md in the repository root
Copilot cloud agent can generate a copilot-instructions.md from a prompt
When to use it
Good fit
You want Copilot to follow repo build and validation steps
Different paths need different Copilot guidance
Not for
Task-specific instructions: GitHub's generation prompt says instructions must not be task specific
How to install GitHub Copilot custom instructions
You need: GitHub Copilot; For code review, personal custom-instructions setting enabled (default)
Create .github/copilot-instructions.md in the repository
Write repo summary, build, test and validation steps
For path rules add NAME.instructions.md files under .github/instructions
Or ask Copilot cloud agent at github.com/copilot/agents to generate the file
Commit the files to the repository
Limitations
GitHub's generation prompt asks for instructions no longer than 2 pages
Feature support varies by type; see GitHub's customization overview