// how to

How to Use GitHub Copilot in VS Code (Free Plan Included)

In VS Code, hover over the Copilot icon in the Status Bar, select Use AI Features and sign in with GitHub; without a paid plan you’re enrolled in Copilot Free. Gray text suggestions appear as you type (press Tab to accept). Open chat with Ctrl+Alt+I (Control+Command+I on a Mac) and select Agent to have it edit files.

By Published Last updated 2 min read

The short version

GitHub Copilot is a separate product from Microsoft Copilot: it’s an AI pair programmer that lives in your code editor. It suggests code as you type, answers questions in a chat panel, and in agent mode edits files and runs commands with your approval. You can start free.

Step by step

  1. Get a GitHub account if you don’t have one.
  2. Install Visual Studio Code.
  3. Turn on Copilot. Hover over the Copilot icon in the Status Bar and select Use AI Features. Choose a sign-in method. If your account has no Copilot plan, VS Code enrolls you in Copilot Free.
  4. Try inline suggestions. Start typing a function name and a comment. Copilot shows gray text; press Tab to accept it.
  5. Open chat with Ctrl+Alt+I (Windows and Linux) or Control+Command+I (Mac). Ask about your code in plain English.
  6. Use agent mode for bigger tasks. In the chat window, select Agent and describe the task. Copilot decides which files to change, makes the edits and asks before running commands.
  7. Review, then commit. GitHub’s quickstart: “Review the changes, then use your IDE’s controls to accept them.”

Prompts to copy

Understand a project:

text
Explain what this project does, how it's organized, and where the main entry point is.
I'm new to this codebase.

Write a small feature:

text
Add a function that validates an email address and returns true or false.
Include three unit tests, using the test framework this project already uses.

Fix an error:

text
Running npm test fails with the error below. Explain the cause and propose the smallest fix.
[paste error]

Agent mode task:

text
Add a "last updated" date to the footer of every page. Use the existing footer component.
Show me the plan before editing, and don't touch files outside src/.

Example

You ask in chat: “Why does this loop skip the last item?” with the function open.

A good result: an explanation of the off-by-one error, a one-line fix, and a test that would have caught it. You read the change, run the tests yourself, and only then commit.

Mistakes to avoid

  • Accepting code you don’t understand. Ask Copilot to explain it first. Our guide to reviewing AI-written code has a checklist.
  • Letting agent mode run anything. Read each command before you approve it.
  • Pasting secrets into chat. Keep API keys and passwords out of prompts and code.
  • Skipping tests. Code that looks right can still fail.

Good to know

Copilot follows project rules if you write them down, which saves repeating yourself. See write custom instructions for GitHub Copilot. To compare it with other tools, see our AI coding assistants comparison and the guide to setting up an AI coding assistant.

Related: choose the right Copilot plan and write better Copilot prompts.

Frequently asked questions

Is GitHub Copilot the same as Microsoft Copilot?

No. GitHub Copilot is a separate product for writing code in editors like VS Code, with its own plans and its own GitHub sign-in. Microsoft 365 plans don't include it.

How much does GitHub Copilot cost?

GitHub lists Copilot Free ($0, limited to 2,000 completions a month), Copilot Pro ($10 a month), Pro+ ($39) and Max ($100). Verified students get Copilot Student free, and some teachers and open source maintainers may get Pro free.

Which editors does it work in?

GitHub lists Visual Studio Code, Visual Studio, JetBrains IDEs, Eclipse and Xcode, plus Copilot on the GitHub website.

Sources

  1. GitHub Docs: plans for GitHub Copilot
  2. GitHub Docs: quickstart for using GitHub Copilot in your IDE
  3. Visual Studio Code docs: set up GitHub Copilot in VS Code
  4. GitHub Docs: setting up GitHub Copilot for yourself