GitHub Copilot Chat in VS Code: Complete Guide to Features, Agent Mode & Models (2026)
GitHub Copilot Chat in VS Code: Complete Guide to Features, Agent Mode & Models (2026)
GitHub Copilot has become the most widely used AI coding assistant in VS Code. But most developers only use about 20% of what it can do.
This guide covers every major feature of GitHub Copilot Chat in Visual Studio Code — from basic inline completions to autonomous agent mode that can implement entire features across your whole codebase.
What Is GitHub Copilot Chat in VS Code?
GitHub Copilot Chat is an AI assistant built into VS Code that goes beyond simple autocomplete. It can:
- Answer coding questions with full project context
- Generate, refactor, and explain code
- Run terminal commands on your behalf
- Edit multiple files simultaneously
- Autonomously implement features (agent mode)
- Integrate with external tools via MCP servers
It's powered by large language models (GPT-4.1, Claude 3.5/3.7, Gemini) and is tightly integrated into the VS Code interface.
Getting Started: Installation & Setup
Prerequisites
- VS Code (latest stable version recommended)
- A GitHub account
- A GitHub Copilot subscription (Free tier available with limits)
Installation Steps
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X) - Search for "GitHub Copilot"
- Install both: - GitHub Copilot — inline completions - GitHub Copilot Chat — chat interface (included in main extension since late 2024)
- Sign in with your GitHub account
- Accept the Copilot terms
Verifying It Works
After installation, you should see:
- A Copilot icon in the status bar (bottom right)
- A chat icon in the Activity Bar (left sidebar)
- Inline suggestions appearing as you type
The Three Chat Modes
GitHub Copilot Chat in VS Code has three distinct interaction modes:
1. Ask Mode (Chat Panel)
Open with Ctrl+Alt+I or click the chat icon.
General-purpose Q&A mode. Ask anything about your code, concepts, errors, or VS Code itself.
Best for: Questions, explanations, learning, exploring options
Example prompts:
Explain what this function does
What's the difference between useMemo and useCallback?
How do I parse JWT tokens in Node.js?
2. Edit Mode
Click the Edit tab in the chat panel (or use Ctrl+Shift+I).
Propose and apply changes to specific files. Copilot highlights what will change and you accept/reject the diff.
Best for: Targeted, single-file or few-file changes with fine-grained control
Example prompts:
Add input validation to this form component
Refactor this class to use TypeScript generics
Add error handling to all async functions in this file
3. Agent Mode
Click the Agent tab or select it from the chat dropdown.
Autonomous multi-step task execution. Copilot analyzes your entire workspace, makes a plan, edits files, runs commands, checks errors, and iterates until done.
Best for: Complex, multi-file features and tasks
Example prompts:
Create a complete authentication system with JWT
Add dark mode support to the entire app
Write unit tests for every function in the utils/ folder
Set up ESLint and Prettier with our team's config
Agent Mode: Deep Dive
Agent mode is the most powerful — and most misunderstood — feature in GitHub Copilot Chat.
How Agent Mode Works
- You give a high-level goal in natural language
- Copilot makes a plan (shown step-by-step)
- It reads relevant files from your workspace
- It edits multiple files simultaneously
- It runs terminal commands if needed
- It checks for errors (build errors, lint warnings, test failures)
- It iterates and fixes issues until done
Enabling Agent Mode
Agent mode is generally available as of mid-2025 in VS Code Stable. Select it from the chat mode dropdown.
Terminal Auto-Approval
By default, Copilot asks for permission before each terminal command. You can enable auto-approval for trusted commands:
{
"github.copilot.chat.agent.runTasks": true,
"github.copilot.chat.terminalChatLocation": "chatView"
}
Parallel Agent Sessions
You can run multiple agent sessions simultaneously — useful for working on different branches or features at the same time. Each session has its own context and history.
Custom Agents
Create specialized agents with custom roles:
Create .github/copilot/agents/code-reviewer.md:
# Code Reviewer Agent
You are a strict code reviewer. For every code change:
1. Check for security vulnerabilities
2. Verify error handling is comprehensive
3. Ensure code follows SOLID principles
4. Comment on performance implications
Supported AI Models
One of Copilot Chat's most powerful features (available to Pro+ users) is model switching. Different models excel at different tasks.
Available Models in VS Code (2026)
| Model | Best For |
|---|---|
| **GPT-4.1** | Large context tasks, documentation, general coding |
| **GPT-4o** | Fast responses, everyday coding questions |
| **Claude 3.5 Sonnet** | Complex reasoning, code review, analysis |
| **Claude 3.7 Sonnet** | State-of-the-art code generation, long-context tasks |
| **Gemini 1.5 Pro** | Multi-modal (image + code), large codebase exploration |
| **o1** | Mathematical problems, algorithm design, reasoning |
| **o3-mini** | Fast reasoning tasks |
How to Switch Models
Click the model name at the top of the chat panel and select a different model from the dropdown.
Model Selection Tips
- Use Claude 3.7 for complex refactoring or architecture decisions
- Use GPT-4o for fast everyday questions
- Use o1 for algorithm problems or debugging complex logic
- Use GPT-4.1 when working with large files or entire codebases
Chat Participants and Slash Commands
Built-in Chat Participants
Prefix your message with @ to address a specific context:
| Participant | What It Does |
|---|---|
| `@workspace` | Answer questions about your entire workspace |
| `@vscode` | Get help with VS Code settings, commands, keybindings |
| `@terminal` | Get help with terminal commands |
| `@github` | Search GitHub issues, PRs, repos |
Examples:
@workspace Where is user authentication handled?
@vscode How do I change the font size?
@terminal How do I kill a process on port 3000?
@github Show me recent issues tagged 'bug'
Slash Commands
| Command | Purpose |
|---|---|
| `/explain` | Explain selected code |
| `/fix` | Fix errors in selected code |
| `/tests` | Generate unit tests |
| `/doc` | Generate documentation |
| `/new` | Create a new file or project |
| `/newNotebook` | Create a Jupyter notebook |
| `/help` | Get Copilot usage help |
Context Variables
Attach specific context to your prompts with #:
| Variable | Attaches |
|---|---|
| `#file` | A specific file |
| `#selection` | Currently selected code |
| `#editor` | Active editor contents |
| `#codebase` | Full workspace code search |
| `#terminalLastCommand` | Last terminal command output |
| `#terminalSelection` | Selected terminal text |
Example:
#file:auth.ts Review this for security vulnerabilities
#terminalLastCommand What does this error mean?
Custom Instructions: Making Copilot Follow Your Rules
Custom instructions let you define project-wide or user-wide rules that Copilot always follows.
Workspace Instructions
Create .github/copilot-instructions.md:
# Project Rules for Copilot
## Code Style
- Use TypeScript strict mode
- Prefer functional components over class components
- Use named exports, not default exports
- Always handle async errors with try/catch
## Git
- Commit messages must use Conventional Commits format
- Always include a test file when adding new features
## Testing
- Write tests in Vitest, not Jest
- Minimum 80% coverage for new code
Copilot reads this file and follows these rules for every response in your workspace.
MCP Servers: Extending Copilot with External Tools
The Model Context Protocol (MCP) allows Copilot to connect to external services and tools.
What You Can Connect
- Databases — ask Copilot to query your Postgres or MongoDB
- APIs — fetch live data during chat
- File systems — access files outside the workspace
- GitHub — deeper GitHub integration beyond
@github - Custom tools — build your own MCP server
Adding an MCP Server
In .vscode/mcp.json:
{
"servers": {
"my-database": {
"type": "stdio",
"command": "node",
"args": ["./mcp-server/db-server.js"]
}
}
}
Once configured, Copilot can invoke these tools during chat.
Inline Chat: Ask Copilot Without Leaving Your Code
Press Ctrl+I with code selected to open inline chat — a mini chat window right inside your editor.
Common Inline Chat Uses
/fix — Fix the selected code
/explain — Explain what this does
/doc — Add JSDoc comments
Add error handling
Convert this to async/await
Make this function more readable
The inline diff appears immediately so you can accept or discard with one key press.
GitHub Copilot Chat on Mobile
All these powerful features are available on your desktop VS Code. But what if you need to:
- Review code changes during your commute
- Ask Copilot a question about your project from your phone
- Run agent mode on a task while away from your desk
VSCode Mobile gives you full access to the VS Code Copilot Chat interface — including the chat panel, agent mode, and inline suggestions — from any mobile browser. No app installation required.
Open your VS Code environment from your phone and use Copilot Chat exactly as you do on desktop.
Summary: GitHub Copilot Chat Modes at a Glance
| Mode | Trigger | Best For |
|---|---|---|
| Ask | `Ctrl+Alt+I` | Questions, explanations |
| Edit | `Ctrl+Shift+I` | Targeted file edits |
| Agent | Chat dropdown | Multi-file, multi-step tasks |
| Inline | `Ctrl+I` | Quick fixes while coding |
GitHub Copilot Chat in VS Code is no longer just an autocomplete tool — it's a fully capable AI engineering partner that can plan, implement, test, and iterate on entire features alongside you.
Get Copilot Chat on Every Device
Don't limit your AI-assisted coding to your desktop. Access GitHub Copilot Chat in VS Code from any device — including your phone or tablet.
Your AI pair programmer. Everywhere you are.
Install the extension, sign in with Google, enter your linking code, and click Connect. Your phone becomes your coding companion in under a minute.
Get started →
VSCodeMobile