AI / GitHub Copilot CLI Fundamentals Interview Questions
What is the AGENTS.md file and how does it differ from copilot-instructions.md?
Both files customise how Copilot behaves in a repository, but they serve different purposes and have different scopes.
| Feature | AGENTS.md | copilot-instructions.md |
|---|---|---|
| Purpose | Define custom instructions and tool access for agentic sessions - used by Copilot when working autonomously | Provide project context: build commands, architecture, conventions for all Copilot interactions |
| Scope | Agentic/autonomous sessions (Plan, Autopilot, /fleet) | All Copilot CLI sessions including chat |
| Contents | Agent behaviour rules, which skills/tools are permitted, task-specific instructions | Build commands, test commands, architecture overview, coding style |
| Cross-session consistency | Ensures behaviour stays consistent across models, sessions, and delegated work | Ensures Copilot has project context on every session |
| Generated by | Created manually or by /init for agent-specific needs | Generated or updated by /init |
When to use each:
- Use copilot-instructions.md to give Copilot general project knowledge that applies to all interactions (how to build, test, understand the codebase)
- Use AGENTS.md to define the rules and constraints for autonomous agent sessions specifically - what tools an agent can use, what actions it should or shouldn't take, task-specific behavioural guidelines
More Related questions...