Product update

Claude Code 2.1.309 fixes sandbox, MCP-config, and worktree isolation issues

Event time 1 independent sourceUpdated here

The short version

Anthropic released Claude Code 2.1.309 with fixes for shell startup files escaping the sandbox, mutable MCP configuration, and several permission and worktree-isolation bypasses.

What changed

The release runs macOS and Linux sandboxed Bash startup files inside the sandbox, prevents sandboxed commands and auto-accepted edits from changing the --mcp-config file, and fixes several permission-check and worktree-isolation bypasses.

What it means for you

Teams using Claude Code sandboxes, MCP configuration, or isolated worktrees can reduce the risk of changes crossing intended file and command boundaries; upgrade testing should cover their existing permission policies.

Anthropic has released Claude Code 2.1.309, a security- and isolation-focused update. On macOS and Linux, the release fixes Bash running shell startup files outside the sandbox before each command. On macOS, denyWrite glob rules now also apply when a matching path's real location is reached through a symlink.

The update prevents sandboxed commands and auto-accepted edits from modifying the MCP configuration file supplied with --mcp-config. It also fixes a disabled MCP server being reconnected by a later permission prompt in print and SDK sessions, alongside several missed Bash permission checks: a variable trusted despite a redirect that could fail to open, wrapped or prefixed cd plus git compound commands that did not prompt, and an Edit(path) deny rule that did not block a Bash redirect in some commands using a subshell.

Teams using worktree isolation should also note fixes for some locale-prefixed commands and zsh arithmetic commands that the isolation guard incorrectly allowed. Anthropic also says worktrees and branch checkouts that Claude Code creates now ignore git replace refs, matching its other Git operations.

Upgrade first in a non-production workspace. Test automations that pass --mcp-config, write denials through symlinks, Bash approval policies, and worktree tasks. These changes narrow bypasses of existing boundaries, but do not replace least-privilege configuration, code review, or secret isolation.

Related catalog entry

Fact check

  • VerifiedClaude Code 2.1.309 fixes macOS and Linux sandboxed Bash commands that ran shell startup files outside the sandbox, and fixes macOS denyWrite glob patterns when a matching path is reached through a symlink.Evidence
  • VerifiedThe release prevents sandboxed commands and auto-accepted edits from modifying the MCP configuration file passed with --mcp-config, and fixes multiple permission-check and worktree-isolation bypasses.Evidence

Coverage timeline

  1. Primary sourceAnthropic
    Claude Code v2.1.309 release notes