Try to extend agent mode in VS Code!

GitHub Copilot coding agent

GitHub Copilot coding agent is a GitHub-hosted, autonomous AI developer that works independently in the background to complete development tasks. To invoke the coding agent, assign a GitHub issue to Copilot or delegate a task from chat, and the agent will work autonomously to implement features, fix bugs, and make changes across your repository using its own isolated development environment.

This is different from agent mode in VS Code, which provides interactive development within the editor and requires your active participation during the coding session.

GIF showing how to assign an issue to Copilot coding agent from within VS Code.

Note

Copilot coding agent is in preview and subject to change. During the preview, use of the feature is subject to GitHub Pre-release License Terms.

How it works

The Copilot coding agent workflow:

  1. Assignment: You assign a GitHub issue to @copilot or delegate a task from VS Code chat
  2. Analysis: The agent analyzes the task and your repository structure
  3. Development: Copilot works in its own isolated GitHub Actions environment where it can:
    • Explore your codebase
    • Make changes across multiple files
    • Run builds and tests
    • Execute linters and other automated checks
  4. Pull request: The agent creates a pull request with the implementation
  5. Review: You review the changes and can request modifications through PR comments
  6. Iteration: The agent responds to feedback and updates the implementation

Prerequisites

Before you can use Copilot coding agent, you need:

  • GitHub Copilot subscription: Available with Copilot Pro, Pro+, Business, or Enterprise plans
  • Write access: You must have write permissions to the repository
  • Enable the agent: Copilot coding agent must be enabled for your account or organization
  • VS Code setup: Install the GitHub Pull Requests extension

Optional: Enable the experimental setting githubPullRequests.codingAgent.uiIntegration to show a Delegate to coding agent button in Copilot Chat for easier task delegation.

Tip

If you don't have Copilot access yet, you can sign up for the Copilot Free plan to get a monthly limit of interactions.

Assign work to Copilot coding agent in VS Code

Method 1: Assign issues to Copilot

You can trigger Copilot coding agent by assigning a GitHub issue to Copilot, similar to how you assign an issue to a team member. Copilot coding agent automatically analyzes the issue and starts working on it.

  1. In the GitHub Pull Requests view, navigate to the Issues section

  2. Find the issue you want to assign to Copilot

  3. Right-click the issue and select Assign to Copilot or select Assign and then select @copilot

    Tip

    You can also assign issues to @copilot directly on GitHub.com. The coding agent will work the same way, creating a pull request that you can then review in VS Code or on GitHub.

  4. The agent will begin working on the issue in the background

  5. Open the Chat view in VS Code (⌃⌘I (Windows, Linux Ctrl+Alt+I)) Screenshot showing the GitHub Pull Requests view, highlighting the assign to Copilot action, and the PR query for work assigned to Copilot.

Method 2: Delegate from chat

You can also hand off work to Copilot coding agent directly from your chat conversation. Instead of having agent mode implement changes immediately in your editor, you can delegate the task to the coding agent to work on it autonomously in the background.

  1. Open the Chat view in VS Code (⌃⌘I (Windows, Linux Ctrl+Alt+I))

  2. Have a conversation about the feature or change you want to implement

  3. When ready, delegate to the agent by using one of these methods:

    Use the delegate button (Experimental)

    Enable the experimental setting githubPullRequests.codingAgent.uiIntegration to show a Delegate to coding agent button in the Chat view for repositories that have the agent enabled. Select this button to hand off your current chat context to the coding agent.

    Use the #copilotCodingAgent tool

    You can also reference the #copilotCodingAgent tool directly in your prompt to ask Copilot to continue a local change in the background. This tool automatically pushes pending changes to a remote branch and initiates a coding agent session:

    Screenshot showing handing off a session to Copilot coding agent

  4. The agent will create a pull request and begin implementing the discussed changes

Track agent progress

Monitor work in VS Code

The GitHub Pull Requests extension provides a dedicated Copilot on My Behalf section that shows:

  • All active Copilot coding agent sessions
  • Pull requests created by the agent
  • Progress status for each task
  • Numeric badges indicating new changes or updates

Screenshot showing status of multiple coding agent pull requests

Tip

You can also monitor work that you assigned to @copilot through GitHub.com - all active sessions and pull requests will appear in this section regardless of where you initiated them.

View detailed session logs

  1. In the Pull Requests view, find your agent's work under Copilot on My Behalf

  2. Select View Session to see a detailed log of everything the agent did:

    • Commands executed
    • Files modified
    • Tests run
    • Decision-making process

    Screenshot showing the session log of a coding agent session.

Tip

When working with pull requests created by the coding agent, the #activePullRequest tool is automatically enabled for your chat session. This gives chat context about your PR, including what files were changed, who's assigned, and the state (draft or ready for review). You can then ask about this PR and iterate further on it in chat.

Cancel a running session

If you need to stop the agent, you can stay in VS Code and use the Cancel coding agent button on the PR overview page.

You can also cancel a session from GitHub.com:

  1. Go to your GitHub repository on GitHub.com
  2. Navigate to the Actions tab
  3. Find the running Copilot Coding Agent workflow
  4. Select Cancel workflow

Review and iterate

Work completion

After the Copilot coding agent has analyzed your code and determined the changes that are needed to accomplish the task, it performs the following steps:

  • Create a pull request with all changes
  • Assign the PR to you for review
  • Request you as a reviewer
  • Include a detailed description explaining the implementation
  • Add screenshots when applicable (for UI changes)

Screenshot showing a pull request from Copilot coding agent displayed in VS Code with an included screenshot of the implemented feature.

Provide feedback

You can guide the agent's work through pull request comments. Make sure to tag @copilot in your comments so the agent will respond:

  1. Request changes: Leave specific feedback about what needs to be modified

    @copilot Please update the login form to include password strength validation
    
  2. Request improvements: Ask for additional features or refinements

    @copilot Can you add error handling for network timeouts?
    

The agent will respond to your feedback, make the requested changes, and update the pull request.

Frequently asked questions

What's the difference between Copilot coding agent and agent mode?

VS Code offers two autonomous coding experiences. While agent mode provides interactive development directly within the editor, the Copilot coding agent works independently on GitHub to implement features in the background.

Feature Copilot coding agent Agent mode
Where it runs GitHub cloud Your VS Code editor
Independence Fully autonomous Involves user interaction and iteration
Output Creates pull requests Edits files directly
Best for Well-defined tasks, background work Interactive development, immediate feedback

Learn more about agent mode in its documentation.

Why isn't the agent starting?

  • Verify Copilot access on your GitHub account
  • Ensure you have write permissions to the repository
  • Check that Copilot coding agent is enabled for your organization

Why are implementations incomplete?

  • Review the session logs for any errors encountered
  • Check if tests failed during the agent's work
  • Provide more detailed requirements in your issue description

What security protections does Copilot coding agent have?

Copilot coding agent includes built-in security protections and operates within GitHub's security framework. For detailed information about security measures, permissions, and branch protection compatibility, see the GitHub Copilot coding agent security documentation.

Can I extend Copilot coding agent with external tools?

For advanced scenarios, you can extend Copilot coding agent with Model Context Protocol (MCP) servers to give it access to:

  • External databases
  • Cloud services
  • APIs and third-party integrations
  • Custom development tools

Learn more about extending Copilot coding agent with MCP.

What are the current limitations?

  • Cross-repository changes: Can only work within the repository where the issue is assigned
  • Multiple PRs per task: Opens exactly one pull request per assigned task
  • Existing PR modifications: Cannot work on pull requests it didn't create

For detailed information about limitations, compatibility, and usage costs, see the GitHub Copilot Coding Agent documentation.

Next steps