Skip to main content
If you’re starting a new project in Visual Studio Code and want to use GitHub Copilot, this guide walks through installation, authentication, useful settings, and how to add per-repository instructions that Copilot Chat can use for context-aware code generation.

Install GitHub Copilot and Copilot Chat

  1. Open the Extensions view (View → Extensions or press Ctrl+Shift+X / Cmd+Shift+X).
  2. Search for “GitHub”. From the results, install:
    • GitHub Copilot — the core completion engine.
    • GitHub Copilot Chat — the in-editor chat interface that understands your open files.
During installation you may be prompted to authenticate with GitHub in your browser. Complete the browser-based OAuth flow to sign in and grant the extension access. Example terminal prompt you might see while installing or authenticating:
After installation, Copilot shows its status in VS Code (lower-right). You should be able to open the Copilot menu and see: Status: Ready. From that menu you can open Copilot Chat — the chat pane that can read files open in your editor and use them as context for more accurate, code-aware responses.
Copilot Chat is more useful for code-specific questions than a generic web chat because it can reference the files you have open. Use chat for higher-level refactoring, explanations, or multi-file changes, and inline completions for quick, local suggestions.
You can also disable inline completions if you prefer not to receive in-editor suggestions while you type. Many developers temporarily turn off inline completions while sketching code and then use Copilot Chat to refine or generate final implementations.
A screenshot of the GitHub Copilot menu showing options like "Status: Ready", "GitHub Copilot Chat", and "Disable Completions." A hand-shaped cursor is hovering over the "Disable Completions" option.

Copilot settings — where to find them and what to tweak

Open Settings (File → Preferences → Settings or press Ctrl+, / Cmd+,) and search for “Copilot”. Below are the most useful options to review and tune.
A dark-themed code editor Settings screen showing GitHub Copilot options. It displays an "Enable Auto Completions" checkbox and a table of languages with true/false values.
Experimental features can offer useful capabilities but may be unstable or change without notice. Only enable these in non-critical environments, or be prepared for behavior to differ between releases.

Add workspace (in-repo) instructions for code generation

You can add instructions inside your repository so Copilot Chat respects project conventions and file-specific guidance. Place an array of instruction objects under the github.copilot.chat.codeGeneration.instructions key in your workspace settings (e.g., .vscode/settings.json). Example instruction objects:
Example settings.json entry:
These workspace instructions help Copilot produce code that aligns with your repository’s naming, styling, or commit conventions. They’re especially useful for teams that want consistent output from AI-assisted tools.

How Copilot leverages your code context

When Copilot and Copilot Chat are installed and you have files open in the editor, the assistant uses that context to produce more relevant suggestions. For example, if your project contains a Flask app, Copilot can suggest handler code that matches existing data structures and patterns:
Using both inline suggestions and Copilot Chat together lets you:
  • Quickly accept small completions while coding.
  • Ask Copilot Chat for explanations, multi-file refactors, or larger changes that need project-wide awareness.

Next steps and references

  • Try toggling inline completions while experimenting to find a workflow that fits your editing style.
  • Add repository-specific instructions for consistent generated code across your team.
  • Use Copilot Chat for context-aware code reviews, refactors, and explanations.
Links and further reading:

Watch Video