Breaking02 / IT
Claude Code v2.1.309 fixes sandbox and permission check gaps
A flaw that ran shell startup files outside the sandbox is fixed, and the release also changes behaviour that affects automation scripts.

Anthropic released Claude Code v2.1.309 on 22 Oct 2026 and said it fixes flaws in the sandbox and in permission checks. Developers who use sandbox settings or automation scripts are affected.
According to the release notes, sandboxed Bash commands on macOS and Linux ran the shell's startup files outside the sandbox before each command. Startup files are scripts that configure a shell when it launches. The release also fixes a flaw that let sandboxed commands and auto-accepted edits modify the config file passed with --mcp-config.
The release notes also describe a gap in permission checks. Some compound commands that wrapped or prefixed cd skipped approval before running git. They now prompt for approval, as a plain cd does.
Compatibility. Under the release notes, sed -i goes through the standard Bash approval prompt and is not restored by /rewind. claude ultrareview requires workspace trust and is refused outside a terminal. Scripts can pass --trust-workspace.
Platforms. The release notes also list fixes by operating system. On Linux, sandbox write blocks lifted when a background command outlived the session. On Windows, some Set-Location and cd commands with extra arguments now prompt for approval.
v2.1.308 was published earlier the same day. Its release notes carry a single line: "Bug fixes and reliability improvements".
The release notes do not say which version introduced the shell startup file problem.