GitHub Copilot

User Guide -- Tips, How-Tos & Best Practices

Zoom

What this guide covers

GitHub Copilot is an AI coding assistant that works inside your IDE, on GitHub.com, and in the terminal. It offers inline code completion, an AI chat interface, and an autonomous coding agent that can take a GitHub issue and open a pull request -- without you writing a line of code.

This guide covers the full Copilot feature set: inline suggestions, Copilot Chat, the coding agent, available AI models and their costs, plan comparisons, and good habits for using AI-generated code responsibly.

VS Code Visual Studio JetBrains Xcode Neovim Copilot Chat Coding Agent Multi-model Free & Paid plans
⚠ Review before you ship: Copilot is a productivity accelerator, not a replacement for engineering judgment. Always review AI-generated code for correctness, security, and maintainability before committing or deploying.
Data privacy: On all Copilot plans, your code and prompts are not used to train GitHub's AI models by default. Business and Enterprise plans add IP indemnification for qualifying suggestions.

What GitHub Copilot Is

GitHub Copilot integrates directly into your IDE, GitHub.com, GitHub Mobile, and the terminal. It is not a standalone app -- it meets you where you already write code.

💻 Core Capabilities

⚡ Inline Code Completion
Suggests whole lines or entire functions as you type, in real time. Also predicts the next logical edit location with Next Edit Suggestions -- not just the current cursor position.
💬 Copilot Chat
Conversational AI in your IDE, on GitHub.com, and in GitHub Mobile. Ask questions, explain code, fix bugs, generate tests, and iterate on multi-step edits without leaving your editor.
🛠 Multi-file Edits & Agent Mode
Agent mode (in VS Code, JetBrains, and others) autonomously edits multiple files, runs your tests, and iterates on its own mistakes in real time -- all inside your IDE.
🔍 Code Review
Copilot reviews pull request diffs and suggests changes on GitHub.com and in supported IDEs. Not available on the Free plan.

🔒 Your code is not used to train GitHub's models by default on any plan.

Supported IDEs

Install the GitHub Copilot extension for your editor. VS Code has the broadest feature coverage and receives new features first.

IDECompletionChatAgent ModeCode Review
VS Code YesYesYesYes
Visual Studio YesYesYesYes
JetBrains YesYesYesYes
Xcode YesYesYesYes
Eclipse YesYesYes--
Neovim Yes------

Where else Copilot works

  • GitHub.com -- chat, code review, PR summaries, and coding agent all run in the browser without installing anything
  • GitHub Mobile -- Copilot Chat on iOS and Android for questions and quick code generation on the go
  • GitHub CLI -- Copilot in the terminal: explain commands, suggest shell syntax, run agentic tasks
  • Windows Terminal Canary -- Terminal Chat for shell command assistance

Capability Details

CapabilityHow to use it
Inline completion Just start typing. Copilot suggests in gray text -- press Tab to accept, Escape to dismiss
Next Edit Suggestions After an edit, Copilot predicts the next change location and content -- press Tab to jump and accept
Copilot Chat Open the Chat panel in your IDE or visit github.com/copilot -- ask in plain English
Agent mode Switch to "Agent" mode in the Chat panel -- give a multi-step goal and let it run tests itself
Code review Open a PR on GitHub.com and request a Copilot review, or use the review panel in VS Code
Copilot CLI Run gh copilot suggest or gh copilot explain in your terminal

Custom Instructions

Create a .github/copilot-instructions.md file in your repository. This file is automatically prepended to every Copilot prompt -- use it for coding conventions, architecture notes, and project-specific patterns. See the Good Habits tab for details.


How-To: Common Tasks

Example prompts and use cases for everyday Copilot workflows.

01
Generate a function from a comment
Write a comment describing what you want -- Copilot turns it into working code. Works in any supported language.
// Fetch all users from /api/users, filter by active status, and return sorted by last name
02
Explain unfamiliar code
Select a block of code you don't understand and ask Copilot Chat to explain it in plain English.
"Explain what this function does, what its inputs and outputs are, and flag any potential edge cases."
03
Write unit tests for existing code
Select a function in your editor, open Chat, and ask for tests. Copilot generates tests covering normal and edge cases.
"Write unit tests for the selected function. Use Jest. Cover happy path, null input, and boundary values."
04
Fix a bug with Chat
Paste the error message and the relevant code into Copilot Chat. It identifies the issue and suggests a fix.
"I'm getting TypeError: cannot read properties of undefined. Here's the stack trace and the function. What is causing this and how do I fix it?"
05
Refactor for readability
Select a messy function and ask Copilot Chat to clean it up without changing behavior.
"Refactor this function to improve readability. Use descriptive variable names, reduce nesting, and add brief inline comments. Do not change the logic."
06
Generate a SQL query from plain English
Describe the data you need -- Copilot writes the query. Works with standard SQL, PostgreSQL, MySQL, and more.
"Write a SQL query that returns the top 10 customers by total order value in the last 30 days, including their name and email."
07
Convert code between languages
Paste code in one language and ask Copilot to rewrite it in another while keeping the logic intact.
"Convert this Python data processing script to TypeScript. Use async/await and add proper type annotations."
08
Draft a pull request description
On GitHub.com, open a PR and click the Copilot icon to generate a structured PR description from your diff.
Use the Copilot button in the PR description field -- it reads your diff and writes a structured summary with context, changes, and testing notes.

The Copilot Coding Agent

Generally available for all paid plans as of September 25, 2025. This is the successor to Copilot Workspace, which was shut down on May 30, 2025.

Copilot Coding Agent (Cloud Agent)

Generally available  ·  September 25, 2025  ·  Pro, Pro+, Business, Enterprise

What the coding agent is

The coding agent is an asynchronous, autonomous developer that works in the background on GitHub Actions -- separate from your IDE. You assign it a GitHub issue, and it writes code, runs tests, and opens a draft pull request for your review.

This is distinct from agent mode, which runs synchronously inside your editor in real time.

FeatureAgent Mode (IDE)Coding Agent (Cloud)
Where it runs Your IDE, in real time GitHub Actions, in the background
Workflow style Synchronous -- you watch it work Asynchronous -- you do other things
How to start Switch to "Agent" mode in Chat panel Assign a GitHub issue to Copilot
Output Edits files in your workspace Opens a draft pull request

How the coding agent works

  1. Assign the issue -- assign a GitHub issue to Copilot, or prompt it via the Agents panel on github.com, Copilot Chat, or VS Code
  2. Environment spins up -- the agent creates an ephemeral, secure environment powered by GitHub Actions
  3. Exploration -- it reads the repository using semantic code search, finds relevant files, and builds an implementation plan
  4. Code changes -- it writes code on a new branch, runs tests and linters, and iterates on failures
  5. Draft PR -- it opens a draft pull request and tags you for review
  6. Your review -- you review the diff, leave comments, and the agent iterates based on feedback
  7. You merge -- when satisfied, you approve and merge as normal

What tasks it handles well

  • Implement new features (incremental, well-scoped tasks work best)
  • Fix bugs described in an issue
  • Improve test coverage
  • Update and improve documentation
  • Address technical debt and refactor code
  • Add logging or instrumentation
  • Resolve merge conflicts
  • Research how a codebase is structured

Which plans include it

PlanCoding Agent Included
FreeNot included
ProYes
Pro+Yes + third-party agents (Claude, Codex)
BusinessYes (admin must enable in Policies)
EnterpriseYes (admin must enable in Policies)

Limits to know

  • Single repo Can only work on one repository per task -- no cross-repo changes
  • One branch Creates exactly one branch and one pull request per task
  • GitHub only Only works with GitHub-hosted repositories (not GitLab, Bitbucket)
  • Actions minutes Consumes GitHub Actions minutes in addition to premium requests
  • Content exclusions Admin-configured file exclusions apply to chat and completion but the cloud agent can still read and edit excluded files

Tips for Writing Good Issues for the Agent

The quality of the coding agent's output depends heavily on the quality of the issue description. Treat it like a well-written spec for a junior developer.

01
Scope to one responsibility
The agent performs best on tasks touching 1-2 files. Break large features into multiple focused issues.
Good: "Add input validation to the user registration endpoint -- reject empty email and passwords under 8 characters and return a 400 with a descriptive error."
02
Include acceptance criteria
Tell the agent what "done" looks like. Explicit criteria let it write tests that verify the requirement.
"Acceptance criteria: (1) Registration rejects empty email with 400 and message 'Email is required'. (2) Passwords under 8 chars return 400 with 'Password must be at least 8 characters'."
03
Point to relevant files
Reference the specific files, functions, or modules you want changed. This shortens the agent's exploration phase.
"The registration logic is in src/api/users/register.ts. The error handler is in src/middleware/errorHandler.ts. Validation should follow the pattern used in src/api/auth/login.ts."
04
Describe the "why"
Context helps the agent make better architectural decisions. Explain the user impact or the motivation for the change.
"Users are currently able to submit empty forms and get a 500 error instead of a helpful message. This causes confusion and support tickets."
05
Specify the testing requirement
Tell the agent which test framework to use and what coverage you expect. Otherwise it may write minimal or no tests.
"Add unit tests using Jest. Test both the validation logic and the API endpoint response codes. Place tests alongside the source file."
06
Iterate via PR comments
After the agent opens a draft PR, review it carefully. Each comment asking for changes costs one premium request -- be thorough in each review round.
"The error message format should match our existing API error schema. See the AuthError class in src/errors/AuthError.ts for the expected shape. Please update to match."

Copilot Workspace: Sunset May 30, 2025

Copilot Workspace was a GitHub Next experimental project -- a task-oriented agentic development environment that predated the coding agent. It used a structured four-stage workflow: task definition, specification generation, plan generation, and implementation.

It was shut down permanently on May 30, 2025. The coding agent is its successor, incorporating all learnings from Copilot Workspace and integrating them more deeply into the GitHub Issues and PR workflow.

Key differences from Copilot Workspace

AspectWorkspace (Sunset)Coding Agent (Current)
Workflow style Linear, step-by-step, highly steerable Fluid, asynchronous, autonomous
User control Edit spec and plan before code runs Iterate via PR comments
Execution GitHub Codespaces (optional) GitHub Actions (automatic)
Status Sunset May 30, 2025 Generally available

AI Models and Premium Requests

Copilot uses a "premium request" system to meter access to powerful models. Understanding how multipliers work prevents unexpected quota exhaustion.

What is a premium request?

Inline code completion with included models is free on all paid plans. A premium request is charged each time you use Copilot Chat, the CLI, code review, or the coding agent. The number of premium requests a single action costs depends on the model's multiplier.

ActionPremium requests consumed
Copilot Chat (any mode) 1 per prompt x model multiplier
Copilot CLI 1 per prompt (x multiplier for non-default models)
Copilot code review 1 per PR or file review
Coding agent session start 1 per session
Coding agent steering comment 1 per comment during an active session
Inline completion (included models) 0 -- free on all paid plans

Monthly premium request quotas by plan

PlanCompletions/moPremium requests/mo
Free2,00050
ProUnlimited300
Pro+Unlimited1,500
BusinessUnlimited300 per user
EnterpriseUnlimited1,000 per user

Model multipliers -- the critical concept

The multiplier is a cost factor applied to each request. A 7.5x multiplier means one interaction costs 7.5 premium requests, not 1. This can exhaust your budget far faster than expected.

⚠ Budget math example: Claude Opus 4.7 has a 7.5x multiplier. A Pro plan user with 300 premium requests can have roughly 40 Opus chat messages before exhausting the entire monthly budget. Pro+ users get 1,500 requests, enabling meaningful use of heavy models.
ModelMultiplierNotes
GPT-4o, GPT-4.1, GPT-5 mini, Raptor mini0xIncluded -- free on paid plans
Claude Haiku 4.5, Gemini 3 Flash, GPT-5.4 nano0.25-0.33xVery low cost
Claude Sonnet 4 / 4.5 / 4.61xStandard premium
Gemini 2.5 Pro / Gemini 3.1 Pro1xStandard premium
GPT-5.2, GPT-5.3-Codex, GPT-5.4, GPT-5.51xStandard premium
Claude Opus 4.5 / 4.63xHigh cost
Claude Opus 4.77.5xVery high cost; Pro+ recommended

When to Use Which Model

GPT-4o / GPT-4.1
Everyday work
Free on paid plans. Best for inline completion, routine chat, explaining code, and writing tests. Use this as your default.
Zero premium request cost on all paid plans.
Claude Sonnet 4.x
Complex reasoning tasks
Strong for architecture decisions, refactoring strategy, debugging tricky issues, and writing detailed documentation.
1x multiplier -- costs 1 premium request per message.
Gemini 2.5 Pro
Long context and analysis
Excellent for working with large files or long codebases that require extensive context retention. Strong reasoning capabilities.
1x multiplier -- costs 1 premium request per message.
Claude Opus 4.7
Highest-complexity tasks only
For the most demanding reasoning tasks. Use sparingly. Pro users: budget for ~40 total Opus messages per month before quota is gone.
7.5x multiplier -- Pro+ plan recommended for regular use.

Auto Model Selection Discount

On paid plans, enabling auto model selection in Copilot Chat in VS Code gives a 10% discount on the model multiplier. For example, Claude Sonnet 4 bills at 0.9x instead of 1x. This adds up over many interactions.

Usage-Based Billing: June 1, 2026

Starting June 1, 2026, GitHub is transitioning to usage-based billing. Annual plans are being retired. Users who do not re-subscribe to a monthly plan will be migrated to Copilot Free. Additional premium requests beyond the monthly quota are available at $0.04 per request -- but the budget for overages defaults to $0, so you must explicitly set a spending limit to enable this.

Billing reminders: Unused premium requests expire monthly and do not roll over. The coding agent also consumes GitHub Actions minutes -- these are a separate cost tracked on your GitHub billing page.

Plan Comparison

All prices are per user per month. Business and Enterprise are for organizations. Note: new sign-ups for Pro and Pro+ were temporarily paused as of April 20, 2026, as GitHub transitions to usage-based billing.

Feature Free ($0) Pro ($10/mo) Pro+ ($39/mo) Business ($19/seat) Enterprise ($39/seat)
Inline completions 2,000/mo Unlimited Unlimited Unlimited Unlimited
Premium requests/mo 50 300 1,500 300/user 1,000/user
Extra requests Not available $0.04 each $0.04 each $0.04 each $0.04 each
Copilot Chat (included models) 50/mo Unlimited Unlimited Unlimited Unlimited
Agent mode 50/mo Unlimited Unlimited Unlimited Unlimited
Coding agent (cloud) Not included Yes Yes Yes* Yes*
Code review Not included Yes Yes Yes Yes
All models (incl. Opus 4.7) -- -- Yes -- --
Third-party agents -- -- Yes -- --
GitHub Spark -- -- Yes -- --
Org policy management -- -- -- Yes Yes
Audit logs -- -- -- Yes Yes
IP indemnity -- -- -- Yes Yes
SAML SSO -- -- -- Yes Yes
Knowledge bases -- -- -- -- Yes

* Admin must enable via the organization Policies page.


Plan Notes

Copilot Free

  • No credit card required. Personal accounts only -- not available if your account is managed by an organization or enterprise.
  • All models cost 1 premium request each on Free (no multiplier discounts apply).
  • Does not include the coding agent or code review.

Copilot Pro

  • Also free for verified students, verified teachers, and maintainers of popular open source projects.
  • Includes the coding agent and code review.
  • Does not include Opus 4.7, GitHub Spark, or third-party agents.
  • 300 premium requests -- Opus 4.7 (7.5x) exhausts this in approximately 40 messages.

Copilot Pro+

  • 1,500 premium requests -- 5x more than Pro, enabling meaningful use of heavy models.
  • Includes Opus 4.7, GitHub Spark (AI micro-app builder), and third-party coding agents (Claude by Anthropic, OpenAI Codex).
  • Priority access to new AI capabilities.

Copilot Business

  • For organizations on GitHub Free, GitHub Team, or enterprises on GitHub Enterprise Cloud.
  • Centralized seat management -- org owners grant and revoke access.
  • Organization-wide policy controls (disable Copilot per repo, enforce public code filters).
  • IP indemnification for qualifying suggestions -- protection not available on individual plans.
  • Usage metrics for tracking adoption across the organization.

Copilot Enterprise

  • Requires GitHub Enterprise Cloud.
  • Copilot knowledge bases -- index internal documentation and private codebases for context-grounded chat answers (Enterprise-exclusive feature).
  • 1,000 premium requests per user per month, vs 300 for Business.
  • Note: custom model fine-tuning was deprecated as of June 2025. GitHub is no longer investing in this capability.

Key dates

DateChange
May 30, 2025Copilot Workspace sunset
June 2025Enterprise fine-tuning deprecated
Sept 25, 2025Coding agent generally available
March 2026PR promotional content incident
June 1, 2026Usage-based billing; annual plans retired

Good Habits for Using GitHub Copilot

Copilot is a powerful coding accelerator -- but it introduces risks if used carelessly. These habits help you get the most value while avoiding common pitfalls.

Context file: .github/copilot-instructions.md

This file is automatically prepended to every Copilot prompt in your repository. Use it to give Copilot persistent project context so you don't have to repeat yourself in every chat message.

  1. Create the file at .github/copilot-instructions.md in your repository root
  2. Include: programming language and version, framework and conventions in use, key architectural patterns to follow
  3. Add: naming conventions, test framework and expectations, any libraries to prefer or avoid
  4. Keep it concise -- a few paragraphs is better than a wall of text
  5. Commit and push -- Copilot picks it up automatically in all supported IDEs

Choosing the right tool for the task

TaskBest Copilot feature
Completing code as you typeInline suggestions
Boilerplate, regex, repetitive patternsInline suggestions
Asking questions about codeCopilot Chat (ask mode)
Generating large sections and iteratingCopilot Chat
Debugging and explaining errorsCopilot Chat
Autonomous multi-step refactors in the IDEAgent mode
Background implementation of a scoped issueCoding agent (cloud)
PR description and reviewCopilot on GitHub.com
Terminal command helpCopilot CLI

Prompt crafting for better suggestions

  • Break down complex tasks -- multiple focused prompts beat one large vague request
  • Be specific -- include language version, framework, error handling expectations, performance constraints
  • Provide examples -- show input/output pairs or reference patterns you want to follow
  • State the goal, not the implementation -- write comments that describe what you want, not how to do it
  • Use descriptive names and comments -- Copilot uses naming and documentation as cues for intent
  • Keep 1-3 related files open -- too many open tabs degrades context quality
  • Start fresh when context drifts -- delete unhelpful prior messages or open a new chat

Known limitations to work around

  • Hallucinated APIs Copilot suggests non-existent or deprecated npm packages roughly 15% of the time. Always verify package names before installing.
  • Stale patterns It may suggest library versions or APIs that were correct at training time but have since changed.
  • Context ceiling The context window (approximately 8,000 tokens) limits how much of a large codebase Copilot can see at once -- it may miss relationships between files.
  • Logic errors Generated code can contain subtle bugs that pass superficial review. Tests and linting are essential.
  • March 2026 incident Copilot injected promotional messages into pull requests without user consent. GitHub addressed this, but it demonstrates that AI behavior can be unpredictable -- review everything.

Reviewing AI Code Safely

Never blindly accept Copilot suggestions. A quick review checklist makes this a sustainable habit rather than a burden.

01
Understand before accepting
If you are not sure what a suggestion does, ask Copilot Chat to explain it. Accept only code you can maintain and defend.
"Explain what this function does, what inputs it expects, what it returns, and any side effects I should know about."
02
Check for security issues
Look for injection vulnerabilities, insecure defaults, missing input sanitization, and improper error handling before committing.
"Review this code for security vulnerabilities. Check for SQL injection, missing input validation, insecure defaults, and exposed secrets."
03
Verify package and API names
Before installing any package Copilot suggests, search npm, PyPI, or the relevant registry to confirm it exists and is actively maintained.
Check: does the package exist? When was it last updated? Does the API call Copilot used actually exist in the current version?
04
Run your test suite
Always run automated tests after accepting Copilot suggestions. Ask Copilot to write tests for any new code it generates.
"Write unit tests for this function covering: happy path, null inputs, boundary values, and the error case where [specific condition]."
05
Run linters and static analysis
Add linters and code scanning tools to your CI pipeline. These catch issues Copilot may introduce that tests don't cover.
Add ESLint, Pylint, or your language's equivalent to your CI pipeline. Use GitHub's built-in CodeQL scanning for security issues in supported languages.
06
License and IP considerations
Copilot was trained on public code including GPL-licensed code. Enable the public code filter to reduce the risk of reproducing licensed code without attribution.
Enable "Block suggestions matching public code" in Copilot settings. On Business and Enterprise plans, IP indemnification covers qualifying unmodified suggestions.

Quick Tips

Use copilot-instructions.md
Add .github/copilot-instructions.md to every repository. It gives Copilot persistent context about your project without you having to repeat it every session.
Default to free models
GPT-4o and GPT-4.1 are free on paid plans and handle the vast majority of everyday coding tasks well. Save premium requests for genuinely complex reasoning.
Iterate in one chat
Keep building on the same conversation for richer context. Start fresh only when the prior context has drifted or is causing confusion.
Enable the public code filter
Turn on "Block suggestions matching public code" in Copilot settings to reduce license exposure. This is especially important for commercial projects.
Write better comments first
Copilot reads your comments as intent signals. Write a clear comment describing what you want before relying on it to generate the code. Better comments, better suggestions.
Use plan mode before agent mode
Use /plan in Chat to get Copilot to outline its approach before executing in agent mode. This reduces wasted token consumption on paths that won't work.

Official GitHub docs, Microsoft Learn courses, and tutorials for getting started with GitHub Copilot.

GitHub Docs -- Official 📄 Documentation · Free · Reference Get Started with GitHub Copilot GitHub's official getting started guide -- covers signing up, installing the extension in your IDE, and using inline suggestions, Copilot Chat, and the GitHub.com interface. Read Docs → Microsoft Learn -- Official 🎓 Learning Path · Free · Self-paced GitHub Copilot Fundamentals (Part 1 of 2) The official Microsoft Learn learning path introducing GitHub Copilot -- covers AI-powered code completion, Copilot Chat, IDE integration, and responsible use of AI in coding. Start Learning Path → Microsoft Learn -- Official 🎓 Module · Free · Beginner Introduction to GitHub Copilot Microsoft's official beginner module on GitHub Copilot -- explains how it generates code in real time, integrates with IDEs, and supports chat-based interactions for coding tasks. Start Module → Microsoft Learn -- Official 🎓 Module · Free · Hands-on Get Started with GitHub Copilot (Hands-on) Hands-on Microsoft Learn module covering GitHub Copilot products, IDE extensions for VS Code, and GitHub Copilot Chat -- with practical exercises to apply what you learn. Start Module → YouTube · Microsoft Reactor · Jan 2026 📹 Video · 8 min · Beginner Getting Started with GitHub Copilot A concise Microsoft Reactor tutorial covering Ask, Edit, and Agent modes, inline suggestions, inline chat, generated commit messages, PR summaries, and code reviews in GitHub. Watch on YouTube → YouTube · GitHub Official · Jul 2025 📹 Video · Full Beginner Series Compilation How to Use GitHub Copilot: Complete Beginner Guide GitHub's full beginner series compiled into one video -- covers everything from inline completions to agent mode, security best practices, and building real projects with Copilot. Watch on YouTube →

Official documentation and guides for the GitHub Copilot coding agent -- the autonomous cloud-based developer that writes and submits pull requests on your behalf.