Instruction files are text files that inject persistent context into your AI coding assistant — they tell it about your project, coding standards, and preferences without you repeating yourself every session.

30-second version: Every time you start a Copilot session, you can make it read a file that describes your project. This means Copilot knows your tech stack, naming conventions, and preferences before you say a word. These files don’t give Copilot new abilities — they give it better context.

⚠️ Instruction files are NOT agents. Despite names like AGENTS.md, these files are plain text — they’re read as prompt context, not executed. Calling a file AGENTS.md does not create an agent. It tells agents what to do. The agent is still the agent. The file is just instructions.

The main instruction files

FileWho reads itWhat it’s for
.github/copilot-instructions.mdGitHub Copilot (IDE + coding agent)Project-wide Copilot behaviour: stack, style, preferences
AGENTS.mdCopilot coding agent + other agentic toolsAgent-specific rules: how to run tests, what to avoid, PR conventions
.cursorrulesCursorProject-specific Cursor behaviour
CLAUDE.mdAnthropic’s Claude coding agentInstructions for Claude when it works on your codebase

AGENTS.md is a community-driven convention, not a GitHub-owned specification. Different tools interpret it differently. Always check the documentation for your specific tool.

What to put in instruction files

  • Your tech stack and language versions
  • Coding style preferences (e.g., “use TypeScript strict mode”, “prefer functional patterns”)
  • Testing conventions (e.g., “always write unit tests for new functions”)
  • What NOT to do (e.g., “don’t use deprecated APIs”, “don’t commit secrets”)
  • Project structure overview (e.g., “API routes are in /src/routes/”)
  • PR and commit message conventions

copilot-instructions.md vs AGENTS.md

copilot-instructions.md is read by Copilot in every context — inline suggestions, chat, agent mode. AGENTS.md is read specifically by agentic workflows and the Copilot coding agent. If you only write one, start with copilot-instructions.md. You can always add AGENTS.md later when your agentic workflows become more complex and need their own rules.

Dive deeper

Related Concepts

📍 Layer 4a — Instructions · Back to the AICA Onion

What’s next?

Updated: