Skip to main content

Managing Copilot coding agents

View your agent's progress and keep Copilot on task.

Who can use this feature?

Copilot coding agent is available with the GitHub Copilot Pro, GitHub Copilot Pro+, GitHub Copilot Business and GitHub Copilot Enterprise plans. The agent is available in all repositories stored on GitHub, except repositories owned by managed user accounts and where it has been explicitly disabled.
Sign up for Copilot

When utilizing GitHub's agentic features, you can use the Agents tab within a repository that has Copilot coding agent enabled to initiate, monitor, and manage agent sessions without leaving your workflow. You can also use the Agents page to view and start agent sessions. To learn how to enable Copilot coding agent, see Managing access to GitHub Copilot coding agent.

1. Select a repository and choose your agent

  1. Start a new agent task.

    • Open the Agents tab in a repository
    • Open the Agents page
    • Use the Task button or /task command from Copilot Chat
    • Open the Agents panel by clicking the at the top of any page on GitHub
  2. Using the dropdown menu, select the repository you want Copilot to work in if needed.

  3. Optionally, select a base branch for Copilot's pull request.

  4. Optionally, you can click to open the "Custom agent" dropdown menu, if you want to assign a custom agent with specialized behavior and tools. You can select an existing custom agent from your repository, organization, or enterprise. You can also click Create an agent to create a new agent profile in your selected repository and branch. For more information, see Creating custom agents.

  5. Optionally, select the CURRENT-MODEL dropdown menu, then click the AI model of your choice.

  6. Type a prompt describing your request. For example:

    Implement a user-friendly message for common errors.
    
  7. Click Start task or press Return.

Copilot will start work on the task and begin pushing changes to a new pull request, where it will automatically add you as a reviewer.

For more information on ways to start new agent tasks, see Asking GitHub Copilot to create a pull request.

2. Monitor agent activity

Once Copilot starts working, it will continue to update the session log with its progress and thought process.

Each session displays its status. Click on a session to open the session log, where you can monitor the agent's progress, see the tools it's using, and track how long the session has been running.

Agent sessions can also be tracked from the GitHub CLI, GitHub Mobile, Visual Studio Code, Raycast, and JetBrains IDEs. For more information, see Tracking GitHub Copilot's sessions.

3. Redirect agents as needed

You can step in and provide steering input to Copilot without stopping the run. Steering uses one premium request per message.

Reasons you might want to steer a session include:

  • Copilot appears to be going in a wrong direction, and you want to give it more clarity.
  • You made a mistake in your description of the required work, and you've decided to start over.

In the prompt box under the agent session log, prompt Copilot as it is working on a task. For example:

Use our existing ErrorHandler utility class instead of writing custom try-catch blocks for each endpoint.

Copilot will start implementing your input after it has finished its current tool call.

4. Open an agent session in your local development environment

You can guide Copilot in your local development environment on further changes, or make any edits that require human expertise.

VS Code

At the bottom of the agent session view, click the Open in VS Code button to launch the session directly in VS Code.

Note

Opening a session in VS Code requires the latest versions of VS Code, the GitHub Copilot extension, and the GitHub Pull Requests extension.

GitHub Copilot CLI

  1. At the bottom of the agent session view, click the dropdown list next to Open in VS Code.
  2. Click Continue in GitHub Copilot CLI to copy the copilot --resume=<session ID> command to your clipboard.
    Screenshot of the session action dropdown list, "Continue in Copilot CLI" is highlighted with a dark orange outline.
  3. In your terminal, paste and run the command to resume the agent session.

5. Review and merge agent code

Once Copilot completes a session, you can navigate to the pull request to review the changes. From the pull request, you can scan the diff, request further improvements from Copilot, or approve and merge the changes. See Reviewing a pull request created by GitHub Copilot.

6. Archive agent sessions

Sessions that have been stopped can be archived to remove them from the sessions list.

  1. Open the agent session you want to archive.
  2. In the top right corner, click , then click Archive session.
  3. In the dialog box that opens, click Yes, archive.