Plan agent in VS Code

The Plan Agent in VS Code helps developers create detailed, iterative implementation plans by researching tasks, breaking them into actionable steps, and clarifying requirements before coding. It allows users to review, refine, save, and execute plans seamlessly, enhancing collaboration and productivity throughout the development process.

The Plan Agent in VS Code is a collaborative tool designed to help developers create detailed implementation plans before making any code changes. This ensures that all requirements are thoroughly understood and met prior to execution. To get started, users open the chat view, select “Plan” from the agents dropdown, and enter a high-level task such as adding a feature, refactoring, or fixing a bug. Once submitted, the planning agent begins its work by comprehensively researching the task using read-only tools, codebase analysis, and additional research methods, including fetching specified web pages for more information.

The planning agent employs sub-agents to gather further context, helping to build a complete and accurate plan. It breaks down the task into manageable, actionable steps and raises open-ended questions to clarify any ambiguous requirements. After this process, the agent presents a concise draft plan for the user to review. Users can then answer the open questions to refine the requirements, which updates the plan accordingly. This iterative process allows users to tailor the plan precisely to their needs before moving forward.

Once satisfied with the plan, users have the option to proceed with implementation or open the plan in the editor. Choosing to open it in the editor saves the plan as a new prompt file in markdown format, allowing for further refinement at any time. This prompt file can be saved directly into the source code for future reference or executed in a new or current chat session. The flexibility to revisit and adjust the plan ensures that developers maintain control over the development process.

When ready to implement, users can execute the plan directly within the chat or delegate the task to other agents such as the GitHub Copilot Cloud Agent CLI or other available agents. This seamless handoff from planning to implementation streamlines the workflow and enhances productivity. Additionally, users can access previous planning sessions anytime through the agent sessions, making it easy to manage multiple tasks and plans.

For those curious about the inner workings of the planning agent, VS Code provides a configuration view where users can see the exact definition of the agent, including the tools it uses, handoff options, and the detailed steps it follows from idea generation to deep research and iterative planning. Overall, the Plan Agent is a powerful feature that supports developers in organizing and executing their work efficiently, and users are encouraged to share their experiences and feedback. Happy coding!