Agent mode 101: All about GitHub Copilot’s powerful mode

A full look at agent mode in GitHub Copilot, including what it can do, when to use it, and best practices.

| 8 minutes

Last month, we released agent mode as a step toward building GitHub Copilot into a system that not only works with you, but works for you. When you give it a natural-language prompt, Copilot’s agent mode works to execute it on your behalf, automating processes and workflows that would otherwise take a lot of time and giving you space to focus on higher-level problem solving.​ 

For those who are newer to coding, agent mode can be a useful synchronous tool when it comes to developing an app (whereas our new preview of coding agent in Copilot offers asynchronous task completion capabilities). But it’s equally, if not more so, an incredibly useful tool for more seasoned developers looking to work faster. With agent mode, you can quickly move from prompting Copilot with a higher-level requirement to testing out a prototype. Plus, we’re still seeing new use cases unfold among developers of all levels. 

Let’s take a closer look at what agent mode is, how it works, and how you can use it. 

But first, what is GitHub Copilot agent mode? 

GitHub Copilot agent mode is an autonomous and agentic real-time, synchronous collaborator that performs multi-step coding tasks based on natural-language prompts. More simply, it’s a problem solver that understands your intent, builds a solution, and iterates until it gets it right. 

Agent mode can:

  • Analyze your codebase to grasp the full context.
  • Plan and execute multi-step solutions.
  • Run commands or tests.
  • Reach out to external tools for specialized tasks.
  • Suggest architectural improvements.
  • Run and refine its own work through an agentic loop, including planning, applying changes, testing, and iterating.

Rather than just responding to requests, agent mode actively works toward your goal. You define the outcome, and it determines the best approach—seeking feedback from you as needed, testing its own solutions, and refining its work in real time. And as it operates, you can see its reasoning, decision-making process, and the tools it uses.

Whether you want Copilot to analyze your code base, propose file edits, or run tests, agent mode allows Copilot to complete all the necessary subtasks on its own. 

On top of that, agent mode enables Copilot to quickly recognize errors and fix them automatically. 

Here’s how agent mode compares to some of our other AI coding tools: 

ToolWhat it is
Agent modeA mode where Copilot is capable of iterating on its own code, recognizing errors, and fixing them automatically
GitHub Copilot coding agentAn autonomous SWE agent that asynchronously works on your behalf to do everything from resolving issues to solving for human feedback 
Code completionA Copilot feature that offers autocomplete-style suggestions in supported IDEs 

How does agent mode in GitHub Copilot work?

Flowchart diagram illustrating how a user interacts with Copilot, which communicates with a machine, workspace, and tools, all connected through a loop involving a large language model (LLM).

At its core, agent mode works as an orchestrator of several different tools and variables (e.g., your prompt and workspace) through a system prompt that tells Copilot to keep iterating on its own output until it reaches a final state. 

When you send a natural-language prompt to Copilot agent mode, it’s augmented by our backend system prompt. This includes your query, a summarized structure of the workspace, machine context, and tool descriptions.

Here’s a breakdown of what happens when you use Copilot agent mode: 

  • You prompt Copilot with clear requirements on the end result you want.
  • Copilot parses the question and asks an AI language model how to resolve the task, then begins working.
  • Copilot monitors the first iteration for errors and determines how to fix them.
  • Agent mode autonomously uses various tools to get to the end result. 

After it runs commands and applies edits, agent mode works to detect syntax errors, terminal output, test results, and build errors. Based on the results, it then determines how to course-correct, whether that’s by making additional edits, terminal commands, or performing tool calls.

The LLM has an ever-expanding set of tools to call, each with capabilities that help Copilot complete the task—and you’re in charge of which tools you want agent mode to use. Each tool, such as read_file, edit_file, and run_in_terminal, gives Copilot detailed instructions on how and when to use it. These tools allow Copilot to search your workspace, read file contents, run terminal commands, get errors from the editor and apply proposed changes, and more.

You’re not limited to just built-in tools. You can extend agent mode’s capabilities by installing more specialized tools from Model Context Protocol (MCP) servers or extensions. MCP is an open standard that enables AI models to interact with external tools and services through a unified interface. We recently announced the GitHub MCP server, which allows you to:

  • Automate GitHub workflows and processes.
  • Extract and analyze data from GitHub repositories.
  • Build AI-powered tools and applications that interact with GitHub’s ecosystem.

Combining the power of agent mode and MCP means that the LLM’s knowledge expands even further once connected to your services and data sources. ✨

What can I do with GitHub Copilot agent mode? What are some use cases?

Agent mode brings an agentic workflow to GitHub Copilot, offering real-time, synchronous help across any number of tasks in your workflows. 

Whether you let the agent take the idea and run with it, or you lead it each step of the way and control the path, you’re in the driver’s seat with Copilot as your, well, copilot.  

In my personal experience, agent mode has been a game-changer for starting small projects and proof-of-concepts from scratch. When I needed to modernize our open source history visualization scripts, I put agent mode to the test with both GPT-4o and Claude 3.7 models. The results were remarkable—it transformed our basic matplotlib histograms into sophisticated, SVG-based animated line charts with minimal guidance. What truly impressed me was seeing Copilot produce a perfect SVG histogram on its first attempt. This intelligent assistance not only accelerates development but has fundamentally transformed how I approach both prototyping and refactoring.

Zhe-You Liu, Apache Airflow Committer

Here are some ways we’ve seen developers inside and outside GitHub use agent mode:

  • Refactoring code 
  • Migrating a project to another programming language or to another tech stack
  • Writing tests 
  • Modernizing legacy code (maybe so you don’t have to learn an outdated language)
  • Autofixing code gen errors
  • Adding new features to an application
  • Prototyping a new app based on a functional spec or UI sketch
  • Implementing non-functional requirements or boilerplate code
  • Scoping and planning the work for implementing a new feature 
  • Non-code generation tasks, like documentation

One important thing to note: Copilot is powered by LLMs, which are nondeterministic, and that means its suggestions may differ even with the same prompt and context.

Agent mode is powerful, but you can extend its capabilities by combining it with other features in GitHub Copilot. For instance, you can give Copilot custom instructions so all of its responses fit your day-to-day coding practices, tools, and developers workflows. 

At GitHub, we often use custom instructions to give Copilot specific testing frameworks to use, as well as guardrails, frameworks, and instructions for unit testing. This allows you to customize how Copilot codes for you in agent mode, similar to giving instructions to one of your peers. 

You can also use other Copilot Chat modes, like edit mode and ask mode. 

ModeWhat you can do with itA use case
Edit modeEasily make edits across multiple files in your codebase.Apply code edits directly in your project for implementing a new feature, fixing a bug, or refactoring code.
Ask modeAsk Copilot questions for a better understanding of your codebase or technology concepts.Learn how a piece of code works, brainstorm ideas for software, or discover new technologies.
Agent modeStart an agentic, autonomous coding workflow that delivers your desired result with minimal guidance.Implement high-level requirements for a new feature or project through agent mode, which identifies and applies necessary changes automatically.

Take this with you

Like working with any other developer, the more context you give and the more specific you are about your intended outcome, the better results you’ll get from GitHub Copilot—and that’s particularly true with agent mode. It needs the right tools to do the right work, but by feeding agent mode custom instructions to tailor it to your coding preferences or extending its capabilities via MCP integrations, it can fit your specific style of building software. 

As with anything powered by LLMs, agent mode’s suggestions benefit from having you in the pilot’s seat to review code, and make sure things work as expected. But what’s so remarkable about agent mode is that you can use it exactly the way you want. It’s your peer programmer, which means that if you want to use it to build a prototype app, work with an existing codebase, or have it answer questions and automate lower-level parts of your workflow, you can. It’s up to you. Happy building!

Looking to try agent mode? Learn more about GitHub Copilot features or purchase your plan today.

More resources to explore:

Written by

Related posts