
Guide
How to use Copilot in VS Code
GitHub Copilot is built into VS Code. It suggests code as you type, answers questions in chat, edits across files and can work through tasks in agent mode. Here is how to set it up and use each feature well.
Setting up
Install or enable GitHub Copilot in VS Code and sign in with a GitHub account that has a Copilot plan. The Copilot icon in the status bar shows it is active.
Inline suggestions
As you type, Copilot suggests code in grey. Press Tab to accept, Escape to dismiss, or cycle through alternatives. Write a descriptive comment or function name first to steer suggestions.
Chat
Open the Chat view to ask about your code. Use context references to point Copilot at specific files or your whole workspace. Ask it to explain code, find bugs, write tests or suggest refactors. Inline chat lets you ask for changes right in the editor.
Edits and agent mode
Ask Copilot to make changes across several files, and review the proposed edits before accepting. In agent mode, Copilot plans and carries out a task, running terminal commands and tests and iterating until done, with you approving actions.
Custom instructions
Add a custom instructions file to your repository describing coding standards, frameworks and conventions, so Copilot follows them in every suggestion and chat.
Choosing models
Copilot lets you choose between models from several providers for chat and agent tasks. Try different models on hard problems.
Good practice
Review every change, run tests and watch for security issues. Keep secrets out of code Copilot reads. Commit often so changes can be undone.
Where we do this for you
Rather we did it for you?
The services and builds closest to this guide.
Training
Copilot training
Hands-on Copilot training for teams that work in Microsoft 365.
Read moreTool page
Copilot for business
Copilot in Outlook, Word, Excel and Teams, with your files in order.
Read moreTool page
Copilot integration
Connectors and agents so Copilot answers from your systems, not just your files.
Read moreService
AI strategy
Where AI fits in your business, what to do first, and how the business gets more efficient over the next 2 years as AI scales up.
Read moreQuestions
How to use Copilot in VS Code: your questions answered
Still have a question?
Ask about an auditIs GitHub Copilot built into VS Code?
Yes. Install or enable it and sign in with a Copilot plan.
How do I accept a Copilot suggestion?
Press Tab.
What is agent mode in VS Code?
Copilot carrying out multi-step tasks, editing files and running commands with your approval.
Can Copilot follow our coding standards?
Yes, with a custom instructions file in the repository.
Can I choose the AI model in Copilot?
Yes, from several providers' models.
Is Copilot in VS Code different from Microsoft 365 Copilot?
Yes. It is GitHub Copilot, for writing code.
Keep reading
More guides and pages

Rather hand it over?
Every build starts with an audit.


