Claude Code v2.1.309: Sandbox and Permission Fixes
Claude Code v2.1.309 tightens sandbox and Bash permission checks, protects MCP config files, and changes how sed -i and claude ultrareview behave.
By Claudekit Bot Published 2 min read
- Source
- github.com
Claude Code v2.1.309 is a large maintenance release from Anthropic. Most of its changes tighten sandboxing and permission checks, and a few change existing behavior. If you run Claude Code in sandboxed, worktree-isolated, or scripted setups, read this release before you upgrade.
What happened
The v2.1.309 release notes were published on October 22, 2026. They list dozens of fixes, several improvements, and a set of behavior changes. Sandbox, Bash permission, and isolation fixes make up a large share of the list.
Key details
Sandbox and permissions. The release notes describe these fixes:
- On macOS and Linux, sandboxed Bash commands no longer run the shell’s startup files outside the sandbox before each command.
- On macOS,
denyWriteglob patterns now apply at a path’s real location even when the folder is reached through a symlink. - Sandboxed commands and auto-accepted edits can no longer modify the MCP config file passed with
--mcp-config. - An
Edit(path)deny rule now blocks a Bash redirect to that path in some commands that also held a subshell. - Worktree-isolated sessions now refuse some locale-prefixed commands and, on zsh, some arithmetic commands.
- On Windows, PowerShell checks no longer auto-approve some
Set-Locationorcdcommands that carry extra arguments.
Hooks. Hooks that run in PowerShell now block when the hook’s program exits with code 2. On Windows, PreToolUse and PermissionRequest hooks with "shell": "powershell" no longer fail open when Git for Windows isn’t installed.
Behavior changes.
sed -inow uses the standard Bash prompt and runs as written./rewindno longer restores its edits.claude ultrareviewnow requires workspace trust. Scripts can pass--trust-workspaceor setCLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK=1.- In bypass permissions mode in the Desktop app and VS Code, dangerous
rmandrmdircommands are now denied at once with a rewrite hint, so unattended sessions keep going.
Other fixes. A nested CLAUDE.md over the size limit now loads only its start, which stops sessions from compacting repeatedly. The /claude-api skill received several tracing corrections. Claude no longer notifies unrelated GitHub users by writing role names and placeholders as mentions.
Why it matters for Claude builders
If you rely on the sandbox, deny rules, or worktree isolation as a safety boundary, this release closes several gaps where those protections did not apply as intended.
The behavior changes can break existing automation:
- CI scripts that call
claude ultrareview. These now need--trust-workspaceor the environment variable listed above. - Workflows that expect
/rewindto undosed -iedits. This no longer works.
Before you upgrade, review the full list in the release notes and test any scripts that depend on these commands.
Source
Frequently asked questions
When was Claude Code v2.1.309 released?
The release was published on GitHub on October 22, 2026.
Does Claude Code v2.1.309 change how sed -i works?
Yes. According to the release notes, `sed -i` now gets the standard Bash prompt and runs as written instead of showing a simulated file-edit preview. Like other Bash edits, `/rewind` no longer restores it.
How do scripts run claude ultrareview after this release?
`claude ultrareview` now requires workspace trust. It asks on a terminal and refuses otherwise. Scripts can pass `--trust-workspace`, which takes no value, so put a PR number or base branch before it. Scripts can also set `CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK=1`.
What MCP-related fixes are in v2.1.309?
Sandboxed commands and auto-accepted edits can no longer modify the MCP config file passed with `--mcp-config`. A disabled MCP server is no longer reconnected by a later permission prompt in print and SDK sessions.