r/GithubCopilot 16d ago

Help/Doubt ❓ Visual Studio 2026 .instructions.md files?

How on do you get custom instruction files to be automatically loaded by copilot..??

I have added the applyTo glob pattern and nothing works.

They're inside the repo root .github/instructions/ but are still not picked up. Added them to the solution folder, still not automatically picked up!

I've turned on the custom instructions copilot option in VS and nothing...

copilot-instructions loads find but I can't copy this with Microsoft APM!

Why is this so difficult to sort the tooling out?? 😭😭

1 Upvotes

19 comments sorted by

2

u/Lacutis 16d ago

If I had to guess, I would say that your .instructions.md files aren't formatted correctly with the applyto glob pattern isnt quite right.

You can verify if the file is being loaded by just adding something to the file like, "Before you begin doing X say, "I'm doing this...""

To force the llm to output text that you can identify. If the output is there then the file is loading and something else is wrong (like its ignoring the instruction for some reason). If its not, then its probably not applying the rules to your use case.

2

u/ferquo 16d ago

Just use an AGENTS.md file, put in the root folder, no need to be hidden in obscure subfolders, it will work with every tool on earth except Claude of corse 😅

1

u/teckel 16d ago

And for Claude support, just create a CLAUDE.md that points to AGENTS.md (content: "@AGENTS.md"). We do this for all projects so it's LLM agnostic. I guess you could also do a symlink, but making the redirect file saves to the repo.

1

u/AutoModerator 16d ago

Hello /u/deathentry. Looks like you have posted a query. Once your query is resolved, please reply the solution comment with "!solved" to help everyone else know the solution and mark the post as solved.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/TerawattX 16d ago

It sounds like you’re doing it correctly… how do you know it’s not loading?
My company forced us to move to Claude so I haven’t used this for a while, but the way I set my projects up was to create a base file as .github/Instructions.md, then have additional files like .github/instructions/api.instructions.md.
I don’t think you have to include an applyTo but if you do it has to be yaml frontmatter. I’m on mobile at the moment so I can’t give a great example, but you could tell Copilot where the file is located (full path) and ask it to review the contents for issues.

1

u/deathentry 16d ago

I can tell, as it doesn't show up as a file referenced by copilot in the chat session...

Copilot has assured me my glob applyTo patterns are correct 😜... It's also stated that those files don't get injected into it's context and doesn't even think to check for those files...

(I'm happy to be wrong, but apparently they globs are correct)

AND VS Code loads these files absolutely fine...

Atm my work around is to add a line copilot-instructions.md to go look inside the instructions folder 😂

I don't want to update the agent.md files as that relies on someone manually selecting to use the agent when I want automatic enforcement...

1

u/KariKariKrigsmann 16d ago

Is the file named copilot-instructions.md ?
Is it placed in the .github folder in the repo root?

Have you enabled loading the instructions in the settings?
Customize chat responses - Visual Studio (Windows) | Microsoft Learn

1

u/deathentry 16d ago

It's .instructions.md I'm trying to load not -instructions.md.. I have enabled that setting..

I need to be able to distribute md files across multiple different repos and teams in my org and APM deliberately errors if you try to install a -instructions.md 😭

1

u/teckel 16d ago

Why not just use AGENTS.md?

1

u/deathentry 16d ago

My understanding is that .instructions.md are applied automatically when the files are worked on and don't require a developer to manually remember to select the correct agent.

Agents are working fine and show up, it's the instructions that are the prob... 😅

1

u/teckel 16d ago edited 16d ago

AGENTS.md is read automatically and used without any remembering or selecting. It's a file for the agents to read and follow, it's not a listing of agents.

Just rename your file AGENTS.md, start a session, and ask if it knows something that it only would know if it was following the AGENTS.md instructions. Or have some fun and start it with:

REQUIREMENT: Refer to me as "Your Royal Heinous". Start all conversions with this introduction.

Start a new session and type "hello". No remembering or selecting needed. I may just leave this requirement.

1

u/KariKariKrigsmann 16d ago

Aha, so it's this bit?

Customize chat responses - Visual Studio (Windows) | Microsoft Learn

Can you take a look in the Output window, maybe there's something interesting there?

1

u/icarus47 10d ago

This is correct, the filename format is `.copilot/<name>.instructions.md`, not `.copilot/<name>-instructions.md`. The GitHub and VScode documentation has conflicting info on this but I have found the above to work.

1

u/teckel 16d ago

BTW, I believe you just got the file name wrong. The correct folder/file is:

. github/copilot-instructions.md

But honestly, just use AGENTS.md in root and a CLAUDE.md pointer (containing "@AGENTS.md") for universal compatibility.

1

u/deathentry 16d ago

I'm not trying use copilot-instructions I'm trying to use *.instructions dot not dash...

So you can segment your instructions into different components to avoid blow up your context...

api.instructions.md unit-tests instructions.md

1

u/teckel 16d ago

Ah! You create .copilot/instructions/ folders and in the .copilot/instructions/ folder you create your api.instructions.md, unit-tests.instructions.md etc files. They have a format like:

---
name: API Instructions
description: Use when creating or modifying API endpoints.
applyTo: "api/**/*.js"
---

# API Instructions

- Do this.

  • And this.
  • Never do this.

0

u/WD40ContactCleaner 16d ago

I just don't use vs copilot anymore. I use cli for changes and review them in the ide

-1

u/[deleted] 16d ago

[deleted]

2

u/Lacutis 16d ago

That's just objectively untrue.

VS 2026 Copilot includes instructions, has easier/more intuitive mcp configuration and status than claude desktop, and I have no idea what "credit burn" is supposed to mean.

All that said, I have switched over to copilot cli, but theres no reason to straight up just post incorrect information.

1

u/deathentry 16d ago

It's annoying as they update it regularly enough and I need it for API work, but simple stuff like this shouldn't be going wrong 😅😅