Bash permission walker reports "Unhandled node type: ;" and forces prompt on subshell-form commands
Summary
Claude Code's Bash permission evaluator walks the tree-sitter-bash AST of each
command to match it against the allow-list. The walker is missing a handler for
the ; node type emitted between statements inside a subshell body, so any
command of the form (cmd1; cmd2) produces Unhandled node type: ; and is
forced to a manual approval prompt even when both inner commands would otherwise
be auto-allowed.
Minimal reproduction
With Bash(cd:*) and Bash(ls:*) (or equivalent) on the allow-list:
(cd /tmp; ls)
Result: Unhandled node type: ; is shown to the user and an approval prompt
appears, despite both cd /tmp and ls being individually allow-listed.
Why this matters
The two-call form (cd <path> in one Bash call, then bare commands in
subsequent calls) relies on CWD persisting across tool calls. That works in the
main agent but not in subagents — each subagent Bash call resets to the
agent's CWD. The documented alternative for subagents is the subshell form(cd <abs-path>; <command>), which avoids the CVE-2025-59536 harness gate oncd <path> && <cmd>. With ; unhandled by the walker, the subshell form also
forces a prompt, leaving subagents with no auto-approvable form for
"run X inside this directory."
Related walker bugs
Same family — walker missing handlers for specific tree-sitter-bash node types,
diagnostic leaking to user output:
- #47701 — \
file_redirect\(\>\, \>>\, \2>&1\, heredocs) - #47706 — the diagnostic leaking to user output at all
- #42085 — \
string\(for \\$(...)\and backticks; regression in 2.1.89) - #49483 — trailing \
\$\ - #50144 — \
string\from MCP results
Suggested fix
Add a handler for the \;\ node type in the walker (treat as a statement
separator, recurse into both children). Same shape as the fix that would unblock
\&&\ / \||\ / \|\ inside subshells if they have the same gap.
Environment
- Claude Code (CLI), macOS (Darwin 25.4.0)
- Shell: zsh 5.9
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗