Skip to content
AgentAtlas

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 →

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.

Sources

More GitHub Copilot guides

Reviewed Oct 20, 2026. Settings change often; the linked vendor docs are the source of truth.

Built an MCP server? Get it listed everywhere →

Shipping an Android app? Google Play needs 12 testers for 14 days first. Get them with Tester Exchange →