GitHub Copilot Custom Chat Modes: AI Personas that Match Your Needs

[ad_1]

If you’ve been using GitHub Copilot Chat in Visual Studio Code, you already know how good it is at answering questions and generating code. But sometimes it feels a little too “one-size-fits-all.”

That’s where Custom Chat Modes change the game.

With this feature, you can define exactly how Copilot Chat behaves – from its tone and areas of focus to the tools it can access – all through a simple Markdown configuration file in your project.

The best part? You can switch between tailored AI personas designed for different workflows instantly, without ever leaving your editor.

Table of Contents

What Are Copilot Chat Modes?

In VS Code, Copilot Chat comes with three built-in modes you can switch between depending on your task:

  1. Ask Mode
    Best for general Q&A — explaining code, exploring APIs, or brainstorming ideas.
    Example: “Explain the difference between map and forEach in JavaScript.”
  2. Edit Mode
    Perfect for making targeted changes directly in your code.
    Example: “Refactor this function to use async/await.”
  3. Agent Mode
    Allows Copilot to handle multi-step, automated changes across multiple files.
    Example: “Add logging to all API endpoints.”

These are a solid foundation, but sometimes you need Copilot to behave less like a general assistant and more like a specialist. That’s where Custom Chat Modes can come in.

Why Custom Chat Modes?

Custom Chat Modes let you define tailored AI roles in VS Code using a .chatmode.md file. This file specifies:

  • The role GitHub Copilot should take (e.g., security reviewer, documentation writer, test generator)
  • Which tools it can use
  • Which language model to run
  • Any rules, tone, or constraints you want it to follow

Think of it this way: you wouldn’t expect a single developer to be an expert in frontend design, database tuning, and security audits all at once — at least not without changing context.

Why this is worth doing:

  • Consistency: Every developer gets the same behaviour from GitHub Copilot
  • Efficiency: Skip the “pretend you’re a…” prompts and get straight to the task.
  • Focus: Build modes for specific jobs like accessibility reviews or test creation
  • Compliance: Lock in workflows that meet security or regulatory requirements
  • Specialisation – Optimise responses for a specific framework, language, or domain

Custom Chat Modes vs Custom Instructions

You might be wondering — “Doesn’t Copilot already have Custom Instructions?”

Yes, but they aren’t the same:

Feature Custom Instructions Custom Chat Modes
Scope Applies to all GitHub Copilot interactions* Specific to one named mode
Flexibility One global set of rules* Multiple specialised personas
Switching Not designed for quick changes Selectable in the Chat UI
Use Case Adjust GitHub Copilot’s overall tone or personality Create task-focused assistants

* Custom Instructions can be tailored slightly to language/file types etc, this is from a general thought between the two

Think of Custom Instructions as Copilot’s permanent personality traits, while Custom Chat Modes are like different roles it can step into on demand.

How Custom Chat Modes Work

Custom chat modes are defined in .chatmode.md Markdown files — one per persona — stored in your workspace. The Visual Studio Code documentation outlines the format, which has two main parts:

  1. YAML frontmatter – Metadata about the mode.
  2. Instruction body – The system prompt that shapes Copilot’s behaviour.

Example:

---
description: Reviews code for potential security vulnerabilities and suggests fixes
tools: ['codebase', 'fetch', 'findTestFiles', 'githubRepo']
model: GPT-4.1
---
Act as a senior application security engineer.  
When reviewing code, focus on OWASP Top 10 vulnerabilities.  
Suggest code changes with explanations.

YAML Frontmatter

  • name – The label shown in the Copilot Chat dropdown.
  • description – A short summary to help you (and your team) choose the right mode quickly.
  • model – The underlying AI model to use.
  • tools – The tools this mode can access — built‑in (e.g., githubRepo) or custom.

Instruction Body

This is where you give Copilot its personality and purpose. Keep it clear and directive — overly long or vague instructions can reduce accuracy.

Setting It Up

  • Create a folder in your workspace for modes. VS Code supports storing them at the root or in .github/copilot-chat-modes/ :
mkdir -p .github/copilot-chat-modes
  • Add a .chatmode.md file & paste in your YAML fontmatter & instructions, like example above
screenshot of GitHub Copilot chatmode example

Reload VS Code

  • After creating or editing modes, reload your VS Code window so GitHub Copilot detects them

Select the Mode

  • Open Copilot Chat, click the dropdown at the top, and select your new persona. Example below shows the “security-advisor” persona
Screenshot of GitHub Copilot showing the security-advisor persona

Examples of Custom Personas

A persona is simply a defined role and style for Copilot to adopt. Here are a few practical ideas:

Security Review Mode

  • Scans code for vulnerabilities
  • Suggests safer alternatives and flags risky patterns
  • Keeps feedback concise and actionable

Documentation Mode

  • Generates Markdown documentation
  • Explains code in plain language for non-technical readers
  • Maintains consistent formatting across the project

Test Generation Mode

  • Creates unit and integration tests
  • Covers edge cases thoroughly
  • Uses your preferred testing framework syntax

Legacy Code Refactor Mode

  • Updates code to modern best practices
  • Replaces deprecated APIs
  • Adds TODOs where human review is needed

Tips from my Current Use of them

  • Be concise but specific – Short, clear role descriptions with concrete goals work best
  • Version control your modes – Store them alongside code so changes are tracked and shared.
  • Limit tool access – Only give the AI what it needs for that role
  • Test before rolling out – Trial a mode with real tasks before sharing widely
  • Name modes clearly – Avoid vague names like “Test Mode.” Make them instantly recognisable

Where I feel this could be heading

We’re seeing a shift toward AI personas embedded directly into developer workflows. This isn’t just a novelty — it’s moving toward team‑based AI configuration as part of modern DevOps

Although custom chat modes are still evolving, the potential is clear:

  • Tailored AI behaviour aligned with your coding standards.
  • Shared, standardised modes for different teams.
  • Faster onboarding for new developers, with AI that explains code in your team’s style.

Wrapping up

If you’re intrigued by custom chat modes:

  1. Create one mode for a task you repeat often
  2. Experiment with tool permissions — see how limiting or expanding them changes the AI’s usefulness
  3. Share modes with your team — gather feedback and refine them
  4. Stay updated via VS Code release notes — the feature continues to impove.

By spending just a few minutes defining your own modes, you can turn Copilot Chat from a general‑purpose assistant into a specialised member of your development team — one who always knows the context, the priorities, and the way you like to work.

As of writing this blog post – Custom chat modes are available as of VS Code release 1.101 and are currently in preview

[ad_2]

Share this content:

I am a passionate blogger with extensive experience in web design. As a seasoned YouTube SEO expert, I have helped numerous creators optimize their content for maximum visibility.

Leave a Comment