The most underrated GitHub Copilot feature nobody talks about

GitHub Copilot Instructions: The secret to getting better AI code suggestions by giving it project-specific context.

The most underrated GitHub Copilot feature nobody talks about

Date

Mon Jul 07

Author

Martijn

I’ve been using GitHub Copilot since pretty much the beginning. It’s great for autocomplete, boilerplate, and reminding me of things I should probably know but don’t feel like Googling. But for real-world projects? It’s hit or miss. This is the same for any AI code assistant, really. Sometimes it nails it, but other times it suggests stuff that makes you go “What the heck is this?”

It’s not Copilot’s fault though. The problem is that most people expect Copilot to “just know” what kind of code you want — your standards, your stack, your formatting preferences, how you like to structure your app. Spoiler: it doesn’t.

For example, in my Laravel projects, I often found Copilot giving me old syntax, outdated helper functions, or just weird formatting that didn’t match the rest of the codebase. With my Qt C++ projects, it would sometimes mix up widget types or guess at patterns I wasn’t using. And every time I switched projects, I had to basically retrain it with comments like:

Use Laravel 12 syntax.
Don't use deprecated functions.
Use PSR-12 formatting.
Use unique_ptr, not raw pointers.

At some point, I realized I was spending more time telling Copilot what not to do than actually coding. I have a library of about 50 different system prompts I use for various projects, but it’s annoying to copy and paste them every time. That’s when I stumbled on the feature that should be getting way more attention than it does: Copilot Instructions.

The Missing Piece: Copilot Instructions

Turns out GitHub quietly added support for a .github/copilot-instructions.md file — a way to give Copilot project-specific context. It’s not some AI magic prompt hack. It’s more like giving your AI teammate a basic onboarding doc.

And honestly, it changes everything.

You can define:

  • Which language features to use or avoid & syntax preferences
  • What version of your framework or language you’re using
  • What not to suggest

It’s like giving Copilot a bit of memory — something it’s sorely missing out of the box. Plus, it’ll vastly improve the predictibility of its suggestions for anyone using the same project.

Examples

I’ve started keeping a few of these instruction files around to drop into new projects, and they’ve already saved me a lot of back-and-forth. Here are two examples you can look at:

I’ve removed some of the more specific details with information about the products these instructions are for, but you can see how they set the stage for Copilot to give better suggestions right off the bat.

Tip: add more details about your project, like the stack you’re using, any specific libraries or patterns you follow, and even some example code snippets that represent your style.

How to Use It

Just drop a file like this in .github/copilot-instructions.md in your project, and make sure Copilot is set to read it by flipping this setting in VSCode:

{
  "github.copilot.chat.codeGeneration.useInstructionFiles": true
}

It’s possible this setting is already enabled by default.

Final Thoughts

Copilot is a great tool, but it’s not magic. If you treat it like a blank slate, it’ll act like one. But if you give it a bit of structure — like you would a new dev joining your team — it actually gets a lot smarter.

This feature has been around for a while, but almost nobody knows about it. Which is wild, because it solves one of the most frustrating things about using AI in real projects.