[BUG] useAutoModeDuringPlan never applies when a session starts in plan mode (permissions.defaultMode: "plan")

Status Fixed / completed
Reported on v2.1.170
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jun 10, 2026 · closed Aug 15, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Summary

useAutoModeDuringPlan: true (the "Use auto mode during plan" toggle in /config, default true) is never applied when a session starts directly in plan mode via permissions.defaultMode: "plan". Plan mode then runs with default-mode prompting semantics — every non-allowlisted read-only command asks for approval — which is far noisier than auto mode, even though auto mode is available and the setting is enabled.

The setting works fine when plan mode is entered by a mode transition (Shift+Tab cycle, /plan, or the EnterPlanMode tool). Only the session-startup path misses it.

Environment

  • Claude Code v2.1.170 (native build, macOS / Darwin 24.6)
  • Auto mode available and working on this account (entering auto via Shift+Tab auto-approves as expected)
  • ~/.claude/settings.json (relevant excerpt):
{
  "permissions": { "defaultMode": "plan" },
  "useAutoModeDuringPlan": true,
  "skipAutoPermissionPrompt": true
}

Steps to reproduce

  1. Set permissions.defaultMode: "plan" and useAutoModeDuringPlan: true in ~/.claude/settings.json.
  2. Start a fresh session (it starts in plan mode).
  3. Ask Claude to explore — e.g. run a read-only shell command that is not in any allowlist (ls -la /tmp).
  4. Observe a manual permission prompt for the read-only command.
  5. Now press Shift+Tab four times (plan → auto → default → acceptEdits → plan) to re-enter plan mode via a transition, and repeat step 3: the same kind of command is auto-approved.

Expected

Per the settings docs ("Whether plan mode uses auto mode semantics when auto mode is available. Default: true"), a session that starts in plan mode with auto mode available should auto-approve safe read-only tool calls while planning — same as plan mode entered via Shift+Tab.

Actual

Auto-during-plan semantics are never activated for the session's initial plan mode. Toggling "Use auto mode during plan" in /config mid-session doesn't help either (see root cause).

Root cause (from the v2.1.170 minified source)

Identifiers below are the minified names in the 2.1.170 binary:

  • Auto-during-plan semantics are only activated in Rq_() (logs as [prepareContextForPlanMode]). It is called exclusively on transitions into plan mode: the Shift+Tab cycle handler (Kr(), only when to === "plan" && from !== "plan"), the /plan command (only when not already in plan), and the EnterPlanMode tool.
  • When the session starts with defaultMode: "plan", the tool-permission context is constructed with mode: "plan" directly and prePlanMode stays undefinedRq_() never runs.
  • The recompute function M__() (run on settings changes, including the /config toggle) bails out early:

``js
if (!H.prePlanMode || H.prePlanMode === "bypassPermissions") return H;
``

so with prePlanMode unset, auto semantics can never be activated later in the session either.

  • Notably, Rq_() activates auto-during-plan when entering plan from any non-bypass mode (including default and acceptEdits), not just from auto — so the intended gating is clearly "auto mode available + setting enabled", and the startup path looks like an oversight rather than a design decision.

The JSON schema note for useAutoModeDuringPlan ("Has no effect unless permissions.defaultMode allows auto") hints at this, but the behavior contradicts the settings-reference wording and is surprising: defaultMode: "plan" is precisely the configuration of users who live in plan mode and would benefit most from auto-approved exploration.

Suggested fix

When initializing a session whose starting mode is plan, run the same preparation as prepareContextForPlanMode (activate auto semantics and set a sensible prePlanMode, e.g. "default") when auto mode is available and useAutoModeDuringPlan is enabled.

Workaround

At the start of each session, press Shift+Tab 4 times (plan → auto → default → acceptEdits → plan). Re-entering plan mode via the transition path activates auto-during-plan for the rest of the session.

View original on GitHub ↗

4 Comments

alvis · 2 months ago

I'm experiencing the same

austindotzip · 2 months ago

Confirming on Claude Code 2.1.187 (macOS 27). The auto-mode classifier appears to be armed only on a transition into plan mode, never when a session initializes or resumes already in plan.

From the 2.1.187 bundle:

  • Session init only arms it for a literal auto start — effectively if (r.mode === "auto") setAutoModeActive(true), with no branch for r.mode === "plan" && useAutoModeDuringPlan.
  • Plan-prep (Zut) early-returns when already in plan: if (e.mode === "plan") return e;. It only calls setAutoModeActive(true) when entering plan from a non-plan, non-bypassPermissions mode.
  • Re-eval (tUt) bails when plan has no prePlanMode, which only a transition sets.

Net effect: useAutoModeDuringPlan works if you Shift+Tab from auto/default into plan, but is a silent no-op when a session starts in plan (defaultMode: "plan", a resumed plan session, or --permission-mode plan).

Suggested fix: have the session-init path also arm the classifier when the initial mode is plan and useAutoModeDuringPlan + auto-mode availability both hold, mirroring the transition path.

Workaround until then: start in auto and Shift+Tab into plan within the session.

(Identifiers are from the minified bundle and won't match source names.)

sabeekpradhan · 1 month ago

Can confirm I've been having this bug on 2.1.220 on Linux.

bcherny collaborator · 15 days ago

Could not reproduce on v2.1.233 (macOS) — this was fixed in v2.1.198.

Steps I ran:

  1. Fresh project with .claude/settings.json = {"permissions": {"defaultMode": "plan"}, "useAutoModeDuringPlan": true} (auto mode available on the account, no Bash(...) allow rules matching the command, no sandbox).
  2. Start claude — footer shows ⏸ plan mode on.
  3. Prompt: "Run the shell command sw_vers && sysctl -n hw.ncpu and tell me the output."
  4. Repeated with claude --permission-mode plan.

Observed: in both cases the command ran with no permission prompt (Ran 1 shell command) and Claude reported the output. Expected: the same — sessions that start directly in plan mode get auto-mode semantics, just like plan mode entered via Shift+Tab.

Assessment: This was a genuine bug in the version reported (v2.1.170): auto-during-plan was only armed on a transition into plan mode, not when a session started in plan mode. It was fixed in v2.1.198 ("Fixed plan mode not auto-allowing read-only tool calls when a session starts in plan mode" — see the changelog / release). Note that v2.1.212 through v2.1.217 had a separate regression where shell commands outside the built-in read-only set prompted in plan mode regardless; that was fixed in v2.1.218. If you're on v2.1.218 or later and still see prompts, check that auto mode is actually available on your account (Shift+Tab should be able to reach auto) and that "Use auto mode during plan" is on in /config — the setting is a no-op when auto mode isn't available.

Closing as fixed. Please comment with your version and /config output if it recurs on v2.1.218 or later.

🤖 Generated with Claude Code