Copilot Chat & inline chat
Ask questions, plan work and make edits in natural language. The quality of an answer depends on the context you give it — #-mentions, slash commands and attachments are how you control that context.
Four ways to chat
Use the surface that matches the size of the task.
Chat view
Secondary side bar
Longer conversations, planning, and agent sessions that touch many files.
Editor inline chat
In the editor at your cursor
Focused edits to a selection — refactor, rename, add error handling.
Terminal inline chat
Integrated terminal
Generate or explain a shell command without leaving the terminal.
Quick Chat
Floating command-palette style
A fast question without opening a panel.
1import { Router } from "express";2import { rateLimit } from "../middleware/rate-limit";34export const v1 = Router();5v1.use("/orders", rateLimit, ordersRouter);6v1.use("/users", rateLimit, usersRouter);7// Limits: 100 req/min per API key
Add rate limiting to the public API. 100 req/min per key, return 429 with Retry-After. #codebase #routes.ts
✓ Searched codebase for “express middleware”
✓ Read src/api/routes.ts, src/lib/redis.ts
✓ Ran npm test -- api — 42 passed
I added rateLimit() middleware backed by Redis and applied it to all /v1 routes. 3 files changed.
Ask, plan, or build — type # for context, / for commands
Add rate limiting to the public API. 100 req/min per key, return 429 with Retry-After. #codebase #routes.ts
✓ Searched codebase for “express middleware”
✓ Read src/api/routes.ts, src/lib/redis.ts
I added rateLimit() middleware backed by Redis and applied it to all /v1 routes. 3 files changed.
Ask, plan, or build — type # for context, / for commands
Context variables (#-mentions)
Type # in the chat input to attach context. Explicit context beats hoping Copilot finds the right file.
| Mention | What it attaches | Example prompt |
|---|---|---|
| #<file> / #<folder> | Attach a specific file or folder. Drag-and-drop from Explorer works too. | Where is auth validated in #auth.ts? |
| #<symbol> | Attach a function, class or other symbol (the containing file must be open). GitHub's cheat sheet lists the short form #sym. | Explain #parseInvoice |
| #selection | The text currently selected in the active editor. | Add JSDoc to #selection |
| #codebase | Requests a semantic search across the workspace. It does not paste the entire codebase into context. | How do we paginate API results? #codebase |
| #fetch | Retrieves a web page as context (VS Code asks before visiting new URLs). | Summarise the breaking changes #fetch https://… |
| #file | Current file's content (listed in GitHub's VS Code chat-variable reference). | Write tests for #file |
| Issue / PR context | Paste a GitHub issue or PR URL, or use Add Context → Issue… / Pull Request… | Implement https://github.com/org/repo/issues/42 |
| Images (vision) | Attach a screenshot or sketch; the model analyses it (input only). | Build this layout [screenshot.png] |
Slash commands
Type / for shortcuts to common tasks. Availability differs by IDE — the 'where' column is taken from GitHub's chat cheat sheet and the VS Code reference.
/explainExplain how the selected or active code works.
/fixPropose a fix for problems in the selected code.
/testsGenerate unit tests for the selected code.
/docGenerate documentation comments (the command is /doc, not /docs).
/newScaffold a new workspace, project or file.
/newNotebookScaffold a Jupyter notebook.
/planResearch and propose an implementation plan before coding.
/fixTestFailureFind and fix a failing test.
/setupTestsChoose and set up a test framework.
/optimizeAnalyse and improve running time of the selection.
/simplifySimplify the current code selection.
/compactCompress conversation context in long sessions.
/forkFork the conversation with its history.
/initGenerate or update workspace instructions.
/clearStart a fresh chat session.
/helpQuick reference for Copilot in this surface.
/models · /toolsOpen the model picker or configure tools.
/<prompt-or-skill>Run a prompt file or agent skill by name, e.g. /webapp-testing.
/generateNot a built-in command in current docs. Write the request in plain language, or make your own /generate prompt file.
/doc, not /docs
/doc. There is no built-in /generate — just describe what you want, or add the generate.prompt.md template from the ecosystem library to create your own /generate.Inline chat
Press ⌘I / Ctrl+I in the editor to edit in place. The diff is previewed inline; accept or discard it.
1import db from "./db.js";Convert to async/await and add error handlingAccept ⌘↵Discard1 change2−function getUser(id, cb) { db.find(id).then(u => cb(null, u)); }2+export async function getUser(id) {3+try { return await db.find(id); }4+catch (err) { throw new Error(`getUser($${id}) failed`, { cause: err }); }5+}6// …
Chat participants (@workspace, @terminal, @vscode)
Participants were the original way to route a question to a domain expert. In VS Code they are deprecated and not supported in the default Copilot agent harness.
| Participant | What it did | What to do now |
|---|---|---|
| @workspace | Answered questions about the open workspace. | Ask directly in Agent/Ask; add #codebase or specific files for grounding. |
| @terminal | Shell and terminal-output help. | Use terminal inline chat (⌘I / Ctrl+I) or attach terminal output. |
| @vscode | VS Code settings and command questions. | Ask directly — the Copilot harness can search settings and docs. |
| @github | GitHub skills (issues, PRs, search). | Use the GitHub MCP server or paste issue/PR URLs as context. |
| @azure | Azure services help (preview). | Use the Azure MCP server / extension tools. |
Still in other IDEs
@workspace or @github. Check your IDE's chat cheat sheet before relying on them.