Beginner

Introduction to GitHub Copilot Chat

Discover how AI-powered chat transforms your VS Code experience. Learn about chat modes, slash commands, participants, and context variables that make Copilot Chat your most powerful coding companion.

What is GitHub Copilot Chat?

GitHub Copilot Chat is an AI-powered conversational interface built directly into VS Code (and other IDEs). Unlike standard Copilot code completions that suggest code as you type, Copilot Chat lets you have a natural language conversation with AI about your code, your project, and your development workflow.

Think of it as having an expert developer sitting next to you who can explain code, write new functions, fix bugs, generate tests, and answer questions — all without leaving your editor.

💡
Good to know: Copilot Chat is a separate feature from Copilot's inline code completions. While completions happen automatically as you type, Chat is an on-demand conversational tool you explicitly interact with.

Three Ways to Chat

Copilot Chat offers three distinct interaction modes, each designed for different situations:

1. Chat Panel

The full chat panel lives in the VS Code sidebar. Open it with Ctrl+Shift+I (Windows/Linux) or Cmd+Shift+I (Mac). This is best for extended conversations, exploring complex topics, and multi-turn interactions where you need to refine your requests.

2. Inline Chat

Inline chat appears directly in your editor, right next to your code. Trigger it with Ctrl+I (Windows/Linux) or Cmd+I (Mac). This is perfect for quick edits, refactoring selected code, or generating code at the cursor position.

3. Quick Chat

Quick chat is a lightweight popup for fast questions. Open it with Ctrl+Shift+Alt+L. It disappears after your question, making it ideal for quick lookups without interrupting your flow.

Mode Shortcut Best For
Chat Panel Ctrl+Shift+I / Cmd+Shift+I Extended conversations, complex questions, project exploration
Inline Chat Ctrl+I / Cmd+I Quick edits, refactoring, code generation at cursor
Quick Chat Ctrl+Shift+Alt+L Fast lookups, one-off questions

Slash Commands

Slash commands are shortcuts that tell Copilot Chat exactly what kind of task you want to perform. They focus the AI's response and often produce better results than free-form questions.

Slash Commands
/explain   - Explain how the selected code works
/fix       - Propose a fix for problems in the selected code
/tests     - Generate unit tests for the selected code
/doc       - Add documentation comments to the selected code
/workspace - Answer questions about the entire workspace
/new       - Scaffold a new project or file
/clear     - Clear the current chat session
Pro tip: You can combine slash commands with natural language. For example: /fix the null pointer exception in the handleSubmit function gives Copilot more context to work with.

Chat Participants

Chat participants (prefixed with @) direct your question to a specific domain expert within Copilot Chat. Each participant has specialized knowledge about a particular area:

  • @workspace — Has context about your entire project. Ask about file structure, dependencies, architecture, and project-wide questions.
  • @vscode — Knows about VS Code itself. Ask about settings, extensions, keybindings, and editor features.
  • @terminal — Understands terminal context. Ask about terminal errors, shell commands, and CLI tools.
Chat Participant Examples
// Ask about your project structure
@workspace How is the authentication system organized?

// Ask about VS Code features
@vscode How do I enable word wrap for markdown files?

// Ask about a terminal error
@terminal What does this npm error mean?

Context Variables

Context variables (prefixed with #) let you explicitly attach specific pieces of context to your chat messages. This helps Copilot understand exactly what you are referring to:

  • #file — Reference a specific file in your workspace. Copilot will read and consider that file's contents.
  • #selection — Reference the currently selected text in your editor.
  • #editor — Reference the entire contents of the active editor tab.
Context Variable Examples
// Reference a specific file
Explain the middleware in #file:src/middleware/auth.ts

// Use the current selection
Refactor #selection to use async/await instead of promises

// Reference the active editor
Write tests for the functions in #editor

How Copilot Chat Differs from Other Tools

It is important to understand where Copilot Chat fits in the broader ecosystem of AI developer tools:

Tool What It Does How It Works
Copilot Completions Suggests code as you type Automatic, inline, triggered by typing
Copilot Chat Conversational AI inside the editor On-demand, chat panel/inline/quick chat
Copilot CLI AI for shell commands Terminal-based, generates shell commands
Claude Code Agentic CLI coding assistant Terminal-based, reads/writes files autonomously

Supported IDEs

Copilot Chat is available in multiple development environments:

  • Visual Studio Code — Full support with all features including chat panel, inline chat, and quick chat
  • JetBrains IDEs — IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains products (chat panel support)
  • Neovim — Via the Copilot.vim plugin with chat integration
  • Visual Studio — Full support in Visual Studio 2022+
📚
Course focus: This course focuses on Copilot Chat in VS Code, which has the most complete feature set. Most concepts apply across all supported IDEs, but specific shortcuts and UI elements may differ.

💡 Try It: Think About Your Workflow

Before moving on, think about your current coding workflow. What tasks take the most time? Where do you get stuck? Copilot Chat can help with code explanation, debugging, testing, documentation, and more. Jot down your top pain points below:

Keep these in mind as we explore Copilot Chat's features. By the end of this course, you will know exactly how to address each one.