Skip to main content

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.

This guide is about GitHub Copilot specifically

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.
Why this framing matters

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.

SurfaceWhat It DoesWhere It Lives
Code completionsInline "ghost text" suggestions as you typeEditor (VS Code, JetBrains, Visual Studio, Neovim, Xcode)
Copilot ChatConversational Q&A about your codeEditor side panel, inline chat, and github.com
Copilot EditsMulti-file edits from a single promptVS Code / Visual Studio
Agent modeAutonomous multi-step tasks with tools & terminalVS Code / Visual Studio / JetBrains
Copilot CLIAgentic coding in the terminalTerminal (copilot)
Copilot coding agentAssign a GitHub Issue; Copilot opens a PRgithub.com (cloud)
Copilot code reviewAI review comments on pull requestsgithub.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
How to choose a model
  • 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.

PlanWho It's ForHighlights
Copilot FreeAnyone with a GitHub accountLimited monthly completions & chat messages, no cost
Copilot ProIndividual developersUnlimited completions, chat, model picker
Copilot Pro+Power usersHigher limits and access to more premium models
Copilot BusinessTeams / orgsPolicy controls, content exclusions, seat management
Copilot EnterpriseLarge orgsEverything in Business + codebase-aware chat, knowledge bases, and org-wide customization
Premium requests

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

  1. Install the GitHub Copilot extension (it bundles Copilot Chat).
  2. Sign in with your GitHub account when prompted.
  3. Start typing — grey ghost text appears. Press Tab to accept.
  4. 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.

Two different "Copilot in the terminal" tools

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 suggestion
  • Esc — dismiss it
  • Alt/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:

CommandWhat It Does
/explainExplain the selected code or file
/fixPropose a fix for a problem or error
/testsGenerate unit tests for the selection
/docAdd documentation comments
/optimizeSuggest performance/readability improvements
/newScaffold a new project or file
/fixTestFailureDiagnose why a test is failing
/clearStart a fresh chat

Chat Participants (@)

Participants aim your question at a specific domain of knowledge:

ParticipantScope
@workspaceAnswers using the context of your whole project
@vscodeQuestions about VS Code features and settings
@terminalHelp with shell commands and terminal output
@githubUses GitHub knowledge (repos, issues, web/code search)

Chat Variables (#)

Variables pull specific context into a prompt:

VariableAdds to Context
#fileA specific file you choose
#selectionYour current editor selection
#editorThe visible contents of the active editor
#codebaseLets Copilot search the whole codebase for relevant context
#terminalSelectionThe selected terminal text
#terminalLastCommandThe 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

  1. You describe an outcome ("add pagination to the users API and update the tests").
  2. Copilot explores the repo and forms a plan.
  3. It makes edits across multiple files.
  4. It runs commands (builds, tests) and reads the output.
  5. 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.

Agent mode vs Copilot Edits
  • 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

  1. You describe the task in plain language.
  2. Copilot gathers context from the repo.
  3. It proposes edits or commands.
  4. It asks for approval before acting on sensitive operations.
  5. It reports what changed and what remains.

Common Slash Commands (inside the CLI)

CommandPurpose
/helpList available commands
/login · /logoutManage authentication
/modelSwitch the active model
/clearClear the current conversation
/add-dirGrant the agent access to an additional directory
/mcpShow/manage configured MCP servers
/sessionInspect or manage the current session
/exitQuit 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.

Be careful with auto-approval

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:

  1. Spins up a secure cloud environment for your repo.
  2. Explores the code, implements the change, and runs tests.
  3. Opens a pull request with its work.
  4. 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.

How it differs from local agent mode
  • 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 @workspace for 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.
Prompt shape that works well

@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.

DimensionGitHub CopilotOpenAI CodexClaude Code
VendorGitHub + OpenAI (Microsoft)OpenAIAnthropic
ModelsOpenAI, Claude, Gemini (picker)OpenAI modelsClaude models
Editor integrationDeep (VS Code, JetBrains, VS, more)IDE extensions + CLICLI-first (+ IDE integrations)
Terminal agentCopilot CLI (copilot)Codex CLI (codex)Claude Code CLI (claude)
Cloud/async tasksCopilot coding agent (issue → PR)Codex CloudCloud/agents
Repo instructionscopilot-instructions.md + AGENTS.mdAGENTS.mdCLAUDE.md (+ AGENTS.md)
MCP support✅ (originated MCP)
Signature strengthUbiquitous editor autocomplete + GitHub-native workflowsTerminal-native autonomySafety-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, copilot CLI, and the coding agent (issue → PR).
  • Teach it your conventions with .github/copilot-instructions.md and AGENTS.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. ✈️