Claude Code Closes More Bash, Sandbox, Worktree and Deny-Rule Permission Gaps in 2.1.325

Claude CodeView original changelog

Claude Code 2.1.325 fixes another batch of cases where the agent could act outside what a user authorized. Some deny and ask rules did not apply to certain Bash commands, some compound commands ran without asking, and a Bash allow rule could run a different program than the one it names. The Bash sandbox also did not fully protect a worktree's settings and hooks or a linked worktree's shared git folder.

Key Takeaways

  • Some Bash deny and ask rules did not apply to certain commands, and 2.1.325 closes that gap.
  • A Bash allow rule could run a different program than the one it names, which is now fixed.
  • Compound Bash commands that could run without asking now trigger a permission prompt.
  • The worktree settings, hooks and shared git folder were not fully protected by the sandbox, and now are.
  • Isolated worktree sessions are now refused git bisect run, git maintenance register|start and scalar set-up commands.
  • Sign-in tokens and API keys are no longer passed to the programs the sandbox starts for itself.

Permission checks that did not hold

Claude Code 2.1.325 patches several cases where the agent could do something the user had not approved. Some deny and ask rules were not applied to certain Bash commands. A gap in Bash permission checks let some compound commands run without asking, and these now ask for permission. A Bash allow rule could also run a different program than the one it names, and that is fixed.

Deny rules that stopped matching

Relative deny and ask rules such as Read(./.env) stopped covering the project after a cd. They now keep covering it and also apply in added directories. Deny and ask rules starting with mcp__plugin_*_ missed a plugin's MCP server or tool when it was spelled in another letter case. Deny rules were also not applied to a permission approval that arrived after Claude Code restarted, in self-hosted runner and claude remote-control sessions. A committed .claude/settings.local.json could be treated as the user's own when Claude Code started in certain subfolders of a repository, and that case is closed.

Sandbox and worktree isolation

The Bash sandbox did not fully protect a worktree's settings and hooks, nor a linked worktree's shared git folder. Sandboxed commands could write to the native updater's download folder in some cases. The sandbox now refuses sandboxed writes to .claude settings, skills, agents, commands and hooks in added directories, as it already did in the launch folder. An isolated worktree session or agent is now refused git bisect run, git maintenance register|start and scalar's set-up commands, and is told what still works. The programs that Claude Code's sandbox starts for its own use, such as its network bridge, now run without Claude Code's sign-in tokens and API keys in their environment. Ripgrep, local git commands and the sandbox runtime's helpers also run without the mTLS client key's passphrase in their environment.

Other trust-boundary fixes

A connector tool's approval prompt in cloud sessions was being answered automatically while plugins were still loading, and that no longer happens. Token counting on Amazon Bedrock sent the conversation to Bedrock even when the allowedProviders managed setting did not allow it, and that is fixed. The release also includes a security fix in how zstd-compressed responses are decoded.