You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Agents in Visual Studio Code chat help you execute complex coding tasks autonomously. The plan agent enables you to create detailed implementation plans before starting the implementation to ensure all requirements are met. With todo lists, the agent can ensure it stays focused on the overall goals and tracks progress effectively.
10
+
11
+
Using plans and todos let you structure and review details of the implementation with the agent before coding starts, improving the quality and reliability of the generated code. The plan and todos also provide better guidance to the agent to work through more complex and longer tasks in a systematic way.
12
+
13
+
This article explains how to research and plan development tasks in VS Code chat, including the plan agent and todo lists.
14
+
15
+
> [!NOTE]
16
+
> The plan agent is currently only available in [VS Code Insiders](https://code.visualstudio.com/insiders/).
17
+
18
+
## Plan agent for detailed task research
19
+
20
+
The built-in plan agent collaborates with you to create detailed implementation plans before executing them. This ensures that all requirements are considered and addressed before any code changes are made. The plan agent does not make any code changes until the plan is reviewed and approved by you. Once approved, you can hand off the plan to the default agent or save the plan for further refinement, review, or team discussions.
21
+
22
+
The plan agent is designed to:
23
+
24
+
* Research the task comprehensively using read-only tools and codebase analysis to identify requirements and constraints
25
+
* Break down the task into manageable, actionable steps and include open questions to ambiguous requirements
26
+
* Present a concise plan draft, based on a standardized plan format, for user review and iteration
27
+
28
+
### How to plan a task
29
+
30
+
1. Open the Chat view by pressing `kb(workbench.action.chat.open)` and select **Plan** from the agents dropdown.
31
+
32
+
2. Enter a high-level task (feature, refacoring, bug, etc.) and submit it.
33
+
34
+
For example:
35
+
* "Implement a user authentication system with OAuth2 and JWT"
36
+
* "Add unit tests for all API endpoints"
37
+
* "Save doesn't reset the form fields after submission"
38
+
39
+
3. Preview the proposed plan draft and provide feedback for iteration.
40
+
41
+
The plan agent provides a high-level summary and a breakdown of steps, including any open questions for clarification.
42
+
43
+

44
+
45
+
> [!TIP]
46
+
> Stay in plan mode to refine your plan before implementation. You can iterate multiple times to clarify requirements, adjust scope, or address open questions. This ensures a solid foundation before any code changes are made.
47
+
48
+
4. Once finalized, choose to save the plan or hand off to an implementation agent to start coding by using the corresponding controls.
49
+
50
+
When starting to implement the plan, you can still provide instructions, like "Start with the UI", or "only step 1 and 2". Similar for saving the plan, you can provide instructions like "Add a section for manual testing steps".
51
+
52
+
53
+
54
+
## Track progress with the todo list
55
+
56
+
When working on complex tasks, VS Code's agent will create a todo list to track progress. The todo list breaks down your request into individual tasks and updates automatically as the AI completes each step. This helps you to monitor progress and allows the agent to stay focused during long-running tasks.
57
+
58
+
<videosrc="../images/chat-planning/todo-list-demo.mp4"title="Video showing the todo list control in the Chat view to track the progress of a chat request."autoplayloopcontrolsmuted></video>
59
+
60
+
> [!TIP]
61
+
> You can update the todo list using natural language like "revise step 1 to do x" or "add another task". If the agent's todos are not as expected, you can clear the list, but otherwise the agent manages the updates automatically based on your feedback and information it gathers while working on the request.
62
+
63
+
## Related resources
64
+
65
+
*[Configure tools for agents in VS Code chat](/docs/copilot/chat/chat-tools.md)
66
+
*[Context engineering user guide](/docs/copilot/guides/context-engineering-guide.md)
Copy file name to clipboardExpand all lines: docs/copilot/chat/chat-sessions.md
+71-4Lines changed: 71 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,14 +104,77 @@ To export a chat session:
104
104
105
105
Alternatively, you can copy individual prompts or responses to the clipboard by right-clicking the message and selecting **Copy**. To copy the entire chat session in Markdown format, right-click the Chat view and select **Copy All**.
106
106
107
-
## Chat Sessions view
107
+
## Context-isolated Subagents
108
108
109
109
> [!NOTE]
110
-
> The Chat Sessions view is an experimental feature that is part of the integration with the Copilot Coding Agent.
110
+
> Subagents are currently only available in [VS Code Insiders](https://code.visualstudio.com/insiders/).
111
111
112
-
The Chat Sessions view provides a dedicated space to manage all your active and recent chat sessions. It shows interactive sessions created in VS Code chat and background sessions created with a coding agent in other environments, such as Copilot coding agent.
112
+
A subagent is an isolated autonomous agent that can be used to delegate complex, multi-step tasks to within your chat session. Subagents can be useful for research and context gathering, complex analysis, and to optimize context management in your chat sessions.
113
113
114
-
Learn more about [Copilot Coding Agent](/docs/copilot/copilot-coding-agent.md).
114
+
A subagent has the following characteristics:
115
+
116
+
* Operates independently from the main chat session and returns only the final result when complete
117
+
* Uses its own context window separate from the main chat session
118
+
* Operates autonomously without pausing for user feedback
119
+
* Has access to most tools available to the main chat session and the same model
120
+
121
+
To invoke a subagent, you can explicitly add the `#runSubagent` tool in your chat prompts or ask to use a subagent with natural language. Subagents are especially useful in custom agents or prompt files to isolate research-heavy workflows.
122
+
123
+
The following examples illustrate how to invoke a subagent:
124
+
125
+
*`"Perform research about viable authentication mechanisms for this app #runSubagent. Then summarize the findings and recommend the best option."`
126
+
*`"Analyze how to add OAuth authentication - use a subagent. Ask clarifying questions. Then implement this plan."`
127
+
128
+
> [!NOTE]
129
+
> Subagents have access to most tools, including editing and MCP tools, but cannot invoke other subagents.
130
+
131
+
## Agent Sessions
132
+
133
+
> [!NOTE]
134
+
> The Agent Sessions view is currently in preview. The integration with OpenAI Codex is available in [VS Code Insiders](https://code.visualstudio.com/insiders/).
135
+
136
+
Agents enable you to perform AI coding tasks asynchronously in the background. This allows you to continue working in VS Code while the agent processes your requests. These agents are different from chat sessions in VS Code, since agents work in the background, while chat sessions are interactive and require your real-time input. Agents can also run in different environments, such as locally on your machine or remotely in the cloud.
137
+
138
+
> [!TIP]
139
+
> The OpenAI Codex agent enables you to use your Copilot Pro+ subscription to authenticate and access Codex without additional setup. Get more information about [GitHub Copilot billing and premium requests](https://docs.github.com/en/copilot/concepts/billing/copilot-requests) in the GitHub documentation.
140
+
141
+
### Agent Sessions view
142
+
143
+
The Agent Sessions view provides a centralized location for managing your active chat sessions, both local in VS Code and sessions created by background agents in other environments, such as Copilot coding agent, GitHub Copilot CLI, or OpenAI Codex. Enable the Agent Sessions view with the `setting(chat.agentSessionsViewLocation)` setting.
144
+
145
+
The Agent Sessions view currently supports the following coding agent integrations: [GitHub Copilot coding agent](/docs/copilot/copilot-coding-agent.md), GitHub Copilot CLI, and OpenAI Codex. We're working to further expand support for more coding agents in the future.
146
+
147
+
The Agent Sessions view lists all your active chat sessions organized by their source. The view is divided into sections for local chat sessions in VS Code and for coding agent sessions.
148
+
149
+

150
+
151
+
You can start a new chat session for a specific agent directly from the Agent Sessions view by selecting the `+` control in the corresponding section.
152
+
153
+
Select a chat session to open it as a chat editor tab and monitor its progress. Right-click a session for options to open it in a new window or in the Chat view.
154
+
155
+
Agents might provide additional functionality beyond standard chat sessions, such as canceling ongoing tasks, checking out or closing the associated pull request, or applying their file changes directly to your workspace. Right-click an agent session in the Agent Sessions view to see the available options.
156
+
157
+
### Delegate tasks to agents
158
+
159
+
To delegate a task to an agent, you can start a session directly from the Agent Sessions view. If you have already started a local chat session, you can also delegate tasks to a Copilot coding agent from that session. Delegating to an agent allows you to offload complex or time-consuming tasks to the agent while you continue working.
160
+
161
+
To delegate a task to a Copilot coding agent from a local chat session:
162
+
163
+
1. Open the Chat view or a chat editor tab.
164
+
165
+
1. Type a prompt in the chat input box or open an existing chat session.
166
+
167
+
1. Select **Delegate to Agent** to send the prompt to a coding agent. If you have multiple agents enabled, choose the agent from the list.
168
+
169
+

170
+
171
+
The coding agent session is created and provided with the context from your local chat session.
172
+
173
+
1. Monitor the coding agent session's progress in the Agent Sessions view.
174
+
175
+
In the editor, you can also delegate tasks by selecting the relevant code lense above a TODO comment. You can then track the progress of the delegated task in the Agent Sessions view.
176
+
177
+

115
178
116
179
## Tips for managing chat sessions
117
180
@@ -123,6 +186,10 @@ Consider the following tips to help you work effectively with chat sessions:
123
186
124
187
***Use separate windows for multi-monitor setups**: open chat in a separate window on a secondary monitor to keep it visible while you work on code in the main window.
125
188
189
+
***Background tasks with remote agents**: use remote coding agents to perform AI tasks in the background while you continue working in VS Code.
190
+
191
+
***Interactive agent sessions**: use local agent sessions for interactive tasks that require real-time input and feedback.
192
+
126
193
## Related resources
127
194
128
195
*[Get started with chat in VS Code](/docs/copilot/chat/copilot-chat.md)
Copy file name to clipboardExpand all lines: docs/copilot/chat/copilot-chat.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,10 @@ Chat modes let chat assume a different role or persona optimized for specific ta
113
113
114
114
### Built-in chat modes
115
115
116
-
VS Code provides three built-in chat modes: ask mode, edit mode, and agent mode. For more specialized workflows, you can also create your own [custom chat modes](/docs/copilot/customization/custom-chat-modes.md).
116
+
> [!NOTE]
117
+
> Plan mode is currently in preview and only available in [VS Code Insiders](https://code.visualstudio.com/insiders/).
118
+
119
+
VS Code provides four built-in chat modes: **Agent**, **Plan**, **Ask**, and **Edit**. For more specialized workflows, you can also create your own [custom chat modes](/docs/copilot/customization/custom-chat-modes.md).
117
120
118
121
<details>
119
122
<summary>Agent mode</summary>
@@ -143,6 +146,32 @@ Open agent mode: [Stable](vscode://GitHub.Copilot-Chat/chat?mode=agent) | [Insid
143
146
144
147
</details>
145
148
149
+
<details>
150
+
<summary>Plan</summary>
151
+
152
+
The plan agent is optimized for creating a structured implementation plan for a coding task. Use the plan agent when you want to break down a complex feature or change into smaller, manageable steps before implementation.
153
+
154
+
The plan agent generates a detailed plan outlining the steps needed and ask clarifying questions to ensure a comprehensive understanding of the task. You can then handoff the plan to an implementation agent or use it as a guide.
155
+
156
+
Open chat with Plan: [Stable](vscode://GitHub.Copilot-Chat/chat?mode=plan) | [Insiders](vscode-insiders://GitHub.Copilot-Chat/chat?mode=plan)
157
+
158
+
### Get started with the plan agent
159
+
160
+
1. Select **Plan** from the agent picker in the Chat view.
161
+
162
+
1. Type a high-level prompt in the chat input field. For example, you might ask:
163
+
164
+
* "Update the application to support multi-language localization."
165
+
* "Add a search feature to the application."
166
+
167
+
1. Select **Send** or press `kb(workbench.action.chat.submit)` to submit your prompt.
168
+
169
+
1. Answer any clarifying questions or refine the plan as needed.
170
+
171
+
1. Select **Start Implementation** to hand off the plan to an implementation agent.
0 commit comments