How to Install GitHub Copilot in VS Code

Copilot IDE & Developer WorkflowAcademy lesson 16Cluster 2 · Lesson 3 of 12Beginner12 min readVersion-sensitive
Published
Updated
Last technically verified
How to Install GitHub Copilot in VS CodeCopilot IDE & Developer Workflow3Beginner/github-copilot/ide/vscode-install/

Installing Copilot in VS Code is the easiest installation of any supported editor, because there is barely an installation to perform — VS Code fetches what it needs the first time you use Copilot.

Which means this lesson is mostly about the parts people actually get stuck on: proving each feature genuinely works, and diagnosing the situation where everything looks installed and nothing happens.

Step 1 — Check your prerequisites

Three things, and only the third catches people out.

A current VS Code. GitHub recommends running the latest stable release. This is not boilerplate: the Copilot feature matrix is captured against the newest VS Code, and several capabilities depend on editor APIs added recently.

A GitHub account with Copilot access. Either Copilot Free, a paid individual plan, or a seat granted through an organisation. The plans comparison covers which gives you what.

The right account. If you are signed into VS Code with a personal GitHub account but your Copilot seat belongs to a work account, Copilot will report no access while appearing perfectly installed. This is the single most common cause of a “broken” setup.

Step 2 — Trigger setup

There is no marketplace hunt.

  1. Open VS Code.
  2. Click the Copilot icon in the title bar.
  3. If Copilot is not yet configured, VS Code walks you through setup and installs the required extensions itself.

Step 3 — Authenticate

When prompted, sign in to GitHub and authorise the request in the browser window that opens. VS Code stores the credential in your operating system’s keychain.

Step 4 — Confirm activation

Look at the Copilot status indicator in the status bar. It reports one of a few states, and the distinction between them matters more than it looks:

StateMeaningWhat to do
ActiveWorking for the current fileNothing
Disabled for this languageWorking, switched off for this file typeA per-language setting, not a fault
Not signed inNo credential, or expiredRe-authenticate
No accessSigned in, but this account has no entitlementWrong account, or no seat

The last two look identical to most people and have completely different fixes. Reinstalling the extension resolves neither.

Step 5 — Verify code completion

Open a real project — not an empty file, which gives Copilot nothing to work from. Type a descriptive function signature with a docstring, then pause:

def parse_duration(value: str) -> int:
    """Convert a duration string such as '90s', '5m' or '2h' into seconds.

    Raises ValueError for an unknown suffix or a negative value.
    """

Ghost text should appear. If nothing does, trigger it manually with Alt+\ (Option+\ on macOS) — that distinguishes “Copilot is not working” from “Copilot had nothing to offer here”.

Step 6 — Verify chat

Open the chat view from the title bar icon, or press Ctrl+Shift+Alt+L (Shift+Option+Command+L on macOS) for quick chat. Ask something grounded in the open file:

Explain what #file does and what it assumes about its inputs.

If the #file variable resolves and you get an answer about your actual code, chat and context are both working.

Step 7 — Verify agent mode

Switch the chat interface to agent mode and give it something small and verifiable:

Add a docstring to every public function in this file. Do not change any code.

You should see it identify the files, propose edits, and ask before doing anything beyond editing. If agent mode is absent from the mode selector, that is almost always an outdated VS Code or extension — agent mode is supported in VS Code, so it should be there.

Step 8 — Verify custom instructions are being read

This one is worth checking explicitly, because when it silently fails nothing looks broken — Copilot simply keeps ignoring conventions you believe you have configured.

Create .github/copilot-instructions.md at the repository root with something unmistakable and easy to test:

# Project conventions

Every Python function must have type hints on its parameters and return value.
Raise specific exceptions; never use a bare `except:`.
When asked to write tests, always use pytest with parametrize for input tables.

Then start a fresh chat session and ask for something the instruction would visibly change:

Write a small function that converts a temperature string to a float.

If the result comes back with type hints and a specific exception type without you asking, the file is being read. If it does not, the usual causes are the file being in the wrong place — it must be .github/copilot-instructions.md at the repository root, not in a subdirectory — or the chat session predating the file, since a session already in progress may not pick it up.

Working in Codespaces, dev containers and remote

VS Code’s remote development modes change where Copilot actually runs, and this catches people out in a specific way.

In a dev container or over Remote-SSH, extensions install inside the remote environment, not on your laptop. A perfectly working Copilot setup on your host does not automatically carry across — the container starts clean. The fix is to declare the extensions in devcontainer.json so every container gets them:

{
  "customizations": {
    "vscode": {
      "extensions": ["GitHub.copilot", "GitHub.copilot-chat"]
    }
  }
}

In a codespace, your GitHub identity is already present, so authentication usually needs no separate step. The extensions still need to be present, and the same devcontainer.json declaration handles it.

The symptom to recognise: Copilot works normally, you reopen the project in a container, and it appears uninstalled. Nothing is broken — you are in a different environment than the one you configured.

When a clean reinstall is actually warranted

Reinstalling is the first thing people try and the last thing that usually helps. It is worth doing only after the account, entitlement, policy and version checks above have all come back clean.

If you do reach that point, do it thoroughly rather than half-way:

  1. Sign out of GitHub in VS Code’s account menu.
  2. Uninstall the GitHub Copilot and Copilot Chat extensions.
  3. Restart VS Code completely — not just reload the window.
  4. Trigger setup again from the Copilot icon and re-authenticate.

The full restart matters. A window reload leaves the extension host process alive, which is exactly the state a reinstall is meant to clear.

Step 9 — Keeping Copilot updated

VS Code updates extensions automatically by default, which is the right setting to leave alone. Copilot’s capabilities genuinely change between releases.

When a feature described in documentation does not exist in your editor, check these in order before assuming anything is broken:

  1. Your VS Code version against the latest stable release.
  2. Your Copilot extension version.
  3. Whether the feature is listed as preview — preview features can appear and change.
  4. Whether an organisation policy disables it.

Step 10 — Disabling Copilot

You rarely need to uninstall. Three levels of switching it off:

Per language. Useful for Markdown or plain text, where ghost text while writing prose is more distraction than help. Configured in settings, and it also stops those files consuming completions on Copilot Free.

Temporarily, everywhere. The command github.copilot.toggleCopilot ships with no default keybinding. Bind one — being able to silence suggestions while you think through a problem is genuinely useful, and it is the single best thirty seconds you can spend on configuration.

Per workspace. Disable the extension for one project while leaving it on elsewhere, from the Extensions view.

Step 11 — Uninstalling

Uninstall the GitHub Copilot extensions from the Extensions view and restart VS Code. To stop the credential being used without removing anything, sign out of GitHub in VS Code’s account menu instead.

Cancelling a paid subscription is separate again and happens in your GitHub billing settings — removing the extension does not stop billing.

Installing for a team

Rolling Copilot out to a team adds a few steps beyond the individual install, and getting them in the right order avoids a week of support questions.

Seats before software. A developer who installs Copilot without an assigned seat gets an editor that looks configured and produces nothing. Assign seats first, then tell people to install — the reverse order generates the single most common support ticket.

Decide policy before rollout, not after. On Business and Enterprise the organisation controls whether suggestions matching public code are allowed, which content is excluded, and which models are available. Changing these after people have settled into a workflow is disruptive; setting them first is invisible.

Recommend the extension through the workspace. A .vscode/extensions.json listing the Copilot extension prompts anyone opening the repository to install it. That is a nudge rather than an install, which is the right level of force.

Write the repository instructions before the rollout. The first thing a new user notices is whether output matches the project’s conventions. A .github/copilot-instructions.md that already states the stack, the test framework and the house rules makes the first day materially better, and it is half an hour of work.

Set expectations about verification explicitly. The most expensive rollout failure is not people using Copilot badly; it is people assuming that because the organisation provided it, its output has been vetted. State plainly that generated code is reviewed like any other code.

Troubleshooting

When it is not an installation problem

Three complaints that arrive as installation reports and are not:

“Copilot ignores our conventions.” It is working; it was not told them. Write .github/copilot-instructions.md. Cluster 1’s getting started tutorial has a worked example.

“Suggestions got worse.” Check what changed in your context rather than in the product — a project without an instructions file, or fewer relevant files open, both degrade output noticeably.

“It stopped working today.” Check your AI credit usage. Included credits do not carry over between months, and running out mid-month is a common cause of a sudden change in behaviour.

Frequently asked questions

Do I need to install two separate extensions? Not manually. VS Code resolves what it needs during setup. Older documentation describes installing the Copilot and Copilot Chat extensions individually, which still works but is no longer the expected path.

Copilot worked yesterday and stopped today. What changed? Check three things before touching the installation: whether your AI credit allowance ran out, whether VS Code signed you out, and whether an organisation policy changed. All three present identically as “Copilot stopped working”.

Why does Copilot work in one project but not another? Usually because the extension is disabled for that workspace, or because the project opens in a dev container that does not declare the extensions. Check the Extensions view with the project open.

Can I use Copilot Free to follow this lesson? Yes, with one caveat: chat skills in IDEs are excluded from Copilot Free, so a small number of chat behaviours differ. Completions, chat and agent mode all work.

Should I install the pre-release version of the extension? Only if you want features earlier and accept more churn. The feature matrix is captured against stable releases, so the pre-release build may behave differently from anything documented.

Next steps

With Copilot installed and verified, go to GitHub Copilot with Visual Studio Code for the features worth learning first, or straight to Agent Mode in VS Code for the capability that changes the workflow most.

For other editors, GitHub Copilot for IDEs compares them all, and Cluster 1’s installation lesson covers Visual Studio, JetBrains, Eclipse, Xcode and the CLI.

Sources

Every version-sensitive claim on this page was checked against first-party documentation. Only sources actually used are listed.

Primary sources