How to customise the way GitHub Copilot responds

Published: (December 3, 2025 at 09:34 PM EST)
3 min read
Source: Dev.to

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.

GitHub Copilot chat on the web

Example workflow

  1. Open GitHub Copilot on the web.

  2. Prompt Copilot, e.g. Create a JavaScript function that converts numbers into Roman numerals.

  3. Observe the output.

  4. 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
  5. 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.

  1. Create a file named copilot-instructions.md inside the .github directory of the repository.

  2. 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.

Copilot Code review custom instructions

Generating the file with Copilot

Via the Copilot Agents UI

  1. Visit the GitHub Copilot Agents page and select your repository.

  2. 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]
  3. Review the generated copilot-instructions.md and adjust as needed.

Via VS Code

  1. Open the target repository.
  2. In the Copilot chat panel, click the Settings (gear) icon and choose Generate instructions.
  3. Inspect the generated .github/copilot-instructions.md file 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.

  1. Inside the repository, create a folder .github/instructions.

  2. Add a Markdown file named .instructions.md (choose a descriptive name).

  3. On the first line, specify the target files with the applyTo key, e.g.:

    applyTo: "app/models/**/*.rb"

    Multiple patterns can be comma‑separated:

    applyTo: "**/*.ts,**/*.tsx"

    To apply to all files:

    applyTo: "**"
  4. Write the guidance for those files below the applyTo line using regular Markdown.

You can create as many path‑specific instruction files as needed, each targeting different subsets of the codebase.

Back to Blog

Related posts

Read more »