Skip to main content
Blue Moose logo Blue Moose Field notes
← All articles
claude code

Claude Code 2.1.323 tightened Bash allow rules

Laptop showing code on a desk

Most Claude Code release notes I skim. The v2.1.323 notes (published 12 November) I actually read line by line, because buried in a very long list is a cluster of fixes to how Bash permission rules are matched. If you keep an allowlist in settings.json, some of these change what your rules really allowed.

Wildcards that skipped the prompt

The release says it fixed "Bash allow rules with an attached wildcard, such as Bash(ls*), skipping the permission prompt in some cases; a rule that names a variable, such as Bash(NODE_ENV*), now asks". A pattern like Bash(ls*) has no space before the star, so it matches anything that merely starts with those characters, not just ls and its arguments. The notes don't spell out which cases slipped through, so I won't guess. I did go through my own rules afterwards and rewrote the glued ones as Bash(ls:*)-style prefix rules or exact commands.

There's also a new startup warning for allow rules with a * inside a variable's value, for example Bash(PORT=* npm run dev). Worth running Claude Code once after updating just to see whether it complains about your config.

Wrappers and combined flags

Three more fixes in the same release concern rules being dodged by wrapping a command:

  • "Bash deny and ask rules missing some commands run through sudo, env and similar wrappers".
  • "Bash allow rules written with combined sudo flags skipping the permission prompt in some cases".
  • A case where "Bash permission checks judged an rm from the wrong folder and skipped the dangerous-removal prompt under bypass permissions or a Bash allow rule".

Deny rules are the ones I care about most. A deny that a wrapper can sidestep is a rule that gives you a false sense of safety. Also fixed: sandbox.excludedCommands letting a command it doesn't name run outside the sandbox, and Write/Edit being able to write to a path covered by a Read deny rule.

Behavior changes that might bite

Some of these are not bug fixes but deliberate tightening:

  • --permission-mode auto or defaultMode: auto now starts in Manual mode when auto mode is unavailable, instead of a mode that could allow more.
  • "Don't ask again" no longer saves a rule that looks like it holds a secret, or one that would land in a git-tracked settings.local.json; it lasts for the session only.
  • Project .mcp.json server approvals must match the server's exact name, so an approval written in another spelling asks again.
  • The sandbox on macOS and Linux now makes git worktree add, move and remove fail read-only.

That last one is the likeliest to break a workflow. If you script worktrees from inside a sandboxed session, expect failures and run those commands outside it.

What I did about it

I haven't reproduced any of the old bypasses myself, and the notes don't give enough detail to do so; I'm only reporting what the changelog says. My practical checklist after updating: grep your settings for * glued to a command name or a variable, replace broad allow rules with exact commands where I can, and keep deny rules for anything destructive. Fixes like these also remind me that an allowlist is a convenience layer, not a security boundary. The sandbox is the boundary, and the same release spends a lot of lines tightening that too.

BM
Blue Moose
The moose behind Blue Moose. Full-stack PHP developer — Drupal by day, Symfony by night, tests always.