Know Your GitHub Copilot — The Complete Guide
A developer's guide to understanding GitHub Copilot — the models behind it, code completions, Copilot Chat, agent mode, the agentic Copilot CLI, the Copilot coding agent, custom instructions, MCP, plans, and how to get better results from the AI pair-programmer built into your editor and terminal.
Microsoft ships many products branded "Copilot" — Microsoft 365 Copilot, Copilot in Windows, Security Copilot, Sales/Service Copilot, and the consumer Microsoft Copilot app. This guide is only about GitHub Copilot, the AI coding assistant for developers. When people say "Copilot" in an engineering context, this is almost always what they mean.
1. GitHub Copilot — The Name & A Brief History
Who Makes It?
GitHub Copilot is built by GitHub (a Microsoft subsidiary) in partnership with OpenAI. The very first version was powered by OpenAI Codex, a model descended from GPT-3 and trained on public code. Today Copilot is model-agnostic — it can run on models from OpenAI, Anthropic, and Google (more on that below).
Timeline
- June 29, 2021: GitHub Copilot launched as a technical preview, offering AI autocomplete ("ghost text") inside the editor, powered by OpenAI Codex.
- June 21, 2022: Copilot became generally available for individual developers as a paid subscription.
- 2023 (February): Copilot for Business launched, adding organization-wide policy controls.
- March 22, 2023: Copilot X was announced — a vision expanding Copilot from autocomplete into chat, CLI, pull requests, and docs.
- 2023 (December): Copilot Chat became generally available in VS Code and Visual Studio.
- February 2024: Copilot Enterprise launched, adding codebase-aware chat and knowledge bases.
- 2024–2025: A model picker arrived (Claude, Gemini, and multiple OpenAI models), followed by Copilot Edits, agent mode, the Copilot coding agent, and the agentic Copilot CLI.
- 2025: A free tier of GitHub Copilot became available to all GitHub users.
Copilot's arc mirrors Codex and Claude Code: it started as autocomplete and grew into a full agentic system that can read a repo, edit files, run commands, and complete tasks.
2. Why the Name "Copilot" Fits
A copilot sits beside the pilot: assisting, suggesting, and handling workload — but the pilot stays in command.
That metaphor is deliberate:
- You are the pilot. Copilot suggests; you decide, review, and accept.
- It reduces workload on routine stretches (boilerplate, tests, repetitive edits).
- It is always assistive — the human remains responsible for the final code.
The "copilot, not autopilot" idea is central to how GitHub positions the tool. Even in fully agentic modes, the design encourages review and approval rather than blind trust.
3. What Is GitHub Copilot? (One Name, Many Surfaces)
GitHub Copilot is not a single feature — it's a family of capabilities that share your account and context across different surfaces.
| Surface | What It Does | Where It Lives |
|---|---|---|
| Code completions | Inline "ghost text" suggestions as you type | Editor (VS Code, JetBrains, Visual Studio, Neovim, Xcode) |
| Copilot Chat | Conversational Q&A about your code | Editor side panel, inline chat, and github.com |
| Copilot Edits | Multi-file edits from a single prompt | VS Code / Visual Studio |
| Agent mode | Autonomous multi-step tasks with tools & terminal | VS Code / Visual Studio / JetBrains |
| Copilot CLI | Agentic coding in the terminal | Terminal (copilot) |
| Copilot coding agent | Assign a GitHub Issue; Copilot opens a PR | github.com (cloud) |
| Copilot code review | AI review comments on pull requests | github.com |
The key idea: one subscription, one context, many entry points — from autocomplete all the way to an autonomous agent that opens pull requests.
4. The Models Behind Copilot
Early Copilot ran only on OpenAI Codex. Modern Copilot lets you pick the model from a dropdown (the "model picker") in Chat, agent mode, and the CLI.
Depending on your plan and what's currently available, the picker typically includes:
- OpenAI models (the GPT family and reasoning models)
- Anthropic Claude models (Sonnet / Opus tiers)
- Google Gemini models
- Use a fast, general model for autocomplete and simple edits.
- Switch to a stronger reasoning model (e.g. a Claude Opus / OpenAI reasoning tier) for architecture, tricky debugging, and large refactors.
- Model availability depends on your plan and org policy — Business/Enterprise admins can enable or restrict specific models.
Because the model is swappable, "Copilot" refers to the product and workflow, not a single underlying model — much like "Codex" today means the agent, not just the 2021 model.
5. Plans & Pricing Tiers
GitHub Copilot is offered in individual and organization plans. Exact limits and prices change over time, so treat this as the shape of the lineup, not a price sheet.
| Plan | Who It's For | Highlights |
|---|---|---|
| Copilot Free | Anyone with a GitHub account | Limited monthly completions & chat messages, no cost |
| Copilot Pro | Individual developers | Unlimited completions, chat, model picker |
| Copilot Pro+ | Power users | Higher limits and access to more premium models |
| Copilot Business | Teams / orgs | Policy controls, content exclusions, seat management |
| Copilot Enterprise | Large orgs | Everything in Business + codebase-aware chat, knowledge bases, and org-wide customization |
Some plans meter access to the most expensive models using premium requests. Lightweight work (basic completions) is generally unmetered, while heavy agentic runs on top-tier models may draw from a premium allowance. Check Settings → Copilot on github.com for your current usage.
6. Getting Started
In VS Code
- Install the GitHub Copilot extension (it bundles Copilot Chat).
- Sign in with your GitHub account when prompted.
- Start typing — grey ghost text appears. Press
Tabto accept. - Open Chat with the Copilot icon or the chat keyboard shortcut.
In JetBrains / Visual Studio / Neovim / Xcode
Install the official GitHub Copilot plugin/extension from the respective marketplace and authenticate with GitHub. The core completion and chat experience is consistent across editors.
The Agentic Copilot CLI (Terminal)
The newer, agentic CLI brings a Codex-CLI / Claude-Code-style experience to your terminal:
npm install -g @github/copilot
copilot
On first launch it will walk you through authentication with your GitHub account. Requires a recent Node.js.
Don't confuse these:
gh copilot— an older GitHub CLI extension that suggests and explains shell commands (gh copilot suggest,gh copilot explain). It does not edit your repo.copilot(the Copilot CLI) — the agentic terminal coding agent that can read, edit, and run code in your project. This is the true peer of Codex CLI and Claude Code.
7. Code Completions — The Original Superpower
As you type, Copilot proposes the next lines as ghost text.
Tab— accept the full suggestionEsc— dismiss itAlt/Option + ]/Alt/Option + [— cycle between alternative suggestions- Accept word-by-word with the editor's partial-accept shortcut
Completions are strongest when you give Copilot signal: a descriptive function name, a clear comment describing intent, nearby types, and relevant open files. The more context in view, the better the suggestion.
# calculate compound interest for principal p, annual rate r, years n
def compound_interest(p, r, n):
# Copilot will propose the body based on the comment + signature
8. Copilot Chat — Talking to Your Code
Copilot Chat lets you ask questions, request changes, and reason about code in natural language. It comes in three flavors:
- Panel chat — a side conversation about your project
- Inline chat — invoke chat right in the editor on a selection (great for "fix this" / "explain this")
- Quick chat — a lightweight prompt bar
Slash Commands
Slash commands are shortcuts for common intents inside Chat:
| Command | What It Does |
|---|---|
/explain | Explain the selected code or file |
/fix | Propose a fix for a problem or error |
/tests | Generate unit tests for the selection |
/doc | Add documentation comments |
/optimize | Suggest performance/readability improvements |
/new | Scaffold a new project or file |
/fixTestFailure | Diagnose why a test is failing |
/clear | Start a fresh chat |
Chat Participants (@)
Participants aim your question at a specific domain of knowledge:
| Participant | Scope |
|---|---|
@workspace | Answers using the context of your whole project |
@vscode | Questions about VS Code features and settings |
@terminal | Help with shell commands and terminal output |
@github | Uses GitHub knowledge (repos, issues, web/code search) |
Chat Variables (#)
Variables pull specific context into a prompt:
| Variable | Adds to Context |
|---|---|
#file | A specific file you choose |
#selection | Your current editor selection |
#editor | The visible contents of the active editor |
#codebase | Lets Copilot search the whole codebase for relevant context |
#terminalSelection | The selected terminal text |
#terminalLastCommand | The last command run and its output |
@workspace /tests #selection
Write thorough unit tests for the selected function, covering edge cases.
9. Agent Mode — Copilot That Takes Action
Agent mode turns Copilot from an advisor into a doer. Instead of suggesting a snippet, it plans and executes a multi-step task: reading files, editing across the codebase, running terminal commands, and iterating on the results.
How It Works
- You describe an outcome ("add pagination to the users API and update the tests").
- Copilot explores the repo and forms a plan.
- It makes edits across multiple files.
- It runs commands (builds, tests) and reads the output.
- It self-corrects based on errors, then summarizes what changed.
Approvals & Safety
Agent mode asks for confirmation before running potentially impactful commands (like terminal operations). You stay in the loop — reviewing diffs and approving actions — which is the "copilot, not autopilot" philosophy in practice.
- Copilot Edits is best when you know the files to change and want fast, reviewable multi-file edits.
- Agent mode is best when the task requires exploration, running tools, and iteration to figure out what to change.
10. The Copilot CLI — Agentic Coding in the Terminal
The Copilot CLI (copilot) is the terminal-native, agentic peer of Codex CLI and Claude Code. It can read your project, propose and apply edits, run commands, and use tools — all from the shell.
Launching
copilot
Start an interactive session in the current project. You can also pass a prompt directly:
copilot -p "explain the auth flow in this repo"
The Interactive Loop
- You describe the task in plain language.
- Copilot gathers context from the repo.
- It proposes edits or commands.
- It asks for approval before acting on sensitive operations.
- It reports what changed and what remains.
Common Slash Commands (inside the CLI)
| Command | Purpose |
|---|---|
/help | List available commands |
/login · /logout | Manage authentication |
/model | Switch the active model |
/clear | Clear the current conversation |
/add-dir | Grant the agent access to an additional directory |
/mcp | Show/manage configured MCP servers |
/session | Inspect or manage the current session |
/exit | Quit the CLI |
Approval Modes
By default the CLI asks before running commands or writing files. For trusted, disposable environments you can loosen this to reduce interruptions.
Flags that let the agent run without prompting (full autonomy) trade safety for speed — the same tradeoff as Codex's --yolo or --dangerously-bypass-approvals-and-sandbox. Only use them in repos you trust and can easily restore.
11. The Copilot Coding Agent — Assign an Issue, Get a PR
The Copilot coding agent runs in the cloud on GitHub itself. You assign a GitHub Issue to Copilot, and it:
- Spins up a secure cloud environment for your repo.
- Explores the code, implements the change, and runs tests.
- Opens a pull request with its work.
- Responds to your review comments by pushing follow-up commits.
This is ideal for well-scoped tasks — small bugs, routine features, test coverage, dependency bumps — that you can describe clearly in an issue and review asynchronously.
- Agent mode / CLI run locally, in your working tree, right now.
- Coding agent runs remotely on GitHub, asynchronously, and hands you a PR to review — closer in spirit to Codex Cloud tasks.
12. Custom Instructions — Teaching Copilot Your Conventions
Copilot can read repository-specific guidance so its output matches your standards without you repeating yourself every prompt.
.github/copilot-instructions.md
Place a Markdown file at the repo root path below, and Copilot Chat/agents will automatically include it as context:
.github/copilot-instructions.md
Good things to put there:
- Preferred language, framework versions, and style conventions
- How to run tests, builds, and linters
- Architectural boundaries and "do not touch" areas
- Naming conventions and patterns to follow
# Project Conventions
- Use TypeScript with strict mode; no `any`.
- Tests use Vitest. Run `npm test` before proposing changes.
- State management uses signals — do not introduce NgRx.
AGENTS.md Support
Copilot's agentic surfaces also understand AGENTS.md, the emerging cross-tool standard (the same file Codex uses). This makes a repo portable across Copilot, Codex, and other agents.
Path-Specific & Prompt Files
In VS Code you can also use .instructions.md files scoped to file globs (via applyTo) and reusable prompt files (.prompt.md) for repeatable workflows.
13. MCP — Extending Copilot with External Tools
Copilot's agent surfaces support the Model Context Protocol (MCP) — the same open standard Anthropic introduced. MCP servers give Copilot new abilities beyond your codebase:
- Context7 — up-to-date library documentation
- Playwright MCP — drive a real browser for inspection/testing
- GitHub MCP — deeper access to issues, PRs, and repo data
- Your own internal MCP servers for company-specific tools
You configure MCP servers in VS Code settings (or the CLI's config), then confirm them with /mcp. This is how Copilot goes from "knows your code" to "can act across your whole toolchain."
14. Getting Better Results — Best Practices
The biggest quality lever is context and specificity, not clever wording.
- Be specific about the outcome. "Add retry with exponential backoff to the HTTP client and cover it with tests" beats "improve the network code."
- Give it context deliberately. Open relevant files, select code, and use
#file/#selection/#codebase. - Use
@workspacefor questions that depend on how your project is structured. - Write a
copilot-instructions.md. It pays off on every future prompt. - Iterate, don't restart. Refine in follow-ups; Copilot keeps the conversation context.
- Review everything. Read diffs, run tests, and treat output as a strong first draft — you're the pilot.
- Pick the right model for the job: fast for edits, reasoning-heavy for architecture.
- Match the surface to the task: completions for flow, chat for understanding, edits for known changes, agent/CLI for exploratory multi-step work, coding agent for async issues.
@participant + /command + #context + a clear, outcome-focused sentence.
For example: @workspace /tests #selection Cover the error paths and boundary values.
15. Copilot vs Codex vs Claude Code — Quick Comparison
All three are agentic AI coding tools. They overlap heavily; the differences are mostly ecosystem and defaults.
| Dimension | GitHub Copilot | OpenAI Codex | Claude Code |
|---|---|---|---|
| Vendor | GitHub + OpenAI (Microsoft) | OpenAI | Anthropic |
| Models | OpenAI, Claude, Gemini (picker) | OpenAI models | Claude models |
| Editor integration | Deep (VS Code, JetBrains, VS, more) | IDE extensions + CLI | CLI-first (+ IDE integrations) |
| Terminal agent | Copilot CLI (copilot) | Codex CLI (codex) | Claude Code CLI (claude) |
| Cloud/async tasks | Copilot coding agent (issue → PR) | Codex Cloud | Cloud/agents |
| Repo instructions | copilot-instructions.md + AGENTS.md | AGENTS.md | CLAUDE.md (+ AGENTS.md) |
| MCP support | ✅ | ✅ | ✅ (originated MCP) |
| Signature strength | Ubiquitous editor autocomplete + GitHub-native workflows | Terminal-native autonomy | Safety-first terminal pair-programming |
The honest summary: Copilot's edge is its reach — it lives inside the editors and GitHub workflows most developers already use, and it lets you choose the underlying model.
16. TL;DR
- GitHub Copilot is GitHub + OpenAI's AI coding assistant — not the same as Microsoft 365 Copilot or the consumer Copilot app.
- It started as autocomplete (2021) and grew into chat, edits, agent mode, a terminal CLI, and a cloud coding agent.
- It is model-agnostic: pick from OpenAI, Claude, and Gemini via the model picker.
- Surfaces: completions (ghost text), Chat (
@participants,/commands,#variables), agent mode,copilotCLI, and the coding agent (issue → PR). - Teach it your conventions with
.github/copilot-instructions.mdandAGENTS.md; extend it with MCP. - Best results come from specific prompts, deliberate context, the right model, and always reviewing the output.
- You are the pilot. Copilot is the assistant beside you. ✈️