Rules & instructions Official

GitHub Copilot custom instructions

Repository custom instructions for GitHub Copilot: .github/copilot-instructions.md, path-specific files and AGENTS.md.

Author
GitHub
Works with
GitHub Copilot
Documented
Oct 2, 2026

What GitHub Copilot custom instructions is

Repository custom instructions give Copilot repository-specific guidance on GitHub. Three types are supported: repository-wide, path-specific and agent instructions.

What it does

How GitHub Copilot custom instructions plugs in: which agents run it and what it addsRUNS INYour agentGitHub Copilotone host documentedRULES · OFFICIALGitHub Copilot custom instru…Project instructions the agent re…5 install stepsno extra permissions listedWHAT IT ADDSWhat it doesRepository-wide instructions in .…Path-specific instructions in NAM…Agent instructions via AGENTS.md…Alternatively a single CLAUDE.md…agent → extension → new capability · from the official repository or docs
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)

  1. Create .github/copilot-instructions.md in the repository
  2. Write repo summary, build, test and validation steps
  3. For path rules add NAME.instructions.md files under .github/instructions
  4. Or ask Copilot cloud agent at github.com/copilot/agents to generate the file
  5. 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

Tools it extends

GitHub Copilot

Web · Desktop · Mobile

No user reviews yet

AI coding assistant from GitHub offering code completions, chat and agent features in editors, the terminal and GitHub.

Free stops at: 2,000 completions per month, Limited chat and agent usage (allowance of GitHub AI Credits)

Listed Not yet reviewed

Verified github.com (opens GitHub Copilot website in a new tab)

Free · paid from $10/mo US · checked Sep 30

Frequently asked questions

Where does the Copilot repository-wide instructions file go?

.github/copilot-instructions.md in the repository. source

How do I write path-specific Copilot instructions?

Create NAME.instructions.md files within or below .github/instructions. source

Does Copilot read AGENTS.md?

Yes, agent instructions use AGENTS.md; the nearest file takes precedence. A root CLAUDE.md or GEMINI.md also works. source

Do path-specific and repository-wide instructions combine?

Yes, when a path matches and a repository-wide file exists, both are used. source

Sources and gaps

Not stated by the maintainers: repo_url is GitHub's public docs repo, not a rules repo; github-copilot is not in our catalog.

More extensions to look at