Most people meet GitHub Copilot as autocomplete: you type, it suggests the next line. The agent is a different way of working. You describe a task in plain English, and it plans the steps, edits several files, runs commands and checks its own work, pausing to ask when something needs your say-so.
This recipe walks through your first agent session in VS Code. You don't need to be an experienced developer, but you should be comfortable opening a project folder.
VS Code's agent features are changing quickly. The menu names below match VS Code's current documentation, but if a label looks slightly different on your screen, look for the closest match and check the VS Code docs.
What you'll need
- VS Code, up to date.
- A GitHub account with Copilot access. GitHub lists a Free plan with limited chat and agent use, plus paid plans. See GitHub Copilot for the details and check GitHub's plans page for current prices.
- A small project to practise on. A folder with a simple website or script is ideal, ideally one you have saved in Git. See A safety net for AI coding if you haven't used Git before.
Step 1: Sign in and open the Chat view
- Open your project folder in VS Code (File → Open Folder).
- Sign in to GitHub if VS Code asks you to, so Copilot can run.
- Open the Chat view. Use the keyboard shortcut
Ctrl+Alt+Ion Windows and Linux, or⌃⌘Ion Mac, or choose Open Chat from the Chat menu.
The Chat view opens in the Secondary Side Bar, next to your editor.
Step 2: Start a new agent chat
Select New Chat (the + button). The chat input has a row of pickers at the bottom. In VS Code's quickstart, the recommended setup is:
- Session Target: Copilot.
- Agent: Agent. This is the one that plans, edits files, runs commands and validates the result.
- Language model: Auto, which lets Copilot pick.
- Permissions: Manual permissions.
Leave Permissions on Manual for now. It means actions that aren't already approved will stop and ask you first. That's the safest way to learn.
Step 3: Give it a small, clear task
Good first tasks are small and easy to check. For example:
Add a "Contact" page to this site with a simple form (name, email, message) and a link to it in the navigation. Follow the existing style. Don't add any new dependencies.
Why that works: it says what to build, where it connects, and a limit (no new dependencies). Avoid vague prompts like "make my site better".
If you'd like to see how it plans before it touches anything, start with: "Look at this project and explain how the navigation works. Don't change anything yet."
Step 4: Watch what it does
Press Enter and the agent starts working. You'll see it:
- read files in your project to understand them,
- make edits across one or more files,
- run commands in the terminal, such as installing packages or running tests,
- and fix problems it notices along the way.
Follow the chat as it goes. If it heads in the wrong direction, stop it and send a correction rather than letting it finish.
Step 5: Approve (or decline) actions
The agent has tools: built-in abilities such as editing files, searching the project and running terminal commands. VS Code treats two things separately:
- Tool availability: whether a tool exists for the agent to use.
- Tool approval: whether it can use that tool without asking.
Enabling a tool doesn't bypass your approval settings. With Manual permissions, when the agent wants to do something not yet approved, a confirmation appears. Read it before you click.
A few good habits:
- Read terminal commands. If you don't understand a command, ask the agent to explain it before approving.
- Be sparing with "always allow". The confirmation can offer to remember your choice. Do that for harmless things, not for commands that delete or publish.
- Review approvals later. Run Chat: Manage Tool Approval from the Command Palette (
Ctrl+Shift+PorCmd+Shift+P) to see and change what you've approved. Tools are grouped by where they come from, such as an MCP server or an extension.
VS Code also has more relaxed permission levels. Assisted permissions uses an AI model to judge each call, and Allow all runs everything without asking. VS Code's own docs warn that the judge can make mistakes and that these levels aren't a security boundary, so we recommend staying on Manual while you're learning.
Step 6: Review the changes
When the agent finishes, don't just accept the result. Check it:
- Open the changed files and read the edits. VS Code highlights what was added and removed.
- Run the project and try the feature yourself.
- Keep what's good, and ask for fixes in the chat: "The form's button is the wrong colour. Match the other buttons."
Step 7: Undo what you don't like
You have two ways back, both described in VS Code's docs:
- Undo reverts the pending edits without rewinding the conversation.
- Restore Checkpoint rolls back both your workspace files and the chat history to an earlier point. Every agent response is a checkpoint. Hover over a response in the chat to find Restore Checkpoint.
There's an important limit. Checkpoints don't reverse terminal commands that already ran, network requests, deployments or changes made in outside services. For those, you need Git or the service's own recovery tools. That's another reason to commit your work to Git before a big task.
Step 8: Add project instructions
Just as with other AI tools, Copilot works better when it knows your project's conventions. VS Code supports custom instructions: Markdown files that are included in the agent's context.
For a project-wide file, create .github/copilot-instructions.md in your project:
# Project instructions - This is a static website built with plain HTML, CSS and a little JavaScript. - Match the existing code style. Don't introduce frameworks. - Keep pages accessible: every image needs alt text. - Run `npm test` after changing logic and fix any failures.
VS Code's docs also list AGENTS.md as a project-level option, so if you already have one for another tool it can serve here too. For rules that apply only to certain files, you can add NAME.instructions.md files in .github/instructions, with an applyTo pattern in the header to say which files they cover.
One caveat from VS Code's own guidance: instructions steer the AI but don't guarantee it follows them, and they don't apply to inline suggestions as you type. Keep reviewing what it produces.
Using Cursor? The same idea is covered in Give Cursor standing instructions with project rules. On Claude Code, it's CLAUDE.md.
Step 9: Add more tools with MCP (optional)
MCP (Model Context Protocol) is a standard way to plug extra tools into an AI, for example a browser or your issue tracker. VS Code supports it:
- Open the Command Palette.
- Run MCP: Add Server.
- Follow the guided flow, choosing a package type such as NPM, or reusing a configuration from another app.
VS Code's docs describe a workspace-root .mcp.json for configurations you want to share with your team, and .vscode/mcp.json for local configurations. Because the formats and recommendations are still moving, follow the guided flow rather than writing the file by hand. New MCP tools show up in Chat: Manage Tool Approval, so you can control them like any other tool.
For the general idea, see Add your first MCP server to Cursor. The concepts carry over to VS Code.
Troubleshooting
I can't find the agent. Open the Chat view first, start a New Chat, then check the Agent picker in the chat input.
It keeps asking permission. That's Manual permissions doing its job. Approve the specific harmless actions you're happy with, or break your task into smaller steps.
It changed things I didn't want. Use Undo or Restore Checkpoint, then give a narrower prompt with explicit limits.
It ignores my instructions file. Check the file name and location, and make the instructions specific and short. Vague advice gets lost.
Recap
- Open the Chat view with
Ctrl+Alt+I(⌃⌘Ion Mac). - Start a New Chat with the Agent selected and Manual permissions.
- Give it a small, specific task, and read what it wants to run.
- Review the result, and use Undo or Restore Checkpoint if needed.
- Add
.github/copilot-instructions.mdso it knows your project.
Once you're comfortable, compare it against other options with Cursor vs GitHub Copilot.