---
thumbnailImage: ../media/17.14.14_instruction_files.png
area: GitHub Copilot
featureId: instruction-files
description: You can now create composable instruction files to target custom instructions to specific areas of your codebase.
title: Target your Copilot instructions
specUrl: https://code.visualstudio.com/docs/copilot/copilot-customization#_use-instructionsmd-files

---


Getting Copilot to respond the way you want can be a challenge. You may have different coding standards, best practices, or architectural patterns in different areas of your codebase. With instruction files, you can now target specific instructions to specific folders or files in your repository, making Copilot truly project-aware and consistent across sessions.

![Instruction file attached automatically as a reference](../media/17.14.14_instruction_files.png)

### Enable the feature
Turn on the feature at **Tools > Options > GitHub > Copilot > Copilot Chat > Enable custom instructions to be loaded from .github/instructions/\*.instructions.md files and added to requests**.

### Write instruction files 

1. Format your instructions with the `applyTo` header and specify a glob pattern for which files you want these instructions to be included for.

```
---

applyTo: "src/**/*.cs"

---
```
2. In the file body, you can use natural language to specify your content and reference other instruction files to compose instructions together. 
3. Save the file with the `.instructions.md` file extension in the root of your repository in the `.github/instructions` folder.

Tip: You can even get Copilot's help refining your instructions to be more detailed.

### How it works
When you prompt Copilot, it will automatically detect which instruction files apply to the files in your current context and attach them as references. You can see which instructions were attached by clicking on the references in the response card.

### Want to try this out?
Activate GitHub Copilot Free and unlock this AI feature, plus many more.
No trial. No credit card. Just your GitHub account. [Get Copilot Free](https://github.com/settings/copilot).
