How to customise the way GitHub Copilot responds
Source: Dev.to
Have you been prompting GitHub Copilot a lot? Re‑entering the same or similar instructions for every chat can be tedious. Custom instructions let you save reusable guidance—such as project‑specific policies, naming conventions, or comment standards—so Copilot can apply them automatically.
There are two main ways to customise how GitHub Copilot responds to prompts:
- Custom instructions
- Prompt files (not covered in this article)
Custom instructions
Custom instructions guide GitHub Copilot’s behaviour. At the time of writing, the following scopes are available:
- Personal custom instructions
- Repository‑wide custom instructions
- Path‑specific custom instructions
- Organization custom instructions (Copilot Enterprise)
- Agent instructions (used by AI Agents)
Personal custom instructions
Personal instructions are set in the Copilot chat UI on the web and affect how Copilot interprets your prompts.

Example workflow
-
Prompt Copilot, e.g.
Create a JavaScript function that converts numbers into Roman numerals. -
Observe the output.
-
Open Profile → Personal instructions in the Copilot settings and add guidance such as:
Always do the following when writing functions: - Add descriptive comments - Add input validation - Use early returns for error conditions - Use meaningful variable names - Include at least one example usage in comments -
Re‑run the same prompt and compare the results.
Read more about personal custom instructions on the GitHub Docs.
Repository‑wide custom instructions
Repository‑level instructions ensure every contributor gets the same guidance—useful for shared frameworks, coding standards, or comment conventions.
-
Create a file named
copilot-instructions.mdinside the.githubdirectory of the repository. -
Populate it with natural‑language guidance written in Markdown, for example:
# Project Overview This project [describe your project]. ## Folder Structure [list the folder structure] ## Libraries and Frameworks [list any libraries it uses] ## Coding Standards [list your coding standards] ## UI Guidelines [list your UI guidelines]By default, repository instructions are enabled.

Generating the file with Copilot
Via the Copilot Agents UI
-
Visit the GitHub Copilot Agents page and select your repository.
-
Prompt the agent with a request such as:
Your task is to add a .github/copilot-instructions.md file to the repository. [outline the goals you want GitHub Copilot to achieve] [add limitations such as length or task‑specific constraints] Add high‑level details about the codebase: - A summary of what the repository does. - Repository size, primary languages, frameworks, target runtimes. Include build and validation instructions: [insert build steps] List key architectural facts: [describe project layout and architecture] [describe the steps Copilot should take] -
Review the generated
copilot-instructions.mdand adjust as needed.
Via VS Code
- Open the target repository.
- In the Copilot chat panel, click the Settings (gear) icon and choose Generate instructions.
- Inspect the generated
.github/copilot-instructions.mdfile and commit it.
Read more about repository‑wide custom instructions on the GitHub Docs.
Path‑specific custom instructions
Path‑specific instructions apply only to selected files or patterns, allowing fine‑grained control. Currently supported in VS Code and JetBrains IDEs.
-
Inside the repository, create a folder
.github/instructions. -
Add a Markdown file named
.instructions.md(choose a descriptive name). -
On the first line, specify the target files with the
applyTokey, e.g.:applyTo: "app/models/**/*.rb"Multiple patterns can be comma‑separated:
applyTo: "**/*.ts,**/*.tsx"To apply to all files:
applyTo: "**" -
Write the guidance for those files below the
applyToline using regular Markdown.
You can create as many path‑specific instruction files as needed, each targeting different subsets of the codebase.