GitHub Copilot
GitHub Copilot prompt files in VS Code: .github/prompts/*.prompt.md slash commands
How do I make a reusable /command for GitHub Copilot Chat in VS Code with a .prompt.md file?
Save a Markdown file with the .prompt.md extension in .github/prompts (workspace) or in your VS Code user profile. Type / and the file name in Copilot Chat to run it, for example /create-api. Optional YAML frontmatter sets description, name, argument-hint, agent (ask, agent, plan or a custom agent), model and tools. In the body you can link files, reference tools with #tool:name and ask for input with ${input:name}. Prompt files run only in Local sessions in the Chat view; for other harnesses VS Code points you to agent skills.
Compare: custom slash commands in every AI coding agent →
GitHub Copilot settings change often
Get one email a week when a setting, flag or permission rule changes, checked against the vendor docs.
Where prompt files live
- Workspace: the .github/prompts folder. Commit it so the whole team gets the same commands.
- User: your VS Code profile's user data. Create user prompt files with the Agent Customizations editor or the Chat: New Prompt File command.
- Monorepos: turn on chat.useCustomizationsInParentRepositories to also discover prompt files from the parent repository root.
- Sync user prompt files across machines with Settings Sync: run Settings Sync: Configure and select Prompts and Instructions.
File format and frontmatter
A prompt file is Markdown with the .prompt.md extension and an optional YAML frontmatter header. Every field is optional.
- description: a short description of the prompt.
- name: the name you type after /. Defaults to the file name.
- argument-hint: hint text shown in the chat input.
- agent: ask, agent, plan or the name of a custom agent. Defaults to the current agent, or agent when tools are set.
- model: the model to use. Defaults to the model picker selection.
- tools: tools, tool sets, MCP tools or extension tools. Use <server name>/* for every tool of an MCP server. Tools that are not available are ignored.
.github/prompts/security-review.prompt.md
---
description: Review a REST API for security issues
agent: ask
argument-hint: path to the API folder
---
Review the REST API in ${input:apiPath:src/api} for security issues.
Return a prioritized Markdown TODO list that covers:
- authentication and authorization
- input validation
- rate limiting
- logging of sensitive data
Follow the conventions in [our API guidelines](../../docs/api-guidelines.md).What you can put in the body
- File links: Markdown links or #file:. Workspace paths are relative to the prompt file; paths starting with ~ or ~/ point to your home folder. Use / as the separator.
- Tools: #tool:<tool-name>, for example #tool:browser.
- Input: ${input:variableName} or ${input:variableName:placeholder}. The vscode/askQuestion tool can also ask the user during the run.
- Built-in variables such as ${selection} are supported.
Create and run a prompt file
- Create: select Local in the Chat view, open Customizations from the Chat title bar, go to Prompts and choose New Prompt next to Workspace or User. Or run Chat: New Prompt File or Chat: New Untitled Prompt File.
- Generate: type /create-prompt with a description in Local chat, or use Generate with AI next to Workspace in the Prompts section.
- Run: type / plus the name in chat, with optional input after it, for example /create-api for listing customers. Agent skills show up in the same / list.
- Run from the Command Palette with Chat: Run Prompt, or press the play button in the editor title of an open prompt file.
- chat.promptFilesRecommendations shows chosen prompts as recommended actions in new chats.
Which tools a prompt gets
- 1. Tools listed in the prompt file.
- 2. Otherwise, tools from the custom agent the prompt file references.
- 3. Otherwise, the default tools of the selected agent.
Limits and troubleshooting
- Prompt files run only in Local harness sessions in the Chat view. For other harnesses, create an agent skill or convert the prompt file to a skill.
- To see where a prompt file comes from (built-in, user, workspace or extension), run Chat: Configure Prompt Files and hover over it.
- To see discovery errors, open the Chat view's ... menu and choose Show Agent Debug Logs.
Get GitHub Copilot settings changes by email
When a setting, flag or permission rule in this guide changes, it goes in the weekly AgentAtlas update, checked against the vendor docs. One email a week.
Sources
More on GitHub Copilot
More GitHub Copilot guides
- GitHub Copilot custom instructions
- Adding MCP servers to GitHub Copilot
- copilot-setup-steps.yml: set up the GitHub Copilot cloud (coding) agent environment
- GitHub Copilot CLI permissions: --allow-tool, --deny-tool, --allow-all-tools and trusted directories
- GitHub Copilot custom agents: .github/agents/*.agent.md profiles, tools and frontmatter
- GitHub Copilot code review settings: automatic PR reviews, rulesets, effort level and approvals
- GitHub Copilot hooks: .github/hooks/*.json for Copilot CLI and the cloud agent
- Run GitHub Copilot CLI with copilot -p in scripts and CI (2026)
Other guides
Reviewed Oct 20, 2026. Settings change often; the linked vendor docs are the source of truth.