little cups of claude

tips and techniques for Claude and Claude Code

#28: Plan Mode πŸ—ΊοΈ

Today we'll take a closer look at plan mode in Claude Code, where Claude researches a change and writes up a plan before it touches a single file.

In Cup #8 we touched on it briefly alongside the other permission modes. This time we'll go further: what Claude can actually do while planning, every option at the approval prompt, and a few settings that make planning a lot nicer. Let's dive in.

Getting In

There are three ways in. Mid-session, we press Shift+Tab until the status bar shows ⏸ plan mode on. To plan a single task, we put /plan in front of it:

/plan migrate Samantha's notification settings to the new preferences API

And to start a whole session that way, there's a flag:

claude --permission-mode plan

Pressing Shift+Tab again leaves plan mode, as long as no approval prompt is open.

What Claude Can Do While Planning

Plan mode is read and explore. Claude reads files, runs shell commands to look around, and writes its plan, but it doesn't edit our source.

What happens to those shell commands depends on the session. When auto mode is available, the auto mode classifier reviews them instead of prompting us, approving some and blocking others. That's controlled by the useAutoModeDuringPlan setting, which is on by default. Turning it off brings back the prompts:

{
  "useAutoModeDuringPlan": false
}

Without auto mode, any command outside the built-in read-only set asks for approval first.

Reviewing The Plan

When the plan is ready, Claude presents it and asks how to proceed:

  • Yes, and use auto mode approves and continues in auto mode. Without auto mode, this reads Yes, auto-accept edits.
  • Yes, manually approve edits approves, then asks about each edit.
  • No, keep planning stays in plan mode so we can say what to change.

Approving exits plan mode and switches to whichever mode the option describes, and Claude starts editing. It also gives the session a generated title based on the plan, unless we've already named it.

Before approving, pressing Ctrl+G opens the plan in our default text editor. We can rewrite steps, cut scope, or add a constraint, and Claude works from our edited version. Neat!

Watch Out

At the approval prompt, Shift+Tab doesn't leave plan mode. It approves the plan. To back out without approving, we press Esc first.

Starting Fresh After Planning

Planning can eat a lot of context, since Claude reads plenty of files to build its picture. This setting adds a first option to the approval menu that approves the plan and clears the conversation:

{
  "showClearContextOnPlanAccept": true
}

The option starts with Yes, clear context and, followed by the mode the session continues in, and shows how much of our context the planning used. Claude then implements from the plan alone.

Plans are also saved as files, in ~/.claude/plans by default. To keep them with the project, we can point plansDirectory at a path relative to the project root:

{
  "plansDirectory": "./plans"
}

A path that resolves outside the project root, like "../plans", falls back to ~/.claude/plans.

Planning By Default

For a project where every session should start by planning, we set defaultMode to plan in .claude/settings.json:

{
  "permissions": {
    "defaultMode": "plan"
  }
}

One catch: conversations started from the VS Code extension don't read project settings for the starting mode. There, the docs point to claudeCode.initialPermissionMode in our VS Code user settings instead.

Plan mode also pairs well with the opusplan model alias from Cup #19, which plans on Opus and switches to Sonnet once we approve.

More info about plan mode can be found at the Claude Code docs.

Share

Share on Threads

Similar Cups