Chat
In this lesson, you’ll learn how to use Copilot Chat, your conversational interface to GitHub Copilot. You’ll explore how to ask questions, pull in files and issues for context, and use chat to understand, plan, and take action directly within your repository. By the end, you’ll know how to use Copilot Chat to reason about code, summarize changes, and get quick, context-aware help without leaving GitHub.
Problem
When working in GitHub, getting context takes time: reading through files, scanning issues, and piecing together what’s going on before making a change or review.
Traditional search and documentation can help, but they’re static and scattered. Copilot Chat solves this by letting you talk directly to your code and project context. Instead of hunting for answers, you can ask natural questions — “What does this function do?” or “Summarize the last few commits” — and get precise, context-aware responses in seconds.
What you need to know
Think of Copilot Chat as a smart teammate that lives on GitHub , right next to your code, issues, and pull requests. You ask questions in plain English; it answers with context from your repo and the artifacts you choose (files, folders, issues/PRs, uploaded docs, even entire Spaces). No cloning. No setup. Just open a chat and start getting answers.
Zero friction: Works from any browser—perfect for quick investigations, reviews, or onboarding without opening an IDE.
Richer context than the editor: Pull in multiple repos, issues/PRs, and uploaded files at once, so answers reflect the whole project, not just the file you’re editing.
Shareable by default: Your chat lives alongside the repo. Teammates can see the same context, reuse prompts, and convert insights into issues/PRs.
From answer to action: Draft issues, summarize PRs, or kick off an Agent to open a branch and start a change—without leaving GitHub.
How it differs from IDE chat
In VS Code, Copilot shines while you’re actively editing—inline completions, quick refactors, local testing.
On the web, Copilot Chat shines when you’re understanding and coordinating—repo exploration, design discussions, triage, and turning conversations into tracked work.
Mental model: IDE = type fast. Web = think together (and then make changes via PRs/Agents).
What makes it exciting
Ask real questions, get repo-aware answers: “What’s the startup path?” “Which services call this API?” “Why did this PR change auth?”
Compare and connect: Cross-reference files, issues, and PRs in one thread; Copilot surfaces patterns and risks you might miss.
Turn insight into momentum: One click to Create Issue with clean titles, checklists, and next steps—ready for your team to pick up.
Opening Copilot Chat
You can open Copilot Chat from almost any page on GitHub by selecting the Copilot icon in the top-right header menu bar.
If you open the chat from within a specific repository, that repository will be automatically included in the context.
Managing Context
From the chat window, you can add or remove context to guide Copilot’s responses:
Repositories – bring in one or more repos for multi-repo exploration.
Files & Folders – narrow focus to specific sections of code.
Copilot Spaces – curated collections of files/folders you want to analyze together.
Uploaded Files - anything from your computer that is relevant to the chat.
Choosing the AI Model
You can switch between different AI models depending on your needs.
For example, you may choose a faster, lightweight model for quick lookups or a more powerful reasoning model for deep analysis of a complex codebase.
Copilot categorizes certain requests as “premium” and counts them towards a finite limit, different models take up different amounts of premium requests depending on your plan.
What You Can Do in Chat
Copilot Chat is more than just a code explainer, it’s an interactive assistant for your repository. Some key use cases include:
Understand Your Code
Ask for explanations of a file, function, or class.
Compare implementations across different files.
Explore Project Workflows
Get summaries of open issues or pull requests.
Ask Copilot to highlight patterns or risks in existing work.
Create & Manage Issues
Draft new GitHub Issues directly from chat.
Turn a question or problem surfaced in chat into a tracked issue.
Write & Edit Code
Generate code snippets, algorithms, or boilerplate.
Refactor or optimize existing code.
Learn About Git & Workflows
Ask questions about Git commands or GitHub best practices.
Example: “How do I squash commits in this repo?”
Collaborative Insights
Use chat to brainstorm solutions, weigh tradeoffs, and document decisions.
Creating Issues
One of the most convenient features of Copilot chat is the ability to create issues directly from the chat window. This allows you to collaborate with Copilot on the contents of the issue and format it just right.
All you have to do is ask Copilot in the chat to create the issue and a dialog will automatically appear where you can collaborate on it.
✏️ Exercise
Goal: Practice opening Copilot Chat, managing context, and asking useful questions.
Step 1 – Open Copilot Chat
Go to any repository you have access to on GitHub.
Click the Copilot icon in the top-right header to open the chat window.
Notice that your current repo is automatically added as context.
Step 2 – Explore the Code
In the chat window, type:
Explain what the file README.md in this repo does.Review Copilot’s response and compare it with the README content.
Step 3 – Add More Context
From the chat window, click Add context → select another file (e.g., a
package.jsonor source file).Ask Copilot:
Based on the README.md and package.json, what does this project do and how do you run it?
Step 4 – Change Models
Switch the AI model in the chat window (e.g., from the default model to a reasoning model).
Re-ask the same question and compare how the answers differ.
Step 5 – Turn Insight into an Issue
Ask Copilot something like:
Are there any missing installation instructions in this project?If Copilot suggests improvements, use the “Create Issue” option to draft a new GitHub issue directly from chat.
Reflection Questions
Did Copilot’s answers match your expectations of the repo?
How did switching models affect the quality of responses?
How could using Copilot Chat save you time when onboarding to a new project?
Next Steps
You now know how to have engaging, context rich and productive conversations with Copilot directly from GitHub.com!
In the next step, you’ll learn how to bundle context from multiple sources into a Space.