Under the hood
Shell commands run as part of a prompt now force permission mode down from auto to default
What
A new forPromptShellCommand flag marks when a shell command is being run as part of a prompt rather than a direct user action. When this flag is true, Claude Code now rewrites the effective permission mode from auto to default, and records the original mode as modeBeforeRewrite.
Why
This stops prompt-triggered shell commands from silently running in the more permissive auto mode, requiring the normal approval flow instead.