GitHub Copilot: Complete Guide to Coding and AI Agents

Guides
by David Porter
Wednesday, 05 August 2026 at 10:00
thumbnail_github-copilot-complete-guide-
thumbnail_github-copilot-complete-guide
GitHub Copilot began as code completion inside an editor. It is now a broader development system: it can explain a repository, propose edits, operate in agent mode, review code, work in a terminal and complete an assigned task in a cloud environment before opening a pull request.
That range makes the name confusing. GitHub Copilot is not the consumer Microsoft Copilot chatbot, and it is not Microsoft 365 Copilot for Word and Teams. It is the developer-focused product operated by GitHub, a Microsoft subsidiary.
For the full product family, read our complete Microsoft Copilot guide. For GitHub’s place in Microsoft’s wider model, cloud and AI strategy, see our complete Microsoft AI guide. This article owns the coding product: what its features do, how its plans and models work, and how to build a reviewable software workflow around it.

What is GitHub Copilot?

GitHub Copilot is an AI coding assistant available across code editors, GitHub, the command line and dedicated agent experiences. Depending on the surface and plan, it can:
  • predict code as you type;
  • answer questions about code;
  • edit one or more files;
  • run local development tools;
  • research a repository;
  • create an implementation plan;
  • work on a branch in the cloud;
  • open or update a pull request;
  • review a code change;
  • explain commands;
  • and use connected tools through the Model Context Protocol.
GitHub’s product overview calls Copilot an AI coding assistant. “Assistant” remains the right mental model even when it operates as an agent: it can perform more of the loop, but its output still needs engineering ownership.

The main GitHub Copilot features

The most important distinction is where work happens and how much authority Copilot receives.
FeatureWhere it worksWhat it doesBest use
Inline suggestionsCode editorPredicts lines or blocks while you typeBoilerplate, repetitive patterns and small local changes
Next edit suggestionsCode editorPredicts the next relevant changeRenames and related edits across nearby code
Copilot ChatEditor, GitHub and other supported surfacesAnswers questions and proposes codeExploration, explanation, debugging and planning
Edit modeEditorApplies a bounded set of requested editsControlled multi-file changes
Agent modeLocal editorInspects files, edits and uses local tools iterativelyImplementing a scoped task while you stay in the loop
Copilot cloud agentGitHub-hosted environmentWorks asynchronously on a branch and can open a pull requestBacklog issues, test coverage, documentation and incremental fixes
Copilot code reviewPull requests and supported editorsFinds potential defects and suggests changesEarly feedback before or alongside human review
Copilot CLITerminalExplains, edits, runs commands and delegates workShell workflows, repository tasks and automation
Copilot SpacesGitHubOrganizes selected context for conversationsReusable project or topic context
Custom agents, instructions and skillsMultiple agent surfacesSpecializes behavior and tool accessRepeatable team standards and workflows
GitHub’s live feature overview is the best place to check exact availability. Features move between preview and general availability, and not every editor implements every mode identically.

Inline suggestions: the original Copilot workflow

Inline suggestions appear as ghost text while a developer types. Copilot uses nearby code and other permitted context to predict what could come next.
They work well for:
  • test cases that repeat a known pattern;
  • data transformations;
  • interface implementations;
  • common configuration;
  • serialization;
  • documentation;
  • and predictable glue code.
They work poorly when the codebase has an unstated architectural rule, the task requires a product decision or the visible context points toward an obsolete pattern.
Review an inline suggestion before accepting it. A plausible five-line completion can still:
  • skip error handling;
  • use an outdated API;
  • introduce an injection risk;
  • ignore a project abstraction;
  • or pass the visible test while breaking another path.
The safest productivity gain comes from accepting small units that the developer understands.

Copilot Chat

Chat adds an explicit prompt and can draw on selected files, symbols, repository context and the current editor state. It is useful for questions such as:
  • Where is authentication enforced?
  • Which tests cover this function?
  • Why does this query become slow with many records?
  • Show the data flow for this endpoint.
  • Propose three ways to remove this circular dependency.
  • Write a regression test for the failure in this stack trace.
A good chat prompt contains:
  1. the outcome;
  2. relevant context;
  3. constraints;
  4. evidence or reproduction;
  5. and a required output.
For example:
Explain why InvoiceService.create() can write two invoices when the client retries. Use only the open files and tests. Do not edit yet. Identify the transaction boundary and propose the smallest idempotent fix, including the test that should fail before the change.
This is more useful than “fix duplicate invoices,” because it separates diagnosis from mutation.

Edit mode versus agent mode

The exact labels vary by editor, but the practical difference is initiative.
In an edit-oriented workflow, the user identifies files or a bounded change and Copilot proposes edits. The scope is relatively explicit.
In agent mode, Copilot can decide which files to inspect, make several edits, invoke tools, run tests and iterate when something fails. It operates directly in the local development environment.
Use agent mode when:
  • the desired result is clear;
  • the repository has tests or another verification method;
  • the task can be completed in reviewable increments;
  • and the local tool permissions are appropriate.
Stay in chat or planning when:
  • the problem is not yet understood;
  • the decision changes architecture;
  • production credentials are present;
  • the repository is untrusted;
  • or the change crosses a high-impact boundary.
Agent mode increases the value of a prompt and the cost of ambiguity. “Improve this app” is not a safe engineering ticket.

GitHub Copilot cloud agent

The cloud agent works asynchronously on GitHub rather than editing the developer’s local checkout. GitHub’s current cloud-agent documentation says it can research a repository, create a plan, make changes on a branch and optionally open a pull request.
It can be started from agent interfaces, prompts or issues, and can be asked to iterate through pull-request comments. It runs inside an ephemeral GitHub Actions-powered development environment where it can explore the repository, edit, test and lint.
Strong cloud-agent tasks include:
  • add tests for one documented edge case;
  • update a deprecated API in a named package;
  • fix a reproducible bug with acceptance criteria;
  • improve documentation after a specific release;
  • resolve a narrow merge conflict;
  • or implement a small, independent feature behind an existing interface.
Weak tasks include:
  • redesign the entire architecture;
  • improve security everywhere;
  • decide what the product should do;
  • migrate a critical database without a reviewed plan;
  • or deploy directly to production.

Agent mode versus cloud agent

QuestionAgent mode in an IDECopilot cloud agent
Where does it run?Local development environmentEphemeral GitHub Actions-powered environment
InteractionSynchronous or closely supervisedAsynchronous
ChangesLocal working treeDedicated branch and commits
Best fitActive pairing, debugging and iterative implementationWell-specified backlog work
Main riskLocal files, credentials and commandsRepository context, Actions environment, tools and automatic branch work
Review pointLocal diff and testsAgent logs, commits, checks and pull request
Cloud execution creates visibility, not correctness. GitHub records commits and agent session logs, but the maintainer still decides whether the change meets the requirement.
For organization plans, administrators must enable the cloud-agent policy, and repository owners can disable it. It is currently available on paid Copilot plans, subject to repository and account restrictions.

Copilot code review

Copilot can review pull requests and supported editor diffs for potential bugs, security problems and style issues. It can be requested manually or configured for automatic review.
GitHub’s code-review documentation currently distinguishes:
  • Low effort: faster review for common bugs, vulnerabilities and style inconsistencies;
  • Medium effort: deeper analysis for complex logic, sensitive code and cross-service changes, currently subject to preview status.
Code review is useful as an additional reviewer because it can check every ordinary change without fatigue. It is not an approval authority.
Copilot can:
  • miss a defect;
  • report a problem that is not real;
  • misunderstand a business invariant;
  • propose an insecure correction;
  • and focus on the diff while missing an architectural consequence.
Preserve branch protection and required human review. Do not let an AI-authored pull request satisfy its own independent approval requirement.

GitHub Copilot CLI

Copilot CLI brings chat and agent behavior into the terminal. It can explain commands, modify code, run tools, commit changes and delegate tasks, depending on configuration and plan.
Terminal access is consequential. Before approving or running a generated command, inspect:
  • the executable;
  • every argument and path;
  • wildcards and shell expansion;
  • environment variables;
  • network destination;
  • credentials in scope;
  • and whether the operation is reversible.
Never approve an opaque install script or destructive command because Copilot described it confidently. GitHub’s responsible-use guidance explicitly warns that the user is responsible for commands executed through Copilot CLI.
Use version control, a development container or disposable environment for unfamiliar repositories.

Models in GitHub Copilot

GitHub Copilot is a model platform, not one fixed model. Depending on plan, feature, region and rollout, users can choose or be automatically routed among models from providers including:
  • OpenAI;
  • Anthropic;
  • Google;
  • Microsoft;
  • and selected open-weight model developers.
GitHub’s available-model list changes too quickly to turn a long snapshot into a durable recommendation. The current pricing and plans page and model selector are authoritative for the user’s account.
Choose by task:
NeedModel strategy
Fast explanation or routine editUse a lower-cost, low-latency coding model
Difficult debugging or architectural reasoningUse a stronger reasoning or coding model
Long agent taskCompare completion reliability and total credit use, not price per prompt
Sensitive production workflowPrefer a generally available model covered by the required provider terms
Team standardizationTest a small approved set on internal tasks and monitor changes
Auto selection is useful when convenience matters. Manual selection is better when an organization has evaluated quality, cost, latency or data handling for a specific model.
A model name alone does not predict the complete experience. Copilot supplies repository context, tools, instructions, filters and orchestration around it.

GitHub Copilot plans and pricing

GitHub moved its current plans toward usage-based GitHub AI Credits. Inline completions can be unlimited on paid plans while chat, agent mode, code review, cloud agents, CLI and other AI interactions consume credits based on model and token use.
The individual ladder is:
  • Copilot Free: limited completions, chat and agent use for evaluation;
  • Copilot Student: an education entitlement for verified eligible students;
  • Copilot Pro: the regular paid individual plan with model choice and broader developer features;
  • Copilot Pro+: more included AI usage and access to premium models and features;
  • Copilot Max: the heaviest current individual agentic allowance.
Verified teachers and maintainers of popular open-source projects can qualify for an individual entitlement without charge.
Organizations choose Copilot Business or Copilot Enterprise. Both add license and policy management. Enterprise requires GitHub Enterprise Cloud and adds a larger included allowance and priority access. Plan availability can depend on the organization’s underlying GitHub plan; GitHub announced a temporary pause on new self-service Copilot Business sign-ups for organizations on GitHub Free and Team beginning April 22, 2026.
Current details are documented in GitHub’s individual plan comparison and organization billing guide.
When the monthly allowance is exhausted, an eligible user or administrator can set a budget for additional usage. A lower-cost model can stretch the same allowance.
Cloud-agent and deeper review work can also use GitHub Actions minutes. Pricing should therefore be measured as cost per accepted change, not merely subscription price.
Prices, credit allowances and feature gates are particularly volatile. The Microsoft Copilot pricing guide owns the current GitHub price and allowance tables for this cluster. Confirm GitHub’s own plan pages before purchasing.

Set up GitHub Copilot

A basic individual setup is:
  1. choose a Copilot plan or activate Free;
  2. install or enable Copilot in a supported editor;
  3. sign in to the intended GitHub account;
  4. check which organization supplies the license;
  5. review personal or organizational Copilot policies;
  6. select automatic or permitted models;
  7. open a trusted repository;
  8. start with a small chat or inline task;
  9. inspect the context and output;
  10. monitor AI Credits before delegating long work.
Organizations should first configure:
  • seat assignment;
  • model and preview policies;
  • public-code matching policy;
  • cloud-agent and code-review access;
  • budgets;
  • content exclusion;
  • network controls;
  • repository instructions;
  • and measurement.
Do not tell developers “Copilot is approved” without defining which plans, models, repositories, data and agent capabilities are approved.

A practical GitHub Copilot workflow

The following loop works better than accepting a large generated patch.

1. Make the repository legible

Keep the normal human documentation healthy:
  • reliable setup instructions;
  • one command for tests;
  • a clear architecture overview;
  • versioned migrations;
  • and understandable module boundaries.
AI agents benefit from the same maintainability investments as new developers.

2. Add repository instructions

Use custom instructions to state durable conventions:
  • build and test commands;
  • formatting;
  • architecture boundaries;
  • generated-file rules;
  • security requirements;
  • and definition of done.
Instructions should be concise and testable. Do not put credentials in them.

3. Diagnose before editing

Ask Copilot to find the relevant code path, reproduce the failure and propose a plan. Confirm the plan before giving agent mode a broad change.

4. Define acceptance criteria

A strong task might say:
Prevent duplicate webhook processing in payments. Preserve the endpoint contract. Add a database-backed idempotency record keyed by provider event ID, cover concurrent delivery with a test, run the payment test suite, and do not change unrelated formatting.

5. Work on a branch

Use an isolated branch or let the cloud agent create one. Begin from a known state and preserve the user’s existing uncommitted work.

6. Let Copilot implement and verify

Ask it to run targeted tests, static analysis and formatting. A green test written by the same agent is evidence, but it may encode the same misunderstanding as the implementation.

7. Review the diff as authored code

Check:
  • requirement coverage;
  • authorization;
  • input validation;
  • failure and retry behavior;
  • migrations;
  • dependency changes;
  • logging of secrets or personal data;
  • performance;
  • tests;
  • and maintainability.

8. Use independent checks

Run the project’s existing CI, security scanning, dependency analysis and human review. For critical logic, add an adversarial test that was not proposed by the agent.

9. Merge only after ownership is clear

The person or team merging the change owns it. “Copilot wrote it” is provenance, not a warranty.

Custom instructions, agents, skills and MCP

Copilot can be specialized with several mechanisms:
  • repository or organization instructions;
  • path-specific instructions;
  • prompt files;
  • custom agent profiles;
  • agent skills;
  • MCP servers;
  • hooks and other surface-specific configuration.
Use the narrowest mechanism that solves the problem. A testing instruction does not need a new remote tool.
MCP connects Copilot to external tools and data. GitHub says MCP can work across major Copilot surfaces, including IDEs, CLI and cloud-agent experiences. Tool access expands both usefulness and risk.
For a cloud agent, configured MCP tools may be used autonomously without asking for approval. GitHub’s cloud-agent MCP guide recommends reviewing servers and exposing only necessary tools. The default GitHub MCP connection is narrowly scoped, but administrators can broaden it.
Treat an MCP server like a software dependency with credentials:
  • verify the publisher and code;
  • restrict network and repository scope;
  • use read-only permissions by default;
  • isolate secrets;
  • pin and review changes where possible;
  • and log consequential actions.

Is GitHub Copilot safe?

GitHub Copilot can be used responsibly, but it is not a security control by itself.
Main risks include:
  • insecure or incorrect generated code;
  • public-code matches and license questions;
  • secrets entering prompts or logs;
  • prompt injection in repository content;
  • overly broad local or cloud tools;
  • destructive CLI commands;
  • compromised dependencies;
  • and a false sense that an AI review replaced human review.
Use:
  • version control;
  • branch protection;
  • required human review;
  • tests;
  • secret scanning;
  • code scanning;
  • dependency review;
  • least-privilege tokens;
  • protected environments;
  • and review of agent logs and commands.
GitHub provides a public-code filter and code referencing, but GitHub’s own responsible-use documentation says some agent surfaces can still produce a match or near match. Apply the same IP and security review used for any code the team did not independently originate.
Our Microsoft Copilot privacy and security guide explains the data rules for individual and organization Copilot plans.

Does GitHub use your code for training?

The answer depends on the plan.
GitHub says it does not use Copilot Business or Copilot Enterprise customer data to train AI models. For Copilot Free, Pro, Pro+ and Max, GitHub may use interaction data—including prompts, suggestions and code snippets—to train and improve models, subject to the user’s setting. Individual subscribers can opt out.
Model providers have additional arrangements. GitHub’s model-hosting documentation describes zero-data-retention agreements for generally available OpenAI and Anthropic features, with exceptions. Claude Fable 5, for example, has separate safety retention, and some beta or preview Anthropic features are outside the general ZDR arrangement.
Do not interpret “not used for training” as “never processed or stored.” Copilot needs repository and prompt context to return an answer, while logs, agent sessions, caches, security processes and the underlying GitHub repository have their own lifecycles.

GitHub Copilot versus Claude Code

Both products can inspect repositories, edit files, run tools and support agentic work.
DecisionGitHub CopilotClaude Code
Natural homeGitHub, editors, pull requests and developer lifecycleTerminal, IDE, Claude web and Anthropic’s coding workflow
Inline completionCore featureNot the central product
Pull-request integrationDeep GitHub-native integrationAvailable through Git and integrations, but not the organizing product
Cloud issue delegationCopilot cloud agent and third-party agentsClaude can also appear as a third-party GitHub agent in supported preview integrations
Model choiceMulti-provider catalogPrimarily Claude models
Pricing modelSubscription plus AI Credits and possible Actions usageClaude plan or consumption route, depending on use
Best fitTeams centered on GitHub and the complete code lifecycleDevelopers who want a strong terminal-first Claude agent
Neither is universally better. Test both on the same representative tasks and compare accepted changes, review time, security findings and total cost. Read our full Claude Code guide for the other side.

Common mistakes

Giving an agent an outcome without constraints

Specify acceptance criteria, excluded files, interfaces to preserve and the verification command.

Accepting code that the developer cannot explain

Ask Copilot to explain the changed data flow and failure behavior, then verify the explanation against the code.

Putting secrets in chat

Use placeholders and secret-management systems. Rotate any credential that appears in a prompt, agent log or commit.

Replacing human review with Copilot review

Use it for additional coverage. Preserve independent review for material changes.

Using the strongest model for every task

Routine tasks may cost less and finish faster on a smaller model. Optimize total cost per accepted result.

Letting generated tests define the requirement

Write or review acceptance criteria first. A test can be internally consistent and still test the wrong behavior.

Frequently asked questions

Is GitHub Copilot free?

Copilot Free offers up to 2,000 completions and limited chat and agent use. Paid plans add unlimited completions, larger AI Credit allowances, model choice and additional features.

Does GitHub Copilot work outside Visual Studio Code?

Yes. GitHub supports Copilot across GitHub, the CLI and multiple editors, including Visual Studio, JetBrains IDEs, Xcode, Neovim and Eclipse. Feature parity varies.

What is GitHub Copilot agent mode?

Agent mode lets Copilot plan, edit files and use development tools iteratively inside a local editor environment. Review its proposed commands, changed files and tests.

What is the GitHub Copilot cloud agent?

It is an asynchronous coding agent that works in an ephemeral GitHub Actions-powered environment, makes changes on a branch and can create a pull request for review.

Can GitHub Copilot review pull requests?

Yes. It can review pull requests manually or automatically and suggest fixes. It can miss issues or produce false positives, so it should supplement human review.

Which model does GitHub Copilot use?

Copilot supports a changing catalog from several providers and also offers automatic model selection. Availability depends on plan, feature and rollout.

Does GitHub Copilot use private code for training?

GitHub says Business and Enterprise customer data is not used to train AI models. Individual plan interaction data may be used subject to the user’s opt-out setting.

Can GitHub Copilot replace a developer?

No. It can perform meaningful implementation work, but requirements, architecture, review, security, operations and accountability remain engineering responsibilities.

Is code generated by GitHub Copilot safe to use?

Not automatically. Review, test and scan it. Check authorization, secrets, dependencies, public-code references and licenses as you would for externally sourced code.

Is GitHub Copilot better than Claude Code?

GitHub Copilot is especially strong across completion, GitHub and pull-request workflows. Claude Code is especially strong as a terminal-first Claude agent. The better choice depends on repository workflow, tasks, model preference, controls and cost.

Bottom line

GitHub Copilot is no longer only autocomplete. It can support almost every stage between understanding an issue and reviewing a pull request.
The most productive approach is not to maximize autonomous code generation. It is to make work easier to specify, verify and review: clean repositories, explicit acceptance criteria, narrow permissions, reliable tests, transparent branches and human ownership. Use Copilot to shorten the implementation loop without removing the engineering judgment that makes the loop safe.
loading

Loading