Compare
Custom instructions vs prompt files vs custom agents
30-second answer
Custom instructions are rules Copilot adds to requests automatically (.github/copilot-instructions.md, or .instructions.md files with applyTo). A prompt file (.github/prompts/*.prompt.md) is a reusable request you run on demand with /name. A custom agent (.agent.md) is a named persona with its own instructions and tools.
Side by side
↔ Swipe the table to see every column.
| Repository instructions | Path-specific instructions | Prompt file | Custom agent | |
|---|---|---|---|---|
| File | .github/copilot-instructions.md | .github/instructions/*.instructions.md | .github/prompts/*.prompt.md | .github/agents/*.agent.md |
| When it applies | Every request in the repo | Requests about files matching applyTo | Only when you run /name | When you pick the agent |
| Good for | House style, stack, rules | Rules for tests, docs, a folder | Repeatable tasks done the same way | A role with limited tools |
| Used by | Chat, coding agent, code review | Chat, coding agent, code review | Chat in the IDE | IDE, CLI, coding agent |
Prices are illustrative pay-as-you-go list prices converted at approximate rates, for "price feel" only. Check the Azure pricing calculator for real quotes.
Which one should I pick?
Repository instructions
Pick it when every answer should follow the same team rules
Path-specific instructions
Pick it when rules only make sense for some files
Prompt file
Pick it when the team runs the same multi-step request again and again
Custom agent
Pick it when you want a specialist (test writer, reviewer) with its own tools
Simulate it
🖱️ Drag to rotate · scroll or pinch to zoom
Custom instructions
Repository instructions (.github/copilot-instructions.md) and path-specific .instructions.md files are added to requests automatically, so the house rules travel with every prompt.
🤔 What happens if…
Read this tour as text
- A vague prompt. Copilot only knows what is in the prompt. “Write a function” leaves it to guess the language, inputs, outputs and rules, so you get something generic.
- Structure: goal, context, constraints. A good prompt has a goal (what and why), context (which code, which framework) and constraints (style, edge cases, what not to do). Short is fine; vague is not.
- How context is chosen. In chat, Copilot uses the active file and any selection, plus what you add:
#file,#codebase(search your workspace),#terminalSelection, images, or a participant such as@workspace. Inline suggestions also use open tabs, so close unrelated ones. - Zero-shot and few-shot. Zero-shot: just the instruction. Few-shot: include one or more examples of the input and the output you want, then ask. Few-shot wins when your format is unusual.
- Break it down, then iterate. Split a big task into small steps and check each answer. Then iterate: keep what’s right and ask for the next change. Prompting is a conversation.
- Custom instructions. Repository instructions (
.github/copilot-instructions.md) and path-specific.instructions.mdfiles are added to requests automatically, so the house rules travel with every prompt. - Chat history is context too. Earlier messages in the same conversation go into the prompt. That helps follow-ups (“now add tests”) but old, unrelated turns can confuse the answer and fill the context window.
- The prompt process, end to end. Your words + selected context + instructions + history → the prompt. The model answers, you review, then refine. Better input, less clean-up.
Questions people ask
Does Copilot read AGENTS.md?
Yes, agents such as Copilot coding agent and Copilot CLI read AGENTS.md files as instructions, alongside .github/copilot-instructions.md.
Do instructions replace a good prompt?
No. They add standing rules; you still describe the task, the context and the outcome in each prompt.