Configure the sandboxed Bash tool changedsandboxing
Nearest release: v2.1.335, published an hour after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 2 Dec 2026 20:52 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 2 Dec 2026 21:07 UTC.
Upstream edited
Recorded here
Lines+10added
Lines−10removed
From line
306
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits70to this page, all time
### 0-byte read-only files appear in your project ### 0-byte read-only files appear at `.claude` settings paths, and "Yes, and don't ask again" doesn't save
The whole hunk
from line 306, old and new numbered
/
from line 306
306306}
307307```
308308
309If you placed the same configuration in `~/.claude/settings.json`, `.` would resolve to `~/.claude` instead, and project files would remain blocked by the `denyRead` rule.
309If you put this configuration in `~/.claude/settings.json`, the `.` entry resolves to `~/.claude` instead of the project root.
310310
311311To deny sandboxed commands read access to home directories and mounted volumes while keeping the working directories readable, set [`permissions.blockReadsOutsideWorkingDirectories`](https://code.claude.com/docs/en/settings-reference#permissions-blockreadsoutsideworkingdirectories) instead of writing path rules.
312312
from line 364
364364}
365365```
366366
367The sandbox has two independent layers: [filesystem isolation](#filesystem-isolation) controls which paths sandboxed commands can read and write, and [network isolation](#network-isolation) controls which domains they can reach. With the filesystem layer off, sandboxed commands get unrestricted read and write access to the host filesystem, while their network egress stays confined to your allowed domains. Turn the layer off when you sandbox to control where commands connect rather than what they write.
367The sandbox has two independent layers: [filesystem isolation](#filesystem-isolation) controls which paths sandboxed commands can read and write, and [network isolation](#network-isolation) controls which domains they can reach. With the filesystem layer off, sandboxed commands get unrestricted read and write access to the host filesystem.
368368
369369`sandbox.filesystem.disabled` defaults to `false`.
370370
from line 690
690690| `Edit` allow rules | Grant write access to specific paths, the same way `sandbox.filesystem.allowWrite` does |
691691| `Read` and `Edit` deny rules | Block access to specific files or directories |
692692| `WebFetch(domain:...)` allow and deny rules | Control domain access |
693| Sandbox `allowedDomains` | Controls which domains Bash commands can reach |
693| Sandbox `allowedDomains` | Pre-allows domains for sandboxed commands |
694694| Sandbox `deniedDomains` | Blocks specific domains even when a broader `allowedDomains` wildcard would otherwise permit them |
695695
696696Paths and domains from both sandbox settings and permission rules are merged into the final sandbox configuration.
from line 759
759759* [`allowAppleEvents`](https://code.claude.com/docs/en/settings-reference#sandbox-allowappleevents), which a repository can't turn on
760760* [`allowNestedUserNamespaces`](https://code.claude.com/docs/en/settings-reference#sandbox-allownestedusernamespaces), which a repository can't turn on
761761
762Set `allowManagedReadPathsOnly` to `true` in managed settings so that only `allowRead` entries from managed settings are honored. This prevents developers from widening read access beyond the organization-approved paths. To lock network domains to the managed values the same way, set [`allowManagedDomainsOnly`](https://code.claude.com/docs/en/settings-reference#sandbox-network-allowmanageddomainsonly). With `allowManagedDomainsOnly` on, only managed settings can set a [proxy port](#custom-proxy-configuration).
762Set `allowManagedReadPathsOnly` to `true` in managed settings so that only `allowRead` entries from managed settings are honored. To lock network domains to the managed values the same way, set [`allowManagedDomainsOnly`](https://code.claude.com/docs/en/settings-reference#sandbox-network-allowmanageddomainsonly). With `allowManagedDomainsOnly` on, only managed settings can set a [proxy port](#custom-proxy-configuration).
763763
764764When managed settings configure `sandbox.filesystem` or list any `sandbox.credentials.files` entry with `"mode": "deny"`, only managed settings can set [`filesystem.disabled`](#disable-filesystem-isolation), so developers can't turn filesystem isolation off with that key. A [valid](https://code.claude.com/docs/en/settings-reference.md#invalid-credential-entries-in-managed-settings) `mask` entry doesn't lock the key. See [Which settings can disable it](#which-settings-can-disable-it).
765765
from line 950
950950
951951Before v2.1.310, Claude Code didn't check for this restriction at startup, so `/sandbox` didn't report it.
952952
953### 0-byte read-only files appear at `.claude` settings paths, and "Yes, and don't ask again" doesn't save
953### 0-byte read-only files appear in your project
954954
955955On Linux and WSL2, the sandbox holds a write denial on a file that doesn't exist yet by creating a 0-byte read-only placeholder there while a sandboxed command runs. The sandbox removes the placeholder afterward.
956956
from line 957
957957A placeholder can stay behind in cases such as these:
958958
959959* The session is killed before that cleanup runs, for example by SIGKILL
960* The session exits while a sandboxed command is still running
960* You [move the session to the background](https://code.claude.com/docs/en/agent-view.md#send-the-session-to-the-background) while a sandboxed background command is still running
961961
962Later sessions bind the placeholders read-only again on every start, so a settings write such as saving a permission choice fails at a path where a placeholder remains.
962Until you delete a leftover placeholder, creating a file or folder with the same name can fail, even in a later session.
963963
964Run `claude doctor` in your terminal to list the leftover placeholder files. The [`Sandbox mask files left behind at write-deny paths`](https://code.claude.com/docs/en/errors#stale-sandbox-mask-files-left-by-a-killed-session) warning names some of them and counts the rest. Delete each file with `rm` while no other Claude Code session is running in that project. Before v2.1.257, Claude Code left the same placeholders behind when a session was killed, without flagging them.
964To check for leftover placeholder files, run `claude doctor` in your terminal from the folder where you started the session. To delete them, follow the steps for the [`Sandbox mask files left behind at write-deny paths`](https://code.claude.com/docs/en/errors#stale-sandbox-mask-files-left-by-a-killed-session) warning. Before v2.1.257, Claude Code left the same placeholders behind when a session was killed, without flagging them.
965965
966966### `git` over SSH fails with the sandbox on
967967
No line in this hunk matches that.