A custom slash command is a configured shortcut that feeds structured instructions or scripts into an AI chat session when triggered with a forward slash. Adding custom slash commands to GitHub Copilot and Continue lets you standardize repetitive prompts across your workspace, from code reviews to architecture compliance. In GitHub Copilot, you define instructions in repository prompt files; in Continue, you register commands in config.json to run dedicated prompt templates directly in your editor.
Before you start
- Visual Studio Code or a supported editor running GitHub Copilot or the Continue extension.
- A repository where you want to add shared or workspace-specific configurations.
How it works
flowchart LR
A[Type slash command in chat] --> B{Resolve configuration}
B --> C[Copilot reads repository prompt file]
B --> D[Continue reads slashCommands array]
C --> E[Inject system prompt into session]
D --> E
Step 1: Add prompt instructions to Copilot
Create .github/copilot-instructions.md in your repository root to supply system-level prompt guidelines as described in GitHub Copilot Prompt Files. Markdown serves as the standard medium for agent instructions per Agentic AI Markdown Configuration. Specify the slash trigger and its review criteria.
# Project Instructions
When the user asks for `/review`, analyze the selected diff for:
1. Unhandled error paths and null references.
2. Missing test cases for new business logic.
3. Adherence to project architectural patterns.
Step 2: Register slash commands in Continue
Open your Continue configuration file at ~/.continue/config.json for global access, or .continue/config.json for workspace-level settings. Add your command object to the slashCommands array.
{
"slashCommands": [
{
"name": "review",
"description": "Review code against project guidelines",
"prompt": "Review the selected code for security flaws, performance bottlenecks, and style compliance."
}
]
}
Step 3: Test the commands in chat
Open the chat sidebar in your editor. Type / to open the command palette, select your registered command, and submit the prompt with your target code selected.
/review
Common mistakes
- Omitting command descriptions in Continue. If you omit the
descriptionkey inconfig.json, the editor autocomplete menu displays an empty label. Include a brief summary of what the command does. - Vague trigger instructions in Copilot. Copilot matches prompts using instruction files rather than a static command router. If your markdown instructions do not explicitly state what
/reviewshould evaluate, responses will remain generic. - Editing Continue configuration without reloading. The Continue runtime caches
config.jsonon startup. Reload the editor window after saving changes to make new slash commands visible.
Frequently asked questions
Can I run terminal scripts from a Continue slash command?
Continue allows slash commands to invoke custom prompts or run external script logic specified in config.json. You can configure a command to preprocess code or fetch context before dispatching the final prompt to the model.
How does Copilot know when to execute a custom slash command?
GitHub Copilot parses instructions located in .github/copilot-instructions.md as active context. When you input /review into the chat interface, the model reads the matching guidelines defined in that repository file to shape its output.
Where should Continue slash commands be saved?
Save commands in ~/.continue/config.json to use them across all personal repositories, or commit .continue/config.json inside a project root to share command templates with team members working on the same codebase.
Related
- Skills, Commands, Subagents or Hooks: Which to Use compares slash commands against agent hooks and autonomous workers.
- Why AI Coding Agent Tools Prefer Grep Over LSP Servers explains how tools gather context efficiently during command execution.
- Review GitHub Copilot Prompt Files for prompt structuring patterns.
- Read Agentic AI Markdown Configuration on organizing agent instructions in markdown.