-
Notifications
You must be signed in to change notification settings - Fork 632
Description
Describe the bug
The copilot CLI docs say this:
Respects instructions sourced from various locations:
`.github/instructions/**/*.instructions.md` (in git root and cwd)
`.github/copilot-instructions.md`
`AGENTS.md` (in git root and cwd)
`CLAUDE.md`
`GEMINI.md`
`$HOME/.copilot/copilot-instructions.md`
Additional directories via `COPILOT_CUSTOM_INSTRUCTIONS_DIRS`
However, when I placed instructions at all of the above locations with content like:
"my favorite color is blue-green" in AGENTS.md in root of my repo
"my favorite animal is a snake" in .github/copilot-instructions.md
etc.
Then running a new copilot CLI session in my repo and asking it questions like "what is my favorite animal?" or just asking plainly "what instruction files and context were you sent automatically, do not read any additional files, just list what you were sent with this prompt"
Here's the results:
only <repo-root>/.github/copilot-instructions.md and $HOME/.copilot/copilot-instructions.md were included automatically.
.github/instructions/**/*.instructions.md (in git root and cwd) - Copilot CLI only received a list of these instruction files, not their content. I have some instructions files with front matter that says: applyTo: '**' and they were not included even though it should have been since the apply to everything should always match. Even when including a specific referenced file, the custom instruction files for that file that matched the front matter were not automatically included
.github/copilot-instructions.md - This is got included, but only at the root of my repo. I work in a large mono repo with lots of sub folder projects, and these projects each have VS Code workspaces with .github/copilot-instructions.md. However, when working in the subfolder workspace, only the one copilot-instructions.md at the root of my repo was included, none at the current working directory where the actual projects are.
AGENTS.md (in git root and cwd) - Not automatically included at either the root or cwd
CLAUDE.md - Not automatically included at either the root or cwd
GEMINI.md - Not automatically included at either the root or cwd
$HOME/.copilot/copilot-instructions.md - These were included correctly
Additional directories via COPILOT_CUSTOM_INSTRUCTIONS_DIRS - Not included, I tried a single path, and multipath for the COPILOT_CUSTOM_INSTRUCTIONS_DIRS and the instructions at these locations were NEVER included.
Affected version
0.0.365
Commit: 76d0881
Steps to reproduce the behavior
Add custom instruction files for each of the types that copilot says are supported with hidden info in them like "my favorite number is 3141" and then ask copilot CLI "what's my favorite number" and see if it gets it right. For me it only got it right for instructions at $HOME/.copilot/copilot-instructions.md and .github/copilot-instructions.md in the root of my workspace.
Expected behavior
Copilot should be automatically getting sent all instruction files that the documentation says it should get.
Additional context
I'm on windows 11 running copilot CLI in powershell.