---
featureId: custom-agents
title: Build your own custom agents
area: GitHub Copilot
thumbnailImage: ../media/custom-agents-thumbnail.png
devComUrl: https://developercommunity.visualstudio.com/t/Custom-modes-for-Copilot-Chat/10950930?q=custom+agents
description: Define custom agents tailored to your team's workflow using .agent.md files in your repository or user profile.

---


Custom agents help you build specialized Copilot agents for your team's workflow. They can use workspace awareness, code understanding, tools, your selected model, and MCP connections to external knowledge sources such as internal documentation, design systems, APIs, and databases.

Custom agents are defined as `.agent.md` files in your repository or user profile.
Workspace or project-specific agents are stored under `.github/agents/` in your repository. For example:

```text
your-repo/
└── .github/
    └── agents/
        └── code-reviewer.agent.md
```

User-level agents are stored in `%USERPROFILE%/.github/agents/` by default. You can change this location in **Tools > Options > Copilot Chat > Custom agents user directory**.

To create a custom agent, either create a `.agent.md` file directly in one of the locations above, or click the **+** button in the agent picker and follow the prompts.

![Agent picker showing a CSharp expert custom agent](../media/custom-agents.png)

After you create a custom agent, it appears in the agent picker so you can use it anytime.

A few things to note:

- If you don't specify a model, the agent uses the model currently selected in the model picker.
- Tool names vary across GitHub Copilot platforms - check the tools available in Visual Studio to make sure your agent works as expected.
- The [awesome-copilot](https://github.com/github/awesome-copilot) repo has community-contributed agent configurations you can use as starting points. Verify tool names before you use them in Visual Studio.
