is now available! Read about the new features and fixes from January.

Planning with agents in VS Code

Agents in Visual Studio Code 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.

Using plans and todos lets 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.

This article explains how to research and plan development tasks with agents in VS Code, including the plan agent and todo lists.

Plan agent for detailed task research

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.

The plan agent is designed to:

  • Research the task comprehensively using read-only tools and codebase analysis to identify requirements and constraints
  • Ask clarifying questions interactively to resolve ambiguities before drafting the plan
  • Break down the task into manageable, actionable steps with clear verification criteria and documented decisions
  • Present a concise plan draft, based on a standardized plan format, for user review and iteration

The plan agent uses a 4-phase iterative workflow: Discovery (research) → Alignment (ask questions) → Design (draft plan) → Refinement (iterate). Questions are asked through interactive prompts that pause the agent until you respond, ensuring better alignment with your intent before code changes are made.

How to plan a task

  1. Open the Chat view by pressing ⌃⌘I (Windows, Linux Ctrl+Alt+I) and either select Plan from the agents dropdown, or type /plan followed by your task description.

  2. Enter a high-level task (feature, refactoring, bug, etc.) and submit it.

    For example:

    • "Implement a user authentication system with OAuth2 and JWT"
    • "Add unit tests for all API endpoints"
    • "Save doesn't reset the form fields after submission"
  3. Answer any clarifying questions the agent asks after researching your task.

    Screenshot showing a sample clarifying question from the plan agent in the Chat view, asking for more details about user roles for an authentication system.

  4. Preview the proposed plan draft and provide feedback for iteration.

    The plan agent provides a high-level summary, a breakdown of steps, verification steps for testing, and documented decisions made during planning.

    Screenshot showing a sample plan generated by the plan agent in the Chat view, including a summary, breakdown of steps, and open questions.

    Tip

    Stay in plan mode to refine your plan before implementation. You can iterate multiple times to clarify requirements, adjust scope, or provide additional context.

  5. Once finalized, use the buttons to start implementation of the plan or to open the plan in the editor for further review.

    You can choose to implement the plan in the same chat session, or start a background or cloud agent session to work on the implementation autonomously in the background.

    When starting to implement the plan, you can still provide clarifying instructions, like "Start with the UI", or "only step 1 and 2".

Track progress with the todo list

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.

Tip

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.