GitHub Copilot Chat becomes much more useful when you understand its three main control surfaces: participants, slash commands, and variables. Participants decide who should answer. Slash commands decide what kind of task you want. Variables decide which files, selections, terminals, or workspace context should be brought into the prompt.
That separation is easy to miss at first because the UI treats them as one conversational flow. In practice, they solve different problems. Participants narrow the domain, commands narrow the intent, and variables narrow the context.
The short version
If you only type plain natural language, Copilot still works. But the more specific your request, the more useful it becomes.
The basic pattern is simple:
@workspace /explain #file:src/app/page.tsx
That single prompt says three things at once: use the workspace-aware participant, explain the request rather than editing code, and inspect a specific file instead of guessing which part of the project matters.
Participants: who should answer
Participants are the @ mentions in chat. They tell Copilot which specialized assistant should own the request.
The built-in participants are already useful for most day-to-day work:
1 @workspace
Best for questions about the codebase, project structure, and nearby files.
2 @vscode
Useful when the question is about VS Code itself or extension-related behavior.
3 @terminal
Helpful when the answer is a shell command or a terminal workflow.
@workspace Why is the login page redirecting too early?
@terminal How do I list only the git branches merged into main?
@vscode How do I register a chat participant in an extension?
That is the main reason participants matter. They keep the assistant from acting like a generic chatbot when the task is actually domain-specific.
Slash commands: what should happen
Slash commands are the / prefixes you type after a participant. They are shortcuts to a more specific mode inside that participant.
The VS Code docs show examples such as /explain and /new, and the exact set of commands depends on the participant.
@workspace /new Node.js Express Pug TypeScript
@workspace /explain #selection
@terminal /help
The important idea is that the command reduces ambiguity. @workspace create a project is broad. @workspace /new Node.js Express Pug TypeScript is much more precise.
Variables: what context should be included
Variables are the # mentions. They let you explicitly attach files, selections, terminal output, folders, symbols, or search context.
| Variable | Use case |
|---|---|
| #file | Point Copilot at a specific file |
| #selection | Use the highlighted code as the prompt source |
| #codebase | Ask a question that needs broader repository context |
| #terminalSelection | Reuse selected terminal output as context |
| #fetch | Pull in content from a URL or external source |
@workspace /explain #file:src/components/nav-search.tsx
@workspace /fix #selection #terminalSelection
@workspace What changed in #codebase around the auth flow?
This is the biggest upgrade over plain chat. Variables let you point at the exact evidence instead of asking Copilot to infer it from the current editor state.
A practical comparison
| Part | Symbol | Job |
|---|---|---|
| Participant | @workspace | Choose the domain or assistant that should respond |
| Slash command | /explain | Choose the action or mode for that participant |
| Variable | #file | Choose the exact context Copilot should inspect |
If you keep that division in mind, the chat UI becomes much easier to reason about. You are not just typing a request. You are routing it.
A workflow example
Imagine you are debugging a React issue and want a focused answer.
@workspace /explain #file:src/app/login/page.tsx #selection
That prompt tells Copilot to stay in the workspace domain, explain the current snippet, and use the code you selected as the primary source of truth.
If the issue spans multiple files, you can add more context:
@workspace /fix #file:src/app/login/page.tsx #file:src/lib/auth.ts
The point is not to overload the prompt. The point is to remove guesswork.
When to use each one
A small extension-side note
If you build chat extensions, the same concepts show up in the API surface. VS Code extensions can contribute chat participants with @ names, add slash commands, and inspect request variables from the chat request handler.
const handler: vscode.ChatRequestHandler = async (
request,
context,
stream,
token
) => {
if (request.command === 'explain') {
stream.markdown('Explaining the selected context.');
return;
}
stream.markdown('Prompt: ' + request.prompt);
};
That is not required for normal Copilot usage, but it shows why the model is structured this way. The UI concepts map directly to extension concepts.
Bottom line
Participants choose the assistant, slash commands choose the task, and variables choose the context.
If you use those three pieces deliberately, Copilot Chat becomes more predictable and more useful. The prompt gets shorter, the response gets more relevant, and you spend less time correcting the assistant after the fact.