Skip to content

Commit 26deda5

Browse files
bamurtaughBrigit Murtaughntrogh
authored
Copilot Coding Agent documentation (#8653)
* docs: add Copilot Coding Agent documentation and update table of contents * refactor: reorganize Copilot Coding Agent documentation for clarity and update VS Code integration details * fix: add hyperlink to GitHub Copilot Coding Agent description * refactor: streamline Copilot Coding Agent description for clarity and conciseness * refactor: enhance clarity and detail in Copilot Coding Agent capabilities section * GIF in Copilot Coding Agent documentation * refactor: update VS Code setup instructions and enhance task delegation options for Copilot Coding Agent * refactor: add screenshots to enhance understanding of Copilot Coding Agent features and workflow * refactor: streamline capabilities section of Copilot Coding Agent documentation for clarity * refactor: adjust screenshot formatting for consistency in Copilot Coding Agent documentation * Update structure and content * Comparisons * fix: update MetaDescription for clarity in Copilot Coding Agent documentation * Updates * Feedback * fix: standardize capitalization of "coding agent" throughout documentation * fix: standardize capitalization of "coding agent" in documentation * fix: clarify terminology for agent mode in documentation * fix: update terminology to refer to agent mode in documentation * fix: update terminology to refer to agent mode in documentation * fix: update terminology for consistency in documentation * fix: clarify terminology between Copilot coding agent and agent mode in documentation * Refactor images * Feedback * Rework intro * Update docs/copilot/copilot-coding-agent.md Co-authored-by: Nick Trogh <[email protected]> * Update docs/copilot/copilot-coding-agent.md Co-authored-by: Nick Trogh <[email protected]> * Remove content * Update docs/copilot/copilot-coding-agent.md Co-authored-by: Nick Trogh <[email protected]> * Feedback * Feedback * Feedback * Feedback * Update docs/copilot/copilot-coding-agent.md Co-authored-by: Nick Trogh <[email protected]> * Update docs/copilot/copilot-coding-agent.md Co-authored-by: Nick Trogh <[email protected]> * Move tip * Intro --------- Co-authored-by: Brigit Murtaugh <[email protected]> Co-authored-by: Nick Trogh <[email protected]>
1 parent 6917136 commit 26deda5

11 files changed

+265
-0
lines changed

docs/copilot/chat/chat-agent-mode.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ Agent mode is optimized for making autonomous edits across multiple files in you
2525

2626
Agent mode is particularly useful for coding tasks when you have a less well-defined task that might also require running terminal commands and tools. Agent mode autonomously determines the relevant context and tasks to accomplish the request. It can also iterate multiple times to resolve intermediate issues, such as syntax errors or test failures.
2727

28+
## Agent mode vs Copilot coding agent
29+
30+
VS Code offers two autonomous coding experiences. While agent mode provides interactive development directly within the editor, the [Copilot coding agent](/docs/copilot/copilot-coding-agent.md) works independently on GitHub to implement features in the background.
31+
32+
| Feature | Agent mode | Copilot coding agent |
33+
|---------|------------------|---------------------|
34+
| **Where it runs** | Your VS Code editor | GitHub cloud |
35+
| **Independence** | Involves user interaction and iteration | Fully autonomous |
36+
| **Output** | Edits files directly | Creates pull requests |
37+
| **Best for** | Interactive development, immediate feedback | Well-defined tasks, background work |
38+
39+
This document describes agent mode. You can learn more about the Copilot coding agent in its [documentation](/docs/copilot/copilot-coding-agent.md).
40+
2841
## Enable agent mode in VS Code
2942

3043
> [!NOTE]
@@ -297,6 +310,10 @@ Consider the following criteria to choose between edit mode and agent mode:
297310
* **Self-healing**: agent mode evaluates the outcome of the generated edits and might iterate multiple times to resolve intermediate issues.
298311
* **Request quota**: in agent mode, depending on the complexity of the task, one prompt might result in many requests to the backend.
299312

313+
### When should I use Copilot coding agent instead of agent mode?
314+
315+
Use [Copilot coding agent](/docs/copilot/copilot-coding-agent.md) for well-defined tasks that can work independently in the background. Use agent mode when you want to stay involved in the development process and iterate quickly on changes.
316+
300317
### I'm getting an error that says "Cannot have more than 128 tools per request."
301318

302319
A chat request can have a maximum of 128 tools enabled at a time. If you have more than 128 tools selected, reduce the number of tools by deselecting some tools in the tools picker in the Chat view.

docs/copilot/copilot-coding-agent.md

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
---
2+
ContentId: f8b9e2a4-7c1d-4f5e-9a8b-3d2e1f0c6789
3+
DateApproved: 07/09/2025
4+
MetaDescription: Learn how to interact with the GitHub Copilot coding agent in VS Code to autonomously implement features and fix bugs in the background.
5+
MetaSocialImage: images/shared/github-copilot-social.png
6+
---
7+
# GitHub Copilot coding agent
8+
9+
[GitHub Copilot coding agent](https://docs.github.com/en/copilot/concepts/about-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.
10+
11+
This is different from [agent mode](/docs/copilot/chat/chat-agent-mode.md) in VS Code, which provides interactive development within the editor and requires your active participation during the coding session.
12+
13+
![GIF showing how to assign an issue to Copilot coding agent from within VS Code.](images/copilot-coding-agent/assign-to-copilot-gif.gif)
14+
15+
> [!NOTE]
16+
> 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](https://docs.github.com/en/site-policy/github-terms/github-pre-release-license-terms).
17+
18+
19+
## How it works
20+
21+
The Copilot coding agent workflow:
22+
23+
1. **Assignment**: You [assign a GitHub issue to `@copilot`](#method-1-assign-issues-to-copilot) or [delegate a task from VS Code chat](#method-2-delegate-from-copilot-chat)
24+
1. **Analysis**: The agent analyzes the task and your repository structure
25+
1. **Development**: Copilot works in its own isolated GitHub Actions environment where it can:
26+
* Explore your codebase
27+
* Make changes across multiple files
28+
* Run builds and tests
29+
* Execute linters and other automated checks
30+
1. **Pull request**: The agent creates a pull request with the implementation
31+
1. **Review**: You review the changes and can request modifications through PR comments
32+
1. **Iteration**: The agent responds to feedback and updates the implementation
33+
34+
## Prerequisites
35+
36+
Before you can use Copilot coding agent, you need:
37+
38+
* **GitHub Copilot subscription**: Available with Copilot Pro, Pro+, Business, or Enterprise plans
39+
* **Write access**: You must have write permissions to the repository
40+
* **Enable the agent**: Copilot coding agent [must be enabled](https://docs.github.com/copilot/concepts/coding-agent/enable-coding-agent) for your account or organization
41+
* **VS Code setup**: Install the [GitHub Pull Requests extension](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github)
42+
43+
**Optional**: Enable the experimental setting `setting(githubPullRequests.codingAgent.uiIntegration)` to show a **Delegate to coding agent** button in Copilot Chat for easier task delegation.
44+
45+
> [!TIP]
46+
> If you don't have Copilot access yet, you can sign up for the [Copilot Free plan](https://github.com/features/copilot/plans) to get a monthly limit of interactions.
47+
48+
## Assign work to Copilot coding agent in VS Code
49+
50+
### Method 1: Assign issues to Copilot
51+
52+
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.
53+
54+
1. In the **GitHub Pull Requests** view, navigate to the **Issues** section
55+
56+
1. Find the issue you want to assign to Copilot
57+
58+
1. Right-click the issue and select **Assign to Copilot** or select **Assign** and then select `@copilot`
59+
60+
> [!TIP]
61+
> 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.
62+
63+
1. The agent will begin working on the issue in the background
64+
65+
1. Open the Chat view in VS Code (`kb(workbench.action.chat.open)`)
66+
![Screenshot showing the GitHub Pull Requests view, highlighting the assign to Copilot action, and the PR query for work assigned to Copilot.](images/copilot-coding-agent/github-pull-request-coding-agent.png)
67+
68+
### Method 2: Delegate from chat
69+
70+
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.
71+
72+
1. Open the Chat view in VS Code (`kb(workbench.action.chat.open)`)
73+
74+
1. Have a conversation about the feature or change you want to implement
75+
76+
1. When ready, delegate to the agent by using one of these methods:
77+
78+
**Use the delegate button (Experimental)**
79+
80+
Enable the experimental setting `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.
81+
82+
<video src="images/copilot-coding-agent/delegate-to-coding-agent.mp4" title="Video showing how to delegate to coding agent from VS Code chat." controls poster="images/copilot-coding-agent/delegate-to-coding-agent-poster.png"></video>
83+
84+
**Use the #copilotCodingAgent tool**
85+
86+
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:
87+
88+
![Screenshot showing handing off a session to Copilot coding agent](images/copilot-coding-agent/coding-agent-start.png)
89+
90+
1. The agent will create a pull request and begin implementing the discussed changes
91+
92+
## Track agent progress
93+
94+
### Monitor work in VS Code
95+
96+
The GitHub Pull Requests extension provides a dedicated **Copilot on My Behalf** section that shows:
97+
98+
* All active Copilot coding agent sessions
99+
* Pull requests created by the agent
100+
* Progress status for each task
101+
* Numeric badges indicating new changes or updates
102+
103+
![Screenshot showing status of multiple coding agent pull requests](images/copilot-coding-agent/coding-agent-status.png)
104+
105+
> [!TIP]
106+
> 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.
107+
108+
### View detailed session logs
109+
110+
1. In the Pull Requests view, find your agent's work under **Copilot on My Behalf**
111+
112+
1. Select **View Session** to see a detailed log of everything the agent did:
113+
* Commands executed
114+
* Files modified
115+
* Tests run
116+
* Decision-making process
117+
118+
![Screenshot showing the session log of a coding agent session.](images/copilot-coding-agent/coding-agent-session-log.png)
119+
120+
> [!TIP]
121+
> 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.
122+
123+
### Cancel a running session
124+
125+
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.
126+
127+
You can also cancel a session from GitHub.com:
128+
1. Go to your GitHub repository on GitHub.com
129+
1. Navigate to the **Actions** tab
130+
1. Find the running Copilot Coding Agent workflow
131+
1. Select **Cancel workflow**
132+
133+
## Review and iterate
134+
135+
### Work completion
136+
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:
137+
138+
* Create a pull request with all changes
139+
* Assign the PR to you for review
140+
* Request you as a reviewer
141+
* Include a detailed description explaining the implementation
142+
* Add screenshots when applicable (for UI changes)
143+
144+
![Screenshot showing a pull request from Copilot coding agent displayed in VS Code with an included screenshot of the implemented feature.](images/copilot-coding-agent/draft-with-screenshot.png)
145+
146+
### Provide feedback
147+
148+
You can guide the agent's work through pull request comments. Make sure to tag `@copilot` in your comments so the agent will respond:
149+
150+
1. **Request changes**: Leave specific feedback about what needs to be modified
151+
152+
```
153+
@copilot Please update the login form to include password strength validation
154+
```
155+
156+
1. **Request improvements**: Ask for additional features or refinements
157+
158+
```
159+
@copilot Can you add error handling for network timeouts?
160+
```
161+
162+
The agent will respond to your feedback, make the requested changes, and update the pull request.
163+
164+
## Frequently asked questions
165+
166+
### What's the difference between Copilot coding agent and agent mode?
167+
168+
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.
169+
170+
| Feature | Copilot coding agent | Agent mode |
171+
|---------|---------------------|------------------|
172+
| **Where it runs** | GitHub cloud | Your VS Code editor |
173+
| **Independence** | Fully autonomous | Involves user interaction and iteration |
174+
| **Output** | Creates pull requests | Edits files directly |
175+
| **Best for** | Well-defined tasks, background work | Interactive development, immediate feedback |
176+
177+
Learn more about agent mode in its [documentation](/docs/copilot/chat/chat-agent-mode.md).
178+
179+
### Why isn't the agent starting?
180+
181+
* Verify Copilot access on your GitHub account
182+
* Ensure you have write permissions to the repository
183+
* Check that Copilot coding agent is enabled for your organization
184+
185+
### Why are implementations incomplete?
186+
187+
* Review the session logs for any errors encountered
188+
* Check if tests failed during the agent's work
189+
* Provide more detailed requirements in your issue description
190+
191+
### What security protections does Copilot coding agent have?
192+
193+
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](https://docs.github.com/en/copilot/concepts/about-copilot-coding-agent#built-in-security-protections).
194+
195+
### Can I extend Copilot coding agent with external tools?
196+
197+
For advanced scenarios, you can extend Copilot coding agent with Model Context Protocol (MCP) servers to give it access to:
198+
199+
* External databases
200+
* Cloud services
201+
* APIs and third-party integrations
202+
* Custom development tools
203+
204+
Learn more about [extending Copilot coding agent with MCP](https://docs.github.com/en/copilot/using-github-copilot/coding-agent/extending-copilot-coding-agent-with-mcp).
205+
206+
### What are the current limitations?
207+
208+
* **Cross-repository changes**: Can only work within the repository where the issue is assigned
209+
* **Multiple PRs per task**: Opens exactly one pull request per assigned task
210+
* **Existing PR modifications**: Cannot work on pull requests it didn't create
211+
212+
For detailed information about limitations, compatibility, and usage costs, see the [GitHub Copilot Coding Agent documentation](https://docs.github.com/en/copilot/using-github-copilot/coding-agent).
213+
214+
## Next steps
215+
216+
* Enable Copilot coding agent by following the [GitHub setup guide](https://docs.github.com/en/copilot/using-github-copilot/coding-agent/enabling-copilot-coding-agent)
217+
* Try [agent mode in VS Code](/docs/copilot/chat/chat-agent-mode.md) for immediate, interactive coding assistance
218+
* Learn about [using chat in VS Code](/docs/copilot/chat/copilot-chat.md) for conversational AI help
219+
220+
## Related resources
221+
222+
* [GitHub Copilot coding agent documentation](https://docs.github.com/en/copilot/using-github-copilot/coding-agent)
223+
* [GitHub Pull Requests extension](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github)
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:a90b6a83558ffb442c5233b27581b8cc337835a305baed56480d2145334ffeb9
3+
size 1639601
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)