VSCode

How to Use GitHub Copilot in VSCode Like a Pro

How to Use GitHub Copilot in VSCode Like a Pro

If a tutorial tells you to pick Edit mode in the Chat view, it’s out of date. VS Code has removed that mode, which is why so many older walkthroughs stop matching what’s on screen.

Billing changed too. GitHub has charged for Copilot usage in AI credits since June 1, 2026.

For plain typing, inline suggestions accepted with Tab are the main tool. Questions go to Copilot Chat in Ask or Plan mode, and agent mode takes over once a change touches several files.

How to Set Up GitHub Copilot in VS Code

YouTube player

Setup happens in the Status Bar. Hover over the Copilot icon, pick Use AI Features, and sign in with your GitHub account. If the account has no Copilot plan, the VS Code documentation says it gets signed up for Copilot Free automatically.

Starting costs nothing, and you don’t download anything yourself. Microsoft Learn notes that setting Copilot up from inside VS Code means no manual extension installs. On top of that, the GitHub Copilot Chat extension has shipped built in since VS Code 1.116 (April 2026).

  1. Open VS Code and hover over the Copilot icon in the Status Bar.
  2. Select Use AI Features. If you already signed in to GitHub inside VS Code, the prompt reads Set up Copilot instead.
  3. Pick a sign-in method and authorize VS Code in the browser window that opens.
  4. On VS Code 1.116 or later, GitHub Copilot Chat is built in, so there’s nothing to install. On an older build, open the Extensions view and check that GitHub Copilot Chat is there.
  5. Open a code file and start typing. Grey ghost text shows up at the cursor when a suggestion is ready.

Which extension does Copilot run on now?

Just the one, GitHub Copilot Chat. It has handled inline suggestions alongside chat and agents since VS Code 1.106 (October 2025), and since 1.116 (April 2026) it comes built in with the editor.

The separate GitHub Copilot extension is the old way of doing things. The VS Code team announced in November 2025 that it would be deprecated by early 2026 and removed from the Marketplace, so a tutorial that has you install both extensions is out of date.

If the Extensions panel is unfamiliar territory, this guide to VS Code extensions covers how to install them, and how to update or disable them later.

Other ways to sign in

The Status Bar isn’t the only route. The Accounts menu has a Sign in with GitHub to use GitHub Copilot entry, and the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on macOS) runs GitHub Copilot: Sign in. The Copilot icon’s own menu offers Sign in to use Copilot as well. Anyone on GHE.com chooses Continue with GHE.com and enters their instance URL.

If your employer provides Copilot, sign in with the work account so organization policies apply.

Which GitHub Copilot Plan Do You Need?

Plans differ mostly by credits, not by feature lists. Free works for light use, and Pro for daily coding. You only need to go higher if agent sessions keep draining Pro’s monthly credits.

Per GitHub’s changelog of June 1, 2026, every Copilot plan now bills in GitHub AI Credits instead of premium requests. A credit count follows token usage, meaning input, output and cached tokens, at each model’s published rate.

PlanPrice per monthAI credits per monthModel access
Copilot Free$0Allowance plus 2,000 completionsAuto model selection only
Copilot Pro$101,500A selection of models
Copilot Pro+$397,000Premium models
Copilot Max$10020,000Priority access to premium models

Team seats cost $19 (Business) and $39 (Enterprise) per user, with 1,900 and 3,900 credits per user each month, pooled across the organization (GitHub Docs, 2026).

Older guides muddy this. A Microsoft Learn plan comparison still lists premium requests, at 50, 300 and 1,500 per month for Free, Pro and Pro+.

Those figures describe the pre-June system, and GitHub’s billing documentation says annual Pro and Pro+ subscribers can stay on premium-request billing until their annual plans end, after which they move to Copilot Free. Both tables can be correct for different readers.

Numbers worth knowing

One AI credit equals $0.01 USD, so Pro’s 1,500 credits represent $15 of usage (GitHub Docs, 2026). Copilot Free includes 2,000 code completions per month. On paid plans, completions and next edit suggestions are unlimited and consume no credits.

Credits reset at 00:00 UTC on the first day of each calendar month. Paid plans also get a 10% discount on usage billed through Auto model selection.

When credits run out

Upgrading is the quickest fix. You pay only the price difference, and usage earlier in the cycle counts toward the new plan’s allowance. If you’d rather stay put, set an extra-usage budget and keep working, though GitHub can cap that additional usage. Or just wait, since the allowance resets on the first of the month.

Decide before a long agent session starts, not halfway through one.

Which plan to pick

Start on Free. It stayed open to new sign-ups the whole time GitHub paused Pro, Pro+ and Student sign-ups on April 20, 2026, and those paid plans began reopening on June 16 (GitHub Community FAQ).

Move to Pro when 2,000 completions a month stop being enough, because paid plans don’t meter them.

Go higher only after your usage dashboard shows agent sessions exhausting Pro. That is a rule of thumb, not a GitHub recommendation, and each agent mode prompt consumes credits according to GitHub’s chat documentation.

How Inline Suggestions Work and the Shortcuts That Control Them

YouTube player

While you type, a suggestion shows up as dimmed ghost text at the cursor, and Tab takes it. VS Code’s documentation splits these into ghost text completions and next edit suggestions.

Ghost text versus next edit suggestions

Ghost text finishes the line or block you’re typing, right at the cursor. Next edit suggestions work differently. They predict your next change and where it belongs, based on your recent edits, and a missing import flagged by diagnostics is the typical case.

A gutter arrow marks an available edit. Press Tab to jump to it, Tab again to accept, or Esc to dismiss.

Make sure the github.copilot.nextEditSuggestions.enabled setting is turned on to use them, and switch it off if the arrows distract you.

Shortcuts for suggestions

  • Tab accepts a suggestion, and Esc dismisses it.
  • Alt+] and Alt+[ cycle to the next or previous alternative (Option instead of Alt on macOS).
  • Alt+\ triggers a suggestion manually, and Option+\ does the same on macOS.
  • Ctrl+Right accepts just the next word (Cmd+Right on macOS).
  • Accepting the next line has no default shortcut, so run Accept Next Line Of Inline Suggestion from the Command Palette.

Two official sources, two slightly different answers. GitHub’s shortcut reference lists the bindings for accepting, dismissing, cycling and manual triggering, but none for accepting a word or a line. VS Code’s own page gives Ctrl+Right for the next word, and routes cycling through the hover toolbar and manual triggering through the Trigger Inline Suggestion command.

If a binding does nothing on your keyboard layout, the Command Palette commands do the same job, including Accept Next Line Of Inline Suggestion.

Comment-driven generation

Write a comment that states the approach, such as “use recursion” or “use a singleton pattern”, and Copilot generates code to match. The VS Code documentation also uses a comment describing a TypeScript Student class with its properties and methods.

Inline suggestions fit when you keep writing the code yourself. Once the change spans several files, switch to chat.

Snooze Inline Suggestions pauses them for five minutes per click.

Ask, Plan or Agent: Which Chat Mode Fits the Task?

What separates the modes is how much of your workspace they’re allowed to change.

Open the Chat view from the Copilot icon or press Ctrl+Alt+I, then switch modes in the picker at the bottom. This walkthrough on opening Copilot Chat in VS Code shows each entry point.

ModeEdits filesRuns terminal commandsBest for
AskNoNoQuestions and explanations
PlanNoNoReviewing an approach first
AgentYesYes, with approvalsMulti-file changes and test runs

Ask sticks to read-only tools (VS Code documentation). Plan writes up an implementation plan for you to review, while Agent implements the change and validates it. Typing /plan invokes Plan directly.

What happened to Edit mode

Edit mode is gone. VS Code 1.110 (February 2026) deprecated it and hid it by default, and the 1.114 release notes say it is fully removed beginning with version 1.126. The 1.126 release (June 2026) also removed the chat.editMode.hidden setting.

Agent mode handles everything Edit mode did, so any tutorial telling you to select Edit is stale. The one exception is an organization that disables agent mode by policy, where VS Code still shows the legacy Edit mode. Otherwise, the chat.editMode.hidden setting only matters on builds older than 1.126.

Choosing a model from the picker

Auto model selection became generally available in VS Code on December 10, 2025, for all Copilot plans. It picks a model for each request, and you can hover over a response to see which one answered.

On Free, Auto is the only option. Paid plans can pin a model manually, and Auto’s September 2026 update added tiers (efficiency, balance and intelligence) that weigh cost against quality.

Usage is billed by the model Auto selects, whatever the tier, and paid subscribers keep the 10% discount (GitHub changelog, September 2026).

I leave Auto on for routine work and pin a model only after it fails on something specific.

How to Give Copilot the Context It Needs

Type # in the chat input to attach a file, folder, symbol or codebase search, or click the + icon to pick from the context list. Better context beats a longer prompt.

The #codebase option runs a workspace-wide search for relevant code. It doesn’t load your whole project into the context, as the VS Code documentation states.

  • Type # and a name to attach a file, folder or symbol (for symbols, open the file first).
  • #codebase runs the workspace-wide search.
  • #fetch pulls in web content, on its own or with a URL.
  • The + button offers Files & Folders, Symbols, Issue or Pull Request.
  • You can drag files in from the Explorer, the Search view or editor tabs.
  • Pasting a GitHub issue or pull request link attaches it automatically.

Older tutorials lean on @workspace and other @ participants. VS Code’s docs mark chat participants as deprecated in the Copilot harness it recommends for daily coding, so #codebase is the safer habit.

Agents search and read files on their own, and the docs say to add items only when you want to point them at particular sources. Ask also has read-only access to the workspace, so attach items there when you want an answer anchored to specific code.

Prompts that return usable code

A good prompt names the task, the target, a constraint and what you expect back. Something like “Add input validation to #file signup.ts, reuse the existing schema, return typed errors, leave the tests alone” covers all of it.

A vague prompt with nothing attached returns generic code that ignores your project’s conventions.

Context costs credits

Under token-based billing, input tokens count. Attaching ten files bills more than attaching two, so attach the smallest set that contains the answer.

Everyday Tasks With Inline Chat and Slash Commands

Inline chat is for changes you can point at. Select the code, press Ctrl+I, and describe the edit in a sentence.

Once a question spans several files, move to the Chat view. Inline chat suits a single function or a regex. The same shortcut works with focus in the terminal, where Copilot suggests a shell line from a plain description.

Slash commands skip the prompt writing for repeat jobs. /explain, /fix and /tests cover most of what people reach for, and /doc generates documentation comments from editor inline chat.

Which commands you get depends on your VS Code version and on the harness the session runs on. VS Code’s cheat sheet lists /explain, /fix, /tests, /doc, /plan, /clear, /compact and /fork, and notes that of the customization commands (/skills, /agents, /instructions, /prompts, /hooks), only /prompts and /hooks work with the Copilot harness. If one is missing in your build, write the request out in plain words instead.

TaskWhereHow to start
Change selected codeEditorSelect it, press Ctrl+I
Run something in the shellTerminalCtrl+I with terminal focus
Write doc commentsEditor inline chat/doc
Explain, fix or test codeChat view/explain, /fix, /tests
Plan a changeChat view/plan plus the task
Draft a commit messageSource ControlSparkle beside the message box

The commit message sparkle saves a minute per commit. The summaries it writes can be vague, though, so I’d rewrite them before pushing.

How to Run Agent Mode Without Losing Control of Your Code

YouTube player

Agent mode edits files, runs terminal tasks and calls tools in a loop. The speed itself is fine. What goes wrong is letting that speed run without review.

Plan first, review everything

Stack Overflow’s 2025 Developer Survey found that 66% of developers name AI answers that are “almost right, but not quite” as a frustration. Reading a plan first catches much of that gap before any file changes.

  1. Start with /plan and the task, so the agent researches and proposes steps first.
  2. Read the plan and fix wrong assumptions in chat. That’s cheaper now than after twenty edits.
  3. Switch to Agent and keep permissions on Manual or Assisted for the first run.
  4. Go through every edited file and press Keep or Undo.

Checkpoints (chat.checkpoints.enabled) roll the workspace back to an earlier point in the conversation. They don’t reverse terminal actions or anything outside the editor, like a database migration or a pushed branch.

Permission levels go from Manual and Assisted up to Allow all, and Autopilot, a separate agent mode, approves every tool call the way Allow all does. Higher levels skip prompts, so I’d keep them for throwaway branches.

Terminal auto-approve (chat.tools.terminal.autoApprove) relies on best-effort command parsing that shell aliases and complex syntax can slip past, so it is not a security boundary. If the agent runs anything you don’t fully trust, turn on sandboxing with chat.agent.sandbox.enabled (a preview feature; Windows uses its own setting).

Tools and MCP Servers

Add servers in .vscode/mcp.json. VS Code asks you to confirm trust before it starts one.

VS Code’s own tutorial says to treat local MCP servers as code that can run on your machine, so check the publisher first. A 128-tool limit applies to each chat request, which is a good reason to switch off tools you aren’t using.

Copilot, Local and Cloud Targets

The Session Target control decides where a chat session runs and which harness drives it. Features differ by target, so check which one is selected before you rely on something.

TargetWhere it runsWorth knowing
Copilot harnessOn your machine, in the Agent Host, using the Copilot SDK runtime shared with Copilot CLIDefault for new sessions since VS Code 1.143. Shares .github/copilot-instructions.md with Copilot CLI
Local harnessIn VS Code’s built-in harnessCustom-agent handoffs and prompt files work only here. Deprecated in VS Code 1.146 (November 2026), with removal planned for February 2027
Cloud agentOn GitHubHas its own configuration reference

New work belongs on the Copilot harness, since VS Code documents the Local harness as deprecated. Existing handoff setups will need a rethink before that removal date.

Customizing Copilot With Instruction Files and Prompt Files

YouTube player

Customization files save you from retyping the same rules in every chat. Instruction files and prompt files do most of that work, and VS Code now recommends skills over the latter (more on that below).

Instruction Files

  • Project-wide rules go in .github/copilot-instructions.md.
  • AGENTS.md works too, and other agent tools read it as well.
  • .github/instructions/*.instructions.md files take an applyTo glob, for rules that only matter to certain files.

Keep them short and specific. Build scripts and naming rules are useful, and so is naming the test framework. A paragraph of vague style advice does nothing.

Instructions have limits too. They don’t apply to inline suggestions, and nothing guarantees the model follows them every time.

Prompt Files

Prompt files live in .github/prompts as .prompt.md files. Each one holds a reusable task, like a review checklist you invoke manually in chat.

The docs disagree on their status. GitHub’s documentation labels prompt files public preview, while VS Code’s documentation says they run only in the deprecated Local harness and recommends converting them to agent skills.

Until that settles, write new reusable workflows as skills and leave existing prompt files alone. Skills are SKILL.md folders that load when relevant, and typing /skills in chat opens the Configure Skills menu in sessions that support it.

Custom agents are .agent.md files in .github/agents. They bundle instructions and tools with a model, for a role such as planning or review.

Enabling Copilot per Language

The github.copilot.enable setting takes a map of language IDs to true or false. Set “*” to true, then switch off “markdown” or “plaintext” where suggestions only add noise.

The Copilot status dashboard in the Status Bar also has checkboxes for the active file type, which is quicker for one-off cases.

And if you’d rather remove it altogether, there’s a separate guide to disable GitHub Copilot in VS Code with the full steps.

When Copilot Gets It Wrong or Stops Working

Copilot is wrong often enough that review is part of the job. Stack Overflow’s 2025 survey reports that 46% of developers distrust the accuracy of AI tool output.

Productivity evidence splits depending on who ran the study. A 2024 GitHub and Accenture enterprise study reported an 84% increase in successful builds, while METR’s 2025 randomized trial found experienced open-source maintainers using early-2025 AI tools took 19% longer on their own repositories.

They measure different things (build success versus task time), so they don’t strictly contradict each other. They do point in opposite directions, though, and a fair reading is that neither one is your team.

When Copilot Does Not Apply

Most “Copilot is dead” reports come down to something mundane.

  • The language is switched off in github.copilot.enable.
  • The file matches a content exclusion rule. Exclusion needs Business or Enterprise, and it isn’t supported in agent mode in the IDE, so don’t treat it as protection there. Copilot CLI and the GitHub Copilot app began respecting exclusions in September 2026.
  • The public code matching filter blocked a suggestion. It compares against public code using about 150 characters of context, and GitHub ties its IP indemnity for Business and Enterprise to keeping the filter on.
  • A firewall, proxy or VPN is blocking Copilot’s connections.
  • You’re expecting instruction files to shape inline suggestions, which they don’t.
  • You’re using a Local-harness-only feature, like custom-agent handoffs, on another target.

First Checks When Nothing Responds

  1. Run Code: Check for Updates from the Command Palette.
  2. Open the Output panel and switch between the GitHub Copilot and GitHub Copilot Chat channels.
  3. Run GitHub Copilot: Collect Diagnostics. An editor tab opens with details you can review and share.
  4. Compare the results against GitHub’s firewall allowlist reference. Behind a corporate proxy, your company has to configure it for Copilot too.

Still stuck? Attach the diagnostics to a report from the Help menu (Report Issue, select VS Code Extension, then GitHub Copilot Chat for chat and agent problems).

GitHub Copilot in VS Code FAQ

Can I reuse my Claude Desktop MCP servers in VS Code?

Yes. GitHub’s documentation shows adding an existing Claude Desktop configuration to settings.json.

VS Code can also discover server configurations from other tools when the chat.mcp.discovery.enabled setting is on.

How do I share MCP servers with my team?

Use a workspace-root .mcp.json, which compatible Copilot tools can share. VS Code’s guided flow offers that destination once the experimental chat.mcp.workspaceRootConfig.enabled setting is on.

The docs also point new servers toward portable destinations rather than .vscode/mcp.json.

Does agent mode test web apps in a browser?

Yes. Ask the agent to check the app in the browser, and it uses the browser tools in agent mode.

An experimental computer use feature also lets local sessions on macOS or Windows act inside desktop apps.

How do I start a fresh chat without old context?

Type /clear in the chat input to start a new chat session.

Do it whenever a long thread keeps steering answers the wrong way. A clean session costs you nothing but the retyped context.

Are agent skills usable outside VS Code?

Yes. Agent Skills are an open standard that works across GitHub Copilot in VS Code, Copilot CLI, the GitHub Copilot app, Copilot cloud agent and an experimental OpenAI Codex integration.

A skill is a SKILL.md folder, so one skill can serve several tools.

Where do I send feedback on next edit suggestions?

Hover over the gutter arrow to open the next edit suggestions menu, which holds shortcuts and settings such as Show Collapsed.

For bug reports on chat, agent or suggestion problems, use Help, then Report Issue, and choose GitHub Copilot Chat.

When GitHub Copilot in VS Code Pays Off

Copilot pays off when reviewing its output costs less than writing the code yourself. That holds for boilerplate and tests, and for refactors with a clear scope. It stops holding on code you know better than the model does.

My order would be inline suggestions and next edit suggestions for a week first. Plan mode comes before any agent run, and instruction files come once you notice you’re making the same correction over and over.

Each step adds autonomy only after the previous one shows what Copilot gets wrong in your codebase, so review habits form before the agent gets write access.

The trade-off is time. Every Keep or Undo decision is review work, and that cost grows with the size of the agent’s edit.

Revisit this order if the Local harness removal or usage-based billing changes your setup. The advice was verified against current VS Code and GitHub documentation on November 20, 2026.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.