[BUG] useAutoModeDuringPlan never applies when a session starts in plan mode (permissions.defaultMode: "plan")
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
- Set
permissions.defaultMode: "plan"anduseAutoModeDuringPlan: truein~/.claude/settings.json. - Start a fresh session (it starts in plan mode).
- Ask Claude to explore — e.g. run a read-only shell command that is not in any allowlist (
ls -la /tmp). - Observe a manual permission prompt for the read-only command.
- 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 whento === "plan" && from !== "plan"), the/plancommand (only when not already in plan), and theEnterPlanModetool. - When the session starts with
defaultMode: "plan", the tool-permission context is constructed withmode: "plan"directly andprePlanModestaysundefined—Rq_()never runs. - The recompute function
M__()(run on settings changes, including the/configtoggle) 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 (includingdefaultandacceptEdits), not just fromauto— 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.
4 Comments
I'm experiencing the same
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:
autostart — effectivelyif (r.mode === "auto") setAutoModeActive(true), with no branch forr.mode === "plan" && useAutoModeDuringPlan.Zut) early-returns when already in plan:if (e.mode === "plan") return e;. It only callssetAutoModeActive(true)when entering plan from a non-plan, non-bypassPermissionsmode.tUt) bails when plan has noprePlanMode, which only a transition sets.Net effect:
useAutoModeDuringPlanworks 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
plananduseAutoModeDuringPlan+ 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.)
Can confirm I've been having this bug on 2.1.220 on Linux.
Could not reproduce on v2.1.233 (macOS) — this was fixed in v2.1.198.
Steps I ran:
.claude/settings.json={"permissions": {"defaultMode": "plan"}, "useAutoModeDuringPlan": true}(auto mode available on the account, noBash(...)allow rules matching the command, no sandbox).claude— footer shows⏸ plan mode on.sw_vers && sysctl -n hw.ncpuand tell me the output."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
/configoutput if it recurs on v2.1.218 or later.🤖 Generated with Claude Code