Skip to main content

I love it when a plan comes together

I love it when a plan comes together

A quote by Colonel John “Hannibal” Smith, the cigar-chomping leader of The A-Team, a hit 1980s TV series and one of my childhood memories.

The lesson to be learned from Hannibal, is that planning is important to succeed.  With the newly introduced ‘Planning mode’, planning also finds its place in our AI assisted development workflows inside Visual Studio.

What is Planning Mode?

Planning mode extends GitHub Copilot's Agent Mode capabilities to handle larger, multi-step coding tasks with a structured approach. Instead of jumping straight into code generation, Planning mode creates a detailed execution plan that includes:

  • A clear breakdown of tasks to be completed
  • Files that need to be edited
  • Context about the approach Copilot will take
  • Checkpoints for transparency and control

These plans are stored as Markdown files with task lists, giving you complete visibility into what Copilot intends to do before it starts making changes to your codebase.

How to Enable Planning Mode

Getting started with Planning mode is straightforward:

  • Ensure you have Visual Studio 2022 version 17.14 or later
    • Check your version at Help > About Visual Studio
    • Update through the Visual Studio Installer if needed
  • Enable Planning in settings
    • Navigate to Tools > Options > GitHub > Copilot
    • Check the box for "Enable Planning"
  • Access Planning tools in Agent mode
    • Open the Copilot Chat window
    • Select "Agent" from the mode dropdown
    • Planning tools will now appear in the Tools list

Once enabled, Planning tools are available immediately in your current chat session.

How Planning Mode Works

Here's the typical workflow when using Planning mode:

Enter a natural language prompt describing your complex task. For example:

  • "Refactor the authentication system to use JWT tokens"
  • "Add a caching layer to the data access layer"
  • "Implement dark mode support across the application"

Copilot analyzes your codebase and generates a detailed plan as a Markdown file. This plan includes things like:

  • Numbered task items with checkboxes
  • Files to be edited or created
  • Rationale for the approach
  • Dependencies between tasks

Remark: If you want to change the plan, stop the execution, update the file and restart it. Otherwise Copilot will immediately move on to execution.

As Copilot executes the plan, it:

  • Updates task checkboxes as work completes
  • Maintains execution state across steps
  • Monitors outcomes like build results and test failures
  • Iterates as needed based on feedback from builds and tests

Copilot still lists all edited files in the "Total changes" section. You can:

  • Review changes to individual files
  • Keep or undo edits for each code chunk
  • Accept or reject all changes since the last checkpoint

Best Practices for Using Planning Mode

To get the most out of Planning mode, consider these tips:

  • Be Specific About Intent (doh!): While Planning mode handles high-level tasks, providing clear requirements helps generate better plans. Include details about constraints, preferences, or specific technologies to use.
  • Use with Project Context: Planning mode works best when your project has clear documentation. Consider adding .instructions.md files in .github/instructions to define project standards that Copilot can reference.
  • Leverage Memories: The October update also introduced Copilot Memories, which capture coding standards and best practices. These preferences (stored in .editorconfig, CONTRIBUTING.md, or README.md) make Planning mode more project-aware.

Current Limitations

As a public preview feature, Planning mode has a few limitations to be aware of:

  • Temporary Storage: Plans are stored temporarily and deleted when the session ends unless you manually save them
  • Agent Compatibility: Some specialized agents might not yet fully support planning
  • No Stepwise Undo: Currently, Visual Studio doesn't support granular undo/redo for planning operations—use checkpoints and the Restore feature instead

More information

Visual Studio 2022 17.14 October Update

Introducing Planning in Visual Studio (Public Preview) - Visual Studio Blog

Popular posts from this blog

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...

Cache stampede: when our cache turned against us

While investigating some performance issues, we ran into an ASP.NET Core API that cached a fairly expensive aggregation query for 60 seconds. Under normal load, that was fine: one request rebuilds the cache, everyone else reads from it. Under peak load, dozens of requests would arrive in that same expiry window, all see a cache miss, and all fire the same expensive query in parallel. The database didn't like that. That was the moment when our caching layer stopped helping and started hurting. A burst of requests comes in at the same time, all miss the cache, and all go hammer the database or the downstream API at once. That's a cache stampede . The cache was supposed to protect our backend, and for a few hundred milliseconds it did the opposite. Why this happens IMemoryCache.GetOrCreate (and its async sibling) looks like it protects you, but it doesn't add any locking on its own. Look at the naive version: public async Task<Report> GetReportAsync(string key) ...

A complex system designed from scratch never works

A few years ago, I worked as an architect on a big mainframe rewrite. I still count it as one of my failures. Not because the technology was wrong, but because I couldn't convince the management team to simplify the approach. Years later, the organization is still struggling to get the new system up and running. I left the project at the time, because I couldn't put my name behind an approach that would take very long and cost a lot of money without a working system to show for it along the way. Gall’s Law That memory keeps coming back to me, because it's a textbook case of Gall's Law playing out in real life. Gall's Law , from John Gall's Systemantics , states it plainly: A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works, and it cannot be patched to make it work. You have to start over with a simple system that works. What does that mean in practice,...