Copilot agents question #189584
-
Select Topic AreaQuestion Copilot Feature AreaCopilot Agent Mode BodyI'm using VS Code and I am currently working in a workspace that includes a bunch of different projects and I wanted to create an agent that would be global to all my projects. The file was created at so it should read my agent file. I reloaded VSCode, I am in Agent mode and the frontmatter does include the name of the agent persona but when I start typing in the chat window @lin there is nothing like @linux-engineer. All I have is @ruby, @Terminal and a bunch of different option but my agent is not there. I've tried placing the agent file at the root of my project at How do I use my newly created agent? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
|
Hii @jedrekdomanski , this is a common issue when getting started with custom agents. Heres what you can do: First make sure the file is in the right folder Your linux-engineer.agent.md file needs to live inside .github/agents/ in your project: your-project/ If it ended up somewhere else, just move it there and then simply reload vs code. After moving the file, press Ctrl+Shift+P (or Cmd+Shift+P on Mac), type "Reload Window", and hit Enter. This lets Copilot discover the new agent. After that you can switch to Agent mode. Also at the top of the chat panel, there's a mode dropdown so just make sure it's set to Agent, not "Ask" or "Edit" because custom agents only show up in Agent mode. Once you've done those three things, type @lin and you should see your @linux-engineer pop up. |
Beta Was this translation helpful? Give feedback.
-
Custom Agents in VS Code CopilotGuide on how to create, place, and invoke custom The ProblemYou created a custom agent and placed it at: You reloaded VS Code — but it does not appear in the Copilot Chat dropdown. Below are the common causes and fixes. Root Cause #1 — Tilde (~) Is Not ExpandedVS Code does NOT expand It treats it as a literal path, so the file is never discovered. FixUse absolute paths in "chat.agentFilesLocations": [
".github/agents",
".claude/agents",
"/home/yourusername/.copilot/agents",
"/home/yourusername/.github/agents"
]Replace Root Cause #2 — Malformed FrontmatterYour agent file may contain invalid YAML frontmatter. Bad Example---
name: linux-engineer
description: "Linux System Administrator and Engineer.
---The string is not closed. Good Example---
name: linux-engineer
description: "Linux System Administrator and Engineer."
---Root Cause #3 — Wrong Invocation MethodCustom agents are NOT invoked with The Correct Method
Then start chatting normally. Recommended Setup — Let VS Code Create ItInstead of creating files manually, use VS Code's built-in command. Steps
(not Workspace if you want a global agent)
Checklist
Example Prompts (After Agent Is Active)First select linux-engineer from the dropdown. Then type prompts normally: File Naming ConventionYour agent file should look like this: Example location: SummaryTo make custom Copilot agents work:
Then your custom agent will appear and work correctly. |
Beta Was this translation helpful? Give feedback.
-
|
you can think of chat participant as a built-in specialist inside copilot chat. These are the ones you see when you type @, such as - @workspace will know about your entire project structure, @Terminal will know about your terminal and shell commands and so on. Remember chat participants are built into copilot by github so you cant create your own chat participants. Custom agents (like your linux-engineer.agent.md file) are not chat participants. They work differently because they provide instructions and persona to Agent mode. Think of them as a custom system prompt that shapes how Copilot behaves during an agent session. |
Beta Was this translation helpful? Give feedback.




Yeah I would rather say its a bug or at least very misleading behavior from copilot. When you use the "Generate agent" feature, copilot autogenerates those @agentname example prompts as if they'll work like built-in chat participants like @workspace or @Terminal
But custom .agent.md agents simply don't work that way cuz they aren't mentionable with @, so the example that copilot gave you would never actually work as shown. It's the generated output giving you the wrong impression of how to use the feature.