Table of contents
GitHub Copilot — Symbols Cheatsheet
The Three Symbol Types
| Symbol | Where it works | Purpose |
|---|---|---|
|
|
Chat & inline | Select an agent / participant |
|
|
Chat | Attach a specific context reference |
|
|
Chat & inline | Issue a command (action shortcut) |
@ — Agents (Who You're Talking To)
Each agent has a different scope and set of capabilities.
| Agent | Description |
|---|---|
|
|
Searches across all files in the open workspace. Best for project-level questions like "how does X work in this repo?" |
|
|
Explains terminal output, suggests shell commands, and can run commands in the integrated terminal. |
|
|
Answers questions about VS Code settings, keybindings, and extensions. Can trigger editor commands. |
|
|
Pulls in issues, PRs, commits, and discussions from GitHub.com. Use when you need remote repo context. |
|
|
Provides Azure-specific guidance and can interact with Azure resources (requires Azure extension). |
# — Context Variables (What to Attach)
Pin exactly the context Copilot should focus on instead of letting it guess.
| Variable | Description | Example |
|---|---|---|
|
|
Attaches a specific file. Pick from the fuzzy-search dropdown. |
|
|
|
Scopes the answer to a single symbol (function, class, type). Faster than attaching the whole file. |
|
|
|
Passes the text you've currently highlighted in the editor. |
|
|
|
Attaches the full content of the currently active tab. |
|
|
|
Same as |
|
|
|
Passes selected text from the terminal panel — great for error messages. |
|
/ — Commands (What Action to Take)
Slash commands remove ambiguity about your intent.
| Command | Description |
|---|---|
|
|
Walks through what the selected code or file does in plain language. |
|
|
Diagnoses and proposes a fix. Works best with a compiler error or failing test pasted alongside. |
|
|
Generates unit tests using whatever test framework is detected in the project. |
|
|
Adds JSDoc / docstring comments to functions, classes, or the whole file. |
|
|
Scaffolds a new project from a description. Opens a preview before writing files. |
|
|
Searches the workspace using a natural-language query and returns relevant code or files. |
|
|
Rewrites selected code to be shorter or more idiomatic without changing behaviour. |
|
|
Reviews selection or file for bugs, style issues, and improvements. |
|
|
Generates a launch.json debug configuration for the current project. |
|
|
Scaffolds a test framework config (Jest, Vitest, etc.) for the project. |
|
|
Clears the current chat history and starts a fresh conversation context. |
|
|
Lists all available slash commands and agent capabilities in the current context. |
Combining Symbols
The real power comes from using all three together in one message.
@workspace /explain #file:auth.ts
@workspace /fix #sym:parseToken — cannot read property of undefined
@workspace /search JWT parsing middleware
@terminal explain this error
/tests #file:utils.ts #file:utils.test.ts
/new Express REST API with TypeScript
Pattern: @agent /command #context — optional natural language detail
How the Symbols Work Together
flowchart LR
A["You"] --> B["@agent\nWho processes it"]
A --> C["#context\nWhat data to use"]
A --> D["/command\nWhat action to take"]
B --> E["Copilot Response"]
C --> E
D --> E
style A fill:#1e1e2e,color:#cdd6f4,stroke:#89b4fa
style B fill:#313244,color:#cba6f7,stroke:#cba6f7
style C fill:#313244,color:#a6e3a1,stroke:#a6e3a1
style D fill:#313244,color:#f38ba8,stroke:#f38ba8
style E fill:#1e1e2e,color:#cdd6f4,stroke:#89b4fa
Example Breakdown
@workspace /fix #sym:parseToken — cannot read property of undefined
│ │ │ │
│ │ │ └── Natural language detail
│ │ └── Focus only on this symbol
│ └── Action: diagnose and fix
└── Agent: search the whole project
