Copilot Chat Everywhere
Copilot Chat is available in your editor, on GitHub.com, and on your phone. Learn every chat surface, participant, slash command, and context reference to get precise, actionable answers.
Copilot Chat in VS Code
VS Code offers three distinct ways to interact with Copilot Chat, each designed for a different workflow:
The Chat Panel
Open with Ctrl+Shift+I (Windows/Linux) or Cmd+Shift+I (Mac). This is a persistent chat window in the sidebar where you can have extended conversations. The panel retains your full conversation history for the current session and lets you reference files, ask follow-up questions, and receive code suggestions you can apply with a single click.
Inline Chat
Trigger with Ctrl+I (Windows/Linux) or Cmd+I (Mac). A compact chat input appears directly in your editor at the cursor position. This is ideal for quick, targeted requests like "add error handling here" or "convert this to TypeScript." The response appears as a diff you can accept or reject.
Quick Chat
Open with Ctrl+Shift+Alt+L. A floating input at the top of the editor for fast, one-off questions. Think of it as a command palette for AI - ask a question, get an answer, and dismiss. It does not persist in the sidebar.
Copilot Chat on GitHub.com and GitHub Mobile
Copilot Chat is not limited to your code editor. It is deeply integrated into GitHub's web interface and mobile app.
Chat on GitHub.com
Click the Copilot icon in the bottom-right corner of any GitHub page to open a chat panel. Context-aware features include:
- In a repository: Copilot understands the repo's codebase and can answer questions about the code, explain files, and suggest changes
- In a pull request: Ask Copilot to explain the PR's changes, identify potential issues, or suggest improvements to specific files
- In an issue: Get help drafting issue descriptions, understanding discussion threads, or brainstorming solutions
- General knowledge: Ask programming questions, get syntax help, or discuss best practices - even outside a specific repo
Chat on GitHub Mobile
The GitHub Mobile app (iOS and Android) includes Copilot Chat, so you can ask questions about your repositories on the go. This is useful for reviewing code during commutes, quickly looking up how a function works, or triaging issues away from your desk.
Chat Participants: @workspace, @terminal, @vscode
Chat participants are special scoped contexts you can invoke in Copilot Chat to give the AI access to specific parts of your environment. Use them by typing @ followed by the participant name.
| Participant | What It Does | Example Prompt |
|---|---|---|
@workspace | Searches your entire workspace/project to answer questions about the codebase | @workspace How does authentication work in this project? |
@terminal | Has context about your terminal history and can help with shell commands | @terminal Why did my last npm command fail? |
@vscode | Knows about VS Code settings, extensions, and configuration | @vscode How do I change the font size in the integrated terminal? |
The @workspace participant is especially powerful. It uses a combination of local search indexes and embeddings to find relevant files across your entire project, even if they are not currently open. This lets you ask high-level architecture questions like:
@workspace What database does this project use and where is the connection configured?
Copilot will search your workspace, find database configuration files, connection strings, and ORM setup, then provide a comprehensive answer with file references.
Slash Commands
Slash commands are shortcuts that tell Copilot exactly what kind of response you want. Type / in the chat input to see all available commands:
| Command | Purpose | Example |
|---|---|---|
/explain | Get a detailed explanation of selected code | Select a regex, then type /explain |
/fix | Get a fix for bugs or errors in the selected code | Select broken code, then /fix |
/tests | Generate unit tests for the selected code | Select a function, then /tests |
/doc | Generate documentation or comments | Select a class, then /doc |
/optimize | Suggest performance improvements | Select a slow loop, then /optimize |
/new | Scaffold a new project or file | /new Create an Express.js REST API with TypeScript |
Here is a practical example using /tests. Select a function in your editor, then type:
/tests Generate comprehensive unit tests including edge cases for empty input, null values, and boundary conditions
Copilot will generate a complete test suite tailored to your function, using the testing framework already present in your project (Jest, pytest, JUnit, etc.).
Context References: #file, #selection, and More
Context references let you point Copilot to specific pieces of information. They are critical for getting accurate, targeted responses:
#file:path/to/file.ts- Include the contents of a specific file in your prompt. Copilot reads the entire file and uses it as context.#selection- Reference the currently selected text in your editor. Equivalent to "look at what I have highlighted."#editor- Reference the entire visible content in the active editor tab.#terminalLastCommand- Include the output of the last command you ran in the integrated terminal.#terminalSelection- Include text you have selected in the terminal.
Combining participants and context references creates powerful, precise prompts:
@workspace I need to add a new API endpoint for user preferences. Look at #file:src/routes/users.ts for the existing pattern and #file:src/models/User.ts for the data model. Generate the route handler and update the model with a preferences field.
This prompt gives Copilot your project context (@workspace), the existing code patterns (#file references), and a clear request - resulting in code that matches your project's conventions.
Switching Between Models
Copilot Chat supports multiple AI models. In VS Code, look for the model selector dropdown at the bottom of the chat panel. Available models typically include:
- GPT-4o - Default. Fast responses, strong at code generation and general-purpose tasks.
- GPT-4o mini - Faster and cheaper for simple questions. Good for quick lookups.
- Claude 3.5 Sonnet - Excellent for nuanced reasoning, complex refactoring, and understanding large codebases.
- Claude 3.5 Haiku - Fast Anthropic model for straightforward tasks.
- Gemini 2.0 Flash - Google's fast model, strong at multi-language tasks.
When to switch models:
- Stuck on a hard bug? Try Claude 3.5 Sonnet - its careful reasoning often catches issues GPT-4o misses
- Need a quick syntax reminder? GPT-4o mini or Gemini Flash will respond faster
- Working with a very large file? Claude models handle long contexts better
- Getting repetitive answers? Switching models can give you a fresh perspective
Prompting Best Practices for Copilot Chat
The quality of Copilot Chat's responses depends directly on how you ask. Here are proven techniques:
- Be specific about the output format. Instead of "help me with this code," say "refactor this function to use async/await and add JSDoc comments."
- Provide context. Use
#filereferences, paste error messages, or describe the broader goal. The more context Copilot has, the better it performs. - Use role-based prompting. "Act as a senior TypeScript developer reviewing this code for production readiness" gives Copilot a persona that shapes its response.
- Break complex tasks into steps. Instead of "build me a full authentication system," start with "design the database schema for user authentication" and iterate.
- Ask for alternatives. "Show me three different approaches to implement caching here, with pros and cons of each."
- Reference your tech stack. "I'm using Next.js 14 with the App Router and Prisma ORM" prevents Copilot from suggesting outdated patterns.
# Bad prompt (vague, no context): "Fix this code" # Good prompt (specific, contextual, actionable): "This Express middleware in #file:src/middleware/auth.ts returns a 500 error when the JWT token is expired instead of a 401. Fix the error handling to distinguish between expired tokens and invalid tokens, returning appropriate HTTP status codes and error messages for each case."
.github/copilot-instructions.md file to your repository. This file tells Copilot about your project's conventions, preferred libraries, and coding standards - and it automatically applies to every chat session in that repo.Ready to Go Deeper?
Live instructor-led courses from our partners. Affiliate disclosure.
AI & ML Courses - 30% Off
Live instructor-led AI, machine learning, data science, and cloud courses for working professionals. Use code Limited30 at checkout.
EdurekaDataCamp - AI & Data Science
Hands-on Python, machine learning, and AI courses with interactive exercises and real projects.
DataCampedX - Top AI Courses
University-level AI courses from MIT, Harvard, Stanford. Earn certificates that employers recognize.
edX