Guide
Copilot instructions in VS Code: every file it reads, and the personal one
Copilot in VS Code reads `.github/copilot-instructions.md`, `.instructions.md` files, `AGENTS.md` and your personal `~/.copilot/copilot-instructions.md`, which applies in every project. Its separate Memory feature is off by default in VS Code.
Ahmet Karaca · · Updated
Which files does Copilot read?
.github/copilot-instructions.mdin a repository: instructions for that project, committed with the code..github/instructions/**/*.instructions.md: instructions attached when a file matches theapplyToglob in the front matter, or when the agent finds thedescriptionrelevant to the task.AGENTS.mdat the repository root: a format several agents share, Codex among them.~/.copilot/copilot-instructions.mdin your home folder: your personal instructions, applied in every workspace.
Which of these apply depends on the agent you pick in the chat. A Copilot session reads the files above; an Anthropic Claude session reads CLAUDE.md and .claude/rules; an OpenAI Codex session reads AGENTS.md. To see what the current session has, run Chat: Open Customizations from the Command Palette.
They add up: Copilot reads every file that applies, and VS Code's documentation says not to rely on any order between them. If two files disagree, one of them should be corrected.
They shape chat and agent work, not the suggestions that appear while you type.
Instructions, prompt files or skills?
| Kind | File | Where | When it applies |
|---|---|---|---|
| Instructions | copilot-instructions.md, *.instructions.md, AGENTS.md | .github/, .github/instructions/, the repository root; personal ones in ~/.copilot/ | Automatically: always, or when applyTo matches |
| Prompt files | *.prompt.md | .github/prompts/ | When you run one as a slash command |
| Skills | SKILL.md in its own folder | .github/skills/, personal ones in ~/.copilot/skills/ | When relevant to the task, or as a slash command |
Instructions are for what should always hold. A task you repeat on request fits a prompt file; a procedure with its own scripts or files fits a skill, which loads only when needed.
Why are Copilot instructions not working?
- Check whether the file was used at all: expand References under the response, or run Chat: Open Customizations. Both show that a file was included, not that it was followed.
- The agent picked in the chat decides which files are read. A Claude or Codex session does not read
.github/copilot-instructions.md. applyTopatterns are relative to the repository root, not to the instructions file.*.pymatches only files at the root andsrc/*.pydoes not matchsrc/api/routes.py;**/*.pymatches every Python file.- Instructions never apply to the suggestions that appear while you type, only to chat and agent work.
- If the file is included but ignored, look for a vague rule or two rules that disagree. VS Code does not promise any order between files.
What goes in the personal file?
Project files describe the project. The personal file describes you: how you want changes made, what you never want done without asking, how much explanation you want. It lives in your home folder, so it is the same in every repository and never ends up in someone else's.
VS Code's own advice is to keep each instruction short and self-contained, and to include the reasoning: a model that knows the reason applies the rule to cases you never wrote down.
- Use the libraries already in the project before adding a dependency. - Explain a refactor in a few lines before making it. - Keep a changed function and its tests in the same commit. - Prefer a formula or a named constant to a hard-coded number: the number will change and the reason will be forgotten.
Where do good instructions come from?
The instructions that change behaviour are usually written after Copilot got something wrong: each time you said "no, not like that", the default was off in a way a sentence could fix.
The difficulty is that those corrections are scattered across months of chats, and across every assistant you use. The personal file for Copilot, CLAUDE.md for Claude Code, AGENTS.md for Codex, a rule in Cursor: each holds its own copy of your preferences, and the copies drift apart.
Sources, checked on
- VS Code: Custom instructions
- VS Code: Custom instructions reference
- VS Code: Agent skills
- GitHub: Copilot Memory
- GitHub: Custom instructions for Copilot CLI
Where Coredence fits
Coredence can write that personal file for you, from your own sessions, commits and notes, and keep it current. It consolidates them into memories about how you work and keeps every memory tied to the traces it grew from. If you turn it on, it writes your mind into ~/.copilot/copilot-instructions.md and refreshes it every cycle, in its own marked section, leaving whatever you wrote there yourself untouched. GitHub Copilot CLI reads the same file; Claude Code, Codex and Gemini get the same mind in their own formats.
Coredence runs on macOS 14 or later (Apple silicon) and Windows 10 or later, with no Coredence account. Consolidation needs a model, and you choose it: your Claude Code subscription, your own API key, or a local model through Ollama. On those paths Coredence itself is free to use. It is not open source. If you would rather not bring a key, its own paid plans include the model.
Try it in your browser