Claude Code Closes Bash Permission, Sandbox and Hook Gaps in 2.1.323
Claude Code 2.1.323 patches a long run of cases where the agent could act without the prompt a user expected: Bash allow and deny rules, sandbox switch-off and exclusions, a Read deny rule bypassed by Write and Edit, and an auto mode fallback that could allow more than intended. It also tightens worktree and "don't ask again" behavior.
Key Takeaways
- Bash allow rules with wildcards such as
Bash(ls*)could skip the permission prompt in some cases, and this is fixed. - Deny and ask rules now catch commands run through
sudo,envand similar wrappers. - The Bash sandbox could switch off mid-session in one case, and sandbox exclusions could let unnamed commands escape.
- Write and Edit could write to paths covered by a Read deny rule, which no longer happens.
- If auto mode is unavailable, Claude Code now starts in Manual mode instead of a mode that could allow more.
- A failing permission check after a PreToolUse "allow" hook now falls back to normal decision-making instead of trusting the hook.
Bash permission checks
Claude Code 2.1.323 fixed several cases where a Bash command ran without a permission prompt. Allow rules with an attached wildcard, such as Bash(ls*), sometimes skipped the prompt, and a rule that names a variable, such as Bash(NODE_ENV*), now asks. Allow rules written with combined sudo flags skipped the prompt in some cases, and deny and ask rules missed some commands run through sudo, env and similar wrappers. Other fixes cover some lsof commands, a case where a check missed part of a command, a case for zsh users with certain non-default shell options, and an rm judged from the wrong folder that skipped the dangerous-removal prompt under bypass permissions or an allow rule. Two further changes make checks more consistent: the same command now more reliably gets the same answer on a slow or busy machine, and some commands that could run differently from how they were checked now ask for permission.
Sandbox
The Bash sandbox could switch off during a session in one case, and that was fixed. sandbox.excludedCommands could let a command it did not name run outside the sandbox, sandboxed commands could read Claude Code's file checkpoint copies, and the sandbox did not fully protect Claude Code's own config on installs using the legacy config file. All three were fixed. claude -p and the Agent SDK ran Bash unsandboxed when settings that turn the sandbox on failed validation; Claude Code now stops at start-up and names the invalid setting, and a --settings file that is not valid JSON and has a sandbox key now stops start-up too. On macOS, Linux and WSL the sandbox now ignores write access granted through a symlink that leads elsewhere, so users should grant the real path. git worktree add, move and remove now fail read-only in the sandbox, as do commits in a worktree the session was not started in.
Other permission boundaries
The Write and Edit tools could write to a path covered by a Read deny rule, which was fixed. --permission-mode auto or defaultMode: auto now starts in Manual mode, which asks first, when auto mode is unavailable, rather than a mode that could allow more. Bash prompts no longer offer "don't ask again" for commands that write to sensitive paths such as .git or .claude, and an allow rule that looks like it holds a secret, or would be saved to a git-tracked settings.local.json, now lasts for the session only. Project settings are no longer read through a symlink that leads to a different folder than the one checked, and WebFetch now rechecks organization policy and CLAUDE_CODE_DISABLE_WEB_FETCH on every call. /security-review now asks before Claude runs it, and skills' inline git commands stop in bare-repository worktrees and similar folders until allowed, outside auto mode and bypass.
Hooks
If a tool's permission check errors after a PreToolUse hook returned "allow", Claude Code now decides the call as if no hook had answered. If a check fails on input that a PermissionRequest hook rewrote, Claude Code now asks again, or refuses the call where nobody can answer. Worktree creation also refuses checkouts whose .git folders are links or hold hard links, and artifact updates ask first, even under an allow rule, when people outside the organization can see the artifact.