In our previous tutrial about Copilot, we have explained how to start with Copilot AI Assistant in VS Code and Copilot Shortcuts in VSCode. In this tutorial, we will explain how to use Github Copilot Agent in VS Code.
As you’re familiar with Copilot chat feature that allows to use natural languages to chat with GitHub Copilot for help with your code. Now you have noticed tiny dropdown in same chat panel hiding at the bottom. These little menu in tiny dropdown is where you can switch between ask, edit, and agent modes—three ways you can integrate Copilot into your workflow.
Each of these mode (Ask, Edit, Agent) does pretty some different, you can use all these or any one mode depenending on your application requirement. Here we will discuss about Copilot Agent Mode to use in VS Code.
Also, read:
Copilot Agent Mode is a new and advanced way to get help with coding. It works like a smart coding partner that can handle complex tasks on its own. You just tell it what you want to do, and it will:
- Understand your code
- Read the necessary files
- Suggest changes
- Run commands and tests
If there are any errors, it will notice them and try to fix them automatically. It keeps working and correcting things until the job is done.
1. Install Github Copilot and Configure
You need to install Git Copilot and complete it’s configurations:
- Need to install the latest version (available from version 1.99) of Visual Studio Code (VS Code).
- Need to install Copilot Extension in Vs Code and enable it. Need to complete sign in with GitHub and Grant necessary permissions to VS Code.
2. Enable Copilot Agent Mode in VS Code
You need to enable Copilot Agent to use it.
- To enable agent mode in VS Code, you need to enable the
chat.agent.enabledsettings. you can also enable it in settings.json by adding this “copilot.agent.enabled”: true - After enabling, open the chat view by pressing (Ctrl+Alt+I) and select Agent from the chat mode selector.

3. How to use Copilot Agent Mode While Coding
Now, after enabling Copilot Agent Mode, you can start using it for your projects and files. To have Copilot Agent write code for you, enter your prompt in the chat input field and press Enter to submit it.
You can specify all your requirement without specifying any specific file. In agent mode, the AI determines the relevant context and files to edit autonomously.
Here, we are using following to add s3 file upload functionality.
Add AWS S3 file upload functionality
After entering you prompt, press Send button to submit it start agent work on it.

The agent start working by analyzing project files, run tests and make changes to files.

Finally, it display editor overlay controls to navigate between the suggested edits by using the Up and Down controls. You can use the Keep or Undo button to accept or reject the edits for a file.

You can also use Undo Last Edit control in the Chat view title bar to revert the last edits and return to the state before sending the last request. After you perform an undo of the last edit, you can redo those edits again by using the Redo Last Edit control in the Chat view title bar.

Conclusion
In this post, we have explained how to use Github Copilot Agent in VS Code to perform complex coding tasks across multiple files. You can use more features of Copilot agent to use tasks.json file instead of prompt to run according configured tasks, also you can use instructions to get tool to follow your coding style and much more.