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

Other guides

How to allow Cursor to run all commands: Run Everything, allowlist and sandboxHow to allow Claude Code to run all commands: permission modes, allow rules and skip permissionsClaude Code permissions: allow, ask and deny rules, rule syntax and allowed toolsCodex CLI: approval and sandbox modesGemini CLI: YOLO mode, auto_edit and allowing specific shell commandsCursor Privacy Mode: telemetry, training and data retentionClaude Code telemetry and data retention: what is sent and how to turn it offGemini CLI: turn off usage statistics and telemetryCLAUDE.md: where it goes, how it loads, and how it works with AGENTS.mdClaude Code hooks: all events, exit codes, PreToolUse allow/deny JSON and examplesClaude Code subagents: create one, limit its tools, and call itAdd MCP servers to Cursor with mcp.json: Keep files out of Cursor with .cursorignore: Configure Codex with config.toml: Configure Gemini CLI with settings.json: Add MCP servers to Claude Code (claude mcp add, .mcp.json, scopes): Claude Code custom slash commands and skills (SKILL.md): Claude Code settings.json: file locations, precedence, and key settingsClaude Code plugins and marketplaces: install, create, and shareGemini CLI extensions and custom commands: Configuring OpenCode with opencode.json: Cline Rules: workspace, global, and conditional rulesKiro steering files: .kiro/steering, inclusion modes, and AGENTS.mdZed agent: instruction files, MCP servers, tool permissions, and ACP agentsCursor CLI: install, headless mode, permissions and CIAider: CONVENTIONS.md, .aider.conf.yml and API keysJunie guidelines, MCP and the Action Allowlist: Amp AGENTS.md, settings.json and MCP: Configure Goose extensions, hints, recipes and permissions: Customize OpenHands with skills, AGENTS.md, setup.sh and MCP: Configure Factory Droid CLI: AGENTS.md, settings.json, autonomy, custom droids and MCPConfigure Qwen Code: settings.json, providers, QWEN.md, MCP and approval modesCursor hooks: hooks.json, beforeShellExecution, afterFileEdit and exit codesCursor sandbox: sandbox.json, network allowlist and run modesCursor settings: settings.json, Cursor Settings and the ~/.cursor config filesCursor browser agent: @browser, browser automation and approval modesCursor subagents: .cursor/agents, frontmatter, built-in Explore and BrowserCursor telemetry and OpenTelemetry export (Privacy Mode, OTLP, Analytics API): Cursor rules setup: project, user and Team Rules, .mdc frontmatter, globs and AGENTS.mdClaude Code headless mode: claude -p, --output-format json, --bare and CI flagsClaude Code statusline: custom status bar in settings.json with context %, cost and git branchClaude Code /model: switch models, aliasesClaude Code /cost and /usage: check token spend, usage limits and reduce costsClaude Code VS Code extension: install, shortcuts, settings and /ideCodex AGENTS.md: global, project and override instruction files explainedCodex MCP servers: codex mcp add and [mcp_servers] in config.tomlCodex sandbox modes: read-only, workspace-write, danger-full-access and network accesscodex exec: run Codex non-interactively in scripts and CI with JSON outputCodex skills: create SKILL.md, skill folder locations and $skill invocationGEMINI.md in Gemini CLI: context file locations, imports and /memoryGemini CLI MCP servers: gemini mcp add and mcpServers in settings.jsonGemini CLI custom slash commands: TOML files, {{args}}, !{shell} and @{file}Gemini CLI headless mode: gemini -p, JSON output and exit codes for scripts and CIGemini CLI sandbox: enable Docker, Podman, macOS Seatbelt or gVisorOpenCode MCP Server Setup: Local and Remote Servers in opencode.jsonOpenCode Permissions: Allow, Ask or Deny Bash, Edit and WebfetchOpenCode Custom Agents and Subagents: Markdown Files, Modes and @ MentionsCline MCP Setup: cline_mcp_settings.json for Local and Remote ServersCline Auto Approve and YOLO Mode: Run Commands and Edits Without PromptsCline Skills: SKILL.md Location, Format and Slash Command UseAmp MCP Setup: amp mcp add, amp.mcpServers and Workspace ApprovalAmp AGENTS.md: File Locations, @ Mentions and Glob-Scoped GuidanceAmp Skills: SKILL.md Folders, amp skill add and Search OrderKiro MCP Setup: .kiro/settings/mcp.json, autoApprove and OAuthKiro Hooks: .kiro/hooks JSON, PreToolUse, PostFileSave and StopKiro Permissions: permissions.yaml Allow, Ask and Deny RulesFactory Droid MCP Setup: droid mcp add, mcp.json Locations and /mcpFactory Droid Hooks: hooks.json, PreToolUse Matchers and Exit CodesFactory Droid Custom Droids (Subagents): .factory/droids Markdown FilesJunie MCP Setup: .junie/mcp/mcp.json for CLI and /mcp CommandJunie Brave Mode and Action Allowlist: Auto-Approve Commands in Junie CLIJunie Custom Slash Commands: .junie/commands Markdown Files and Argumentsgoose .goosehints and AGENTS.md: Global and Project Instructionsgoose Permission Modes: GOOSE_MODE auto, approve, smart_approve and chatgoose Recipes: recipe.yaml Format, Parameters and goose run --recipeZed Agent Tool Permissions: Auto-Approve Terminal Commands with tool_permissionsUse Claude, Codex and Gemini CLI in Zed: External Agents and agent_serversZed with Ollama, LM Studio and llama.cpp: Local Model Setup and Context LengthMCP 2026-07-28 Migration Guide: Stateless Protocol, No Sessions, server/discover, MRTR, and SDK v2 UpgradeSubagents and Custom Agents Compared: Claude Code vs Codex vs Cursor vs Gemini CLI vs GitHub CopilotAllow all commands in any AI coding agent: Cursor, Claude Code, Codex, Gemini CLI, Copilot CLI and 7 moreAdd an MCP server to any AI coding agent: Claude Code, Cursor, Codex, Gemini CLI, VS Code and 8 moreSettings file locations for every AI coding agent: Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Qwen Code, Amp and Factory DroidRules and instruction files in every AI coding agent: .cursor/rules, CLAUDE.md, AGENTS.md, GEMINI.md, Copilot instructions and moreGemini CLI hooks: settings.json, BeforeTool, AfterTool, exit codes and /hooksHooks in every AI coding agent: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Kiro and Factory DroidAgent Skills (SKILL.md) in every AI coding agent: Claude Code, Codex, Cline, Amp and OpenHandsHow to deploy a remote MCP server (Streamable HTTP): Cloudflare Workers, Vercel, Railway and moreHeadless mode in every AI coding agent: claude -p, codex exec, gemini -p, Cursor agent -p and copilot -p for scripts and CIClaude Code sandbox: /sandbox, sandbox.enabled, allowedDomains, excludedCommands and strict modeSandbox modes in every AI coding agent: Claude Code, Cursor, Codex and Gemini CLI comparedCustom slash commands in every AI coding agent: file locations, arguments and examplesMigrate from Gemini CLI to Antigravity CLI (2026): Config, MCP, Skills, FlagsAgent Loops 2026: Ralph Loop, /loop, /goal and Headless Loops for AI Coding AgentsWeb Scraping MCP Servers Compared (2026): Bright Data, Firecrawl, Apify, Tavily and BrowserbaseCursor skills and custom slash commands: .cursor/skills SKILL.md, .cursor/commands and /migrate-to-skillsCodex hooks: hooks.json, PreToolUse allow/deny, exit code 2 and config.toml [hooks]OpenCode custom commands: .opencode/commands, $ARGUMENTS, shell output and subtasks

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