# Copilot instructions

> Canonical: https://skillalmanac.com/glossary/copilot-instructions | Last verified: 2026-11-24 | Index status: not offered to search engines

Copilot instructions are Markdown files, most often .github/copilot-instructions.md, that give GitHub Copilot standing guidance about a repository, such as build steps and coding conventions, so the user does not repeat it in each request.

Also called: copilot-instructions.md, GitHub Copilot instructions, Copilot custom instructions, copilot repository instructions.

## In plain language

Copilot instructions are a note you leave in your project that GitHub Copilot reads before it helps. Instead of typing 'we use tabs and run tests with this command' in every chat, you write it once in a file in the repository. Think of the notes you would give a new colleague on their first day. GitHub's documentation describes three forms: one file for the whole repository, files that apply to matching paths, and agent instruction files. The main limitation is that the file is guidance, not enforcement. Copilot can still get things wrong, so you still review its work. Do not put secrets in it, because the file lives in your repository.

## Technical definition

GitHub's documentation describes repository custom instructions in three forms. Repository-wide instructions live in .github/copilot-instructions.md and apply to requests made in the context of that repository. Path-specific instructions are NAME.instructions.md files in or below .github/instructions, each starting with frontmatter whose applyTo glob sets the files covered; an excludeAgent value of code-review or cloud-agent keeps a file from one feature. Agent instructions are AGENTS.md files, where the nearest one in the directory tree takes precedence, or a single CLAUDE.md or GEMINI.md at the root. For Copilot Chat on GitHub.com the documented precedence is personal, then repository, then organization instructions; other surfaces such as Visual Studio Code combine applicable files without a defined order.

## How it shows up when you use agents

If your team uses GitHub Copilot, the file `.github/copilot-instructions.md` is where repository-wide guidance lives. GitHub's documentation says it applies to requests made in the context of that repository. Copilot Chat on GitHub.com uses it when you attach the repository to a conversation, and Copilot code review reads repository instructions too, from the pull request's head branch. Path-specific files in `.github/instructions` let you give different advice to different parts of a codebase.

It sits in the same family as other [agent instruction files](/glossary/agent-instruction-file). GitHub's documentation also lists `AGENTS.md`, `CLAUDE.md` and `GEMINI.md` as agent instructions, so one repository can serve several tools. The guide [CLAUDE.md vs AGENTS.md](/learn/agents-md-vs-claude-md) explains how to avoid keeping two copies of the same rules. GitHub's pages describe instructions as text added to Copilot's context for the request; this entry compares that to a [system prompt](/glossary/system-prompt) as an analogy.

What breaks when this is misunderstood: people write long, generic files, treat them as guaranteed rules, or assume every Copilot surface reads them the same way. GitHub notes that other surfaces combine files without a defined precedence. Next action: keep the file short and specific, then test it by asking Copilot to do a task that depends on it and checking the result.

## Common confusions

- **Copilot instructions versus personal instructions.** Personal instructions cover your own conversations. Repository instructions apply to work in a repository, and organization instructions apply to members of an organization.
- **Repository-wide versus path-specific.** The repository-wide file applies broadly. Path-specific files use an `applyTo` glob, and GitHub says that when both match, both are used.
- **Copilot instructions versus AGENTS.md.** They are separate formats. GitHub's documentation lists AGENTS.md as agent instructions, with the nearest file taking precedence.
- **Myth: instructions guarantee compliance.** They are guidance sent to a model. Review the output as you would any suggestion.

## Worked examples in this catalogue

### [CLAUDE.md vs AGENTS.md: Which Agents Read Which File](https://skillalmanac.com/learn/agents-md-vs-claude-md)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A comparison of CLAUDE.md and AGENTS.md: which agents read each file, how Claude Code and Codex load them, and how to keep one source of truth.

Why it exercises the concept: GitHub's documentation lists AGENTS.md and CLAUDE.md as agent instruction files, so this guide explains the sibling formats Copilot can also read.

### [agent-instruction-files](https://skillalmanac.com/skills/skill-almanac/agent-instruction-files)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A skill for writing instruction files where every line is project-specific, verified against the repo, and worth loading on every session.

Why it exercises the concept: It applies to a copilot-instructions.md file as it does to any instruction file: keep only lines that are specific to the project.

### [GitHub Copilot](https://skillalmanac.com/tools/github-copilot)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: GitHub's documentation for repository custom instructions, which describes where Copilot looks for instruction files and which Copilot features, such as Copilot Chat on GitHub.com and code review, use them.

Why it exercises the concept: GitHub Copilot is the tool that reads these files, so its own documentation is the authority on where they go and how they combine.

## Related terms

- [Agent instruction file](https://skillalmanac.com/glossary/agent-instruction-file.md)
- [System prompt](https://skillalmanac.com/glossary/system-prompt.md)
- [AI copilot](https://skillalmanac.com/glossary/ai-copilot.md)
- [AI coding assistant](https://skillalmanac.com/glossary/ai-coding-assistant.md)
- [Prompt engineering](https://skillalmanac.com/glossary/prompt-engineering.md)
- [Context engineering](https://skillalmanac.com/glossary/context-engineering.md)

## Sources

- [Adding repository custom instructions for GitHub Copilot](https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot), GitHub Docs (accessed 2026-11-24)
- [About customizing GitHub Copilot responses](https://docs.github.com/en/copilot/concepts/prompting/response-customization), GitHub Docs (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
