r/GithubCopilot • • 20d ago

Help/Doubt ❓ VS Code Forgot copilot-instructions.md

Just recently The prompt seems to have forgotten where the .github/ copilot-instructions.md file was. Has anybody seen this? Maybe it just temporary lost its mind.

It was only running some of the checks I requested and not the entire instructions. Is there a best practice for telling it where these files are located? I thought it was supposed to know this automatically since it's the one that told me this.

3 Upvotes

11 comments sorted by

3

u/ShelLuser42 20d ago

It was only running some of the checks I requested and not the entire instructions.

If it was running some of those then how did you conclude that it didn't find the file at all?

Alas, there are several settings which can apply here (for example github.copilot.chat.codeGeneration.useInstructionFiles), but as long as you never touched these then I'd try to verify the instruction file itself.

Too many or contradicting instructions can also negatively affect things. It sounds silly, but why not tell Copilot to check the instructions file and look for problems and/or possible optimizable aspects?

1

u/ADDSquirell69 20d ago

Thx. I will.

2

u/London-Boat 19d ago

one more thing worth trying if the file has grown long: split it. you can move the check specific rules into .github/instructions/*.instructions.md files with an applyTo glob in the frontmatter, so only the rules for the files being touched get pulled in and the main copilot-instructions.md stays short. long single files seem to be where it starts skipping parts

1

u/ADDSquirell69 19d ago

Thx. Good stuff!. Ai craves organization

1

u/IamAlsoDoug 20d ago

How large was your context at the time. There are definitely issues where, as the context grows, content from early in the prompt will be forgotten.

1

u/myneid 20d ago

this happens from time to time with anything. in my file i have a personality, and so i know if the return text comes back and doesnt start with 'sigh...ive seen this a hundred times before' i know that the instructions did not load in teh context and something will be wrong

1

u/ADDSquirell69 19d ago

What's a personality? Is that something that you tell it to do so that you know it's loading the file and running it?

3

u/bezcurhq 19d ago

Worth splitting this into two questions, because they fail differently. First, was the file included at all? Run Chat: Open Customizations and check it's listed under Instructions, then in a fresh chat look for copilot-instructions.md in the response's References, or open Agent Debug Logs to see the actual request. If it's in there and only some of the checks ran, it was loaded but not followed, which usually means a long rule list competing with a big context. For a fixed set of checks I'd move them into a prompt file under .github/prompts and run it as a slash command when you want the full pass, rather than hoping every turn does all of them.

https://code.visualstudio.com/docs/copilot/customization/custom-instructions

1

u/AutoModerator 20d ago

Hello /u/ADDSquirell69. 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.