Copilot Chat

Chat is the “talk to the repo” door: explain code, write tests, fix diagnostics, draft patches. Official pages: Getting started with prompts for Copilot Chat in your IDE and Prompt engineering for Copilot Chat.

Completions speed up a line you already know you want. Chat fits “ask first, then change.” Org admins can disable Chat while inline suggestions still work.


How to open it

Side-pane Chat (VS Code)

OSShortcut
Windows / LinuxCtrl+Alt+I
macOSControl+Command+I

The title-bar Copilot / Chat icon works too. Above the input you can usually switch modes (labels drift; common names are Ask / Edit / Agent):

  • Ask: Q&A; does not rewrite a pile of files by default
  • Edit: change a scoped set of files from your instruction
  • Agent: multi-step, may run commands and touch many files—see Coding Agent

Inline chat
Ask about a selection in the editor. Defaults are often Ctrl+I on Windows and Cmd+I on macOS. If another extension stole the chord, search Keyboard Shortcuts for inline chat. Inline fits “this hunk only”; repo-wide questions belong in the side pane with @workspace.

JetBrains: use the Copilot Chat tool window; the repo participant is @project, not @workspace.


Put the repo in context

The model does not see “the whole Git history in your head”—only the context you supply. Official tactics:

MoveEffect
Select codeThe selection enters the prompt
Open related filesThe active editor is default context
#file / #selection / #editor / #codebase / #gitChat variables, explicit refs
@workspace (VS Code / Visual Studio)Answers that need project structure (“how are notifications scheduled?”)
@project (JetBrains)Same idea, different participant name
@vscodeQuestions about VS Code itself (debug, keybindings, themes)
@terminalCommand-line help; #terminalLastCommand explains the last command

Examples:

@workspace How are notifications scheduled? Cite files. Do not invent a queue if none exists.
#file:app.js #file:routes.js How are these files related?

Start a new thread for a new task and drop stale turns so history does not drag the model sideways.


Slash commands (the ones you will actually use)

In VS Code, type / to see the live list:

CommandTypical use
/explainExplain the selection or current file
/fixPropose a fix for errors in the active file
/testsTests for existing code (you can name a framework)
/newSuggest a new project layout (preview, then create files)
/newNotebookSuggest a Jupyter notebook

/tests means “tests for code that already exists.” For TDD, ask Add tests for a function that sums integers without /tests first.

You can also ask about GitHub Advanced Security alerts when you have access (How would I fix this alert?)—see the Advanced Security section in GitHub’s Chat docs.


What a good question looks like

Useful:

@workspace List install, test, and lint commands from package.json / Makefile / pyproject.toml.
Quote the script names. Do not invent npm scripts.
/tests using the project's existing test runner. Do not add a new framework.

Weak: “optimize this” with no file, no success bar, and no forbidden changes.

When Chat returns a code block, use GitHub’s copy / insert at cursor / new file / terminal actions. Run tests after insert; “looks plausible” is not a review.

Prompt shape: GitHub’s Prompt engineering page—point at the relevant code, control history, one job per turn.


Chat on github.com

You do not need an IDE: open a file or PR, click the Copilot icon (top right), ask Explain this file. or Summarize this pull request. Details: GitHub Integration.

Windows Terminal Canary has experimental Terminal Chat (pick GitHub Copilot in Settings and authenticate). Do not assume the same entry exists in stable Windows Terminal. On macOS use IDE Chat or the CLI.


Privacy and scope

  • Do not paste secrets, customer data, or unpublished security details into Chat.
  • Use org content exclusion for secret files, build artifacts, and huge data dirs.
  • Free plans cap Chat; the live plan page wins.

Next

评论