-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
We often get the complaint: 'Copilot is not following my instructions'. Here are some tips:
-
To see what instruction files are known to VS Code run
Chat: Configure Instructions...or ask Copilot in agent mode: 'what instruction files are available'.chat.instructionsFilesLocationsdefines where*.instructions.mdfiles are searched at.github.copilot.chat.codeGeneration.useInstructionFilescontrols whether.github/copilot-instructions.mdis addedchat.useAgentsMdFilecontrols whetherAGENTS.mdfiles in workspace roots are includedchat.useNestedAgentsMdFilescontrols whether Copilot searches forAGENTS.mdin the while workspacechat.useClaudeSkillswhether Copilot searches forSKILL.mdfiles in~/.claude/skills/*/and${workspaceRoot}/.claude/skills/*/
-
Auto-attached instruction files: The response tells you which files where auto-attached in the
Used x referencessection. Auto-attaching depends on theapplyToproperty and the files that were attached when the request is made. -
On-demand instruction files: Each agent request includes a list of all instructions with their description and
applyTopattern. The agent can load them on-demand when useful. You will see areadtool call when that happens -
To see what ended up in a request by using the request log: https://github.com/microsoft/vscode/wiki/Copilot-Issues#language-model-requests-and-responses
-
To debug the 'apply to' pattern use https://github.com/microsoft/vscode/wiki/Copilot-Issues#custom-instructions-logs
-
If your instruction were part of the request but the LLM did not follow, then it's a model issue and can't be fixed by VS Code Copilot. You need to reword your instructions, mention they are very important, include examples.
-
If your instruction are not included in the request, then it could be a VS Code Copilot issue. In that case it would be great if you can share the request log and your instruction files so we can reproduce.
-
If your on-demand instructions were not requested by the LLM, improve the
description. You can also try to nudge the LLM by telling to not to forget to use specific instructions. The latest models are all quite good in loading instructions on demand, while GPT < 5 has problems with it