[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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗