Skip to content

FAQ: Copilot not using instructions for new files #9151

@aeschli

Description

@aeschli

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.instructionsFilesLocations defines where *.instructions.md files are searched at.
    • github.copilot.chat.codeGeneration.useInstructionFiles controls whether .github/copilot-instructions.md is added
    • chat.useAgentsMdFile controls whether AGENTS.md files in workspace roots are included
    • chat.useNestedAgentsMdFiles controls whether Copilot searches for AGENTS.md in the while workspace
    • chat.useClaudeSkills whether Copilot searches for SKILL.md files in ~/.claude/skills/*/ and ${workspaceRoot}/.claude/skills/*/
  • Auto-attached instruction files: The response tells you which files where auto-attached in the Used x references section. Auto-attaching depends on the applyTo property 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 applyTo pattern. The agent can load them on-demand when useful. You will see a read tool 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

Metadata

Metadata

Assignees

Labels

doc-enhancementsuggested addition or improvementfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions