GitHub Copilot repository instructions and AGENTS.md are distinct files
Answer: GitHub Copilot supports repository-wide instructions in .github/copilot-instructions.md and path-specific files under .github/instructions. Agent instruction files are another supported category.
Scope
Repository-wide instructions apply to requests in that repository's context. Path-specific NAME.instructions.md files apply to matching paths. When both match, instructions from both files are used.
For agent instructions, GitHub documents that the nearest AGENTS.md in the directory tree takes precedence.
Format
The AGENTS.md project defines a simple open format for guiding coding agents. Its sample file covers dev environment tips and testing instructions.
See also
- ao-rules-gemini-md-hierarchy
- ao-rules-opencode-discovery
- ao-rules-agents-md-evidence
- ao-rules-context-files-in-practice
Claims
- id: C1 claim: Copilot repository-wide instructions are in the .github directory. source: S1 evidence: "a
copilot-instructions.mdfile in the.githubdirectory"
- id: C2 claim: The nearest AGENTS.md takes precedence in the documented GitHub agent behavior. source: S1 evidence: "the nearest
AGENTS.mdfile in the directory tree will take precedence."
- id: C3 claim: AGENTS.md is an open format for coding agents. source: S2 evidence: "is a simple, open format for guiding coding agents."
Sources
- [S1] Adding repository custom instructions for GitHub Copilot. GitHub Docs. https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions . License: CC BY 4.0. Accessed 2026-11-16.
- [S2] AGENTS.md README. agentsmd/agents.md (GitHub). https://github.com/agentsmd/agents.md/blob/main/README.md . License: MIT. Accessed 2026-11-16.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, Adding repository custom instructions for GitHub Copilot, CC BY 4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.; agentsmd/agents.md (GitHub), AGENTS.md README, MIT (https://raw.githubusercontent.com/agentsmd/agents.md/main/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: GitHub Docs, Adding repository custom instructions for GitHub Copilot, CC BY 4.0 (https://raw.githubusercontent.com/github/docs/main/LICENSE). Copyright GitHub, Inc.; agentsmd/agents.md (GitHub), AGENTS.md README, MIT (https://raw.githubusercontent.com/agentsmd/agents.md/main/LICENSE).
Cite this
iinventedlight. 2026. "GitHub Copilot repository instructions and AGENTS.md are distinct files." iinventedlight Library, iil:note:081mxe5v, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-rules-copilot-repository-instructions/. License: CC-BY-4.0.
@misc{iil_note_081mxe5v,
author = {{iinventedlight}},
title = {{GitHub Copilot repository instructions and AGENTS.md are distinct files}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/ao-rules-copilot-repository-instructions/},
note = {Permanent ID iil:note:081mxe5v. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- ao-rules-copilot-repository-instructions.schema.json (schema; CC-BY-4.0)
- ao-rules-copilot-repository-instructions.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-rules-copilot-repository-instructions.md.