← All notes

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

Claims

Sources

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

Permanent ID: iil:note:081mxe5v

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.},
}

Markdown

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.

All artifact files (JSON index)

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.