Summary
There's no way to configure sandbox write paths for bash commands. Write paths are hardcoded, and additionalDirectories only grants read access.
Background
This was discussed in #10377 (now closed/locked). A commenter found the write paths are hardcoded:
B = [
"/dev/stdout", "/dev/stderr", "/dev/null", "/dev/tty",
"/dev/dtracehelper", "/dev/autofs_nowait",
"/tmp/claude", "/private/tmp/claude",
iJ.join(A, ".npm/_logs"), iJ.join(A, ".claude/debug"),
".",
]
Reproduction
Config:
{
"permissions": {
"allow": ["Edit(/Volumes/Casa/**)"]
},
"sandbox": {
"enabled": true,
"autoAllowBashIfSandboxed": true,
"additionalDirectories": ["/Volumes/Casa"]
}
}
Result:
$ touch /Volumes/Casa/test.txt
# Operation not permitted
$ mv /tmp/claude/file.txt /Volumes/Casa/file.txt
# Operation not permitted
Expected behavior
additionalDirectories should grant both read and write access, or there should be a separate additionalWriteDirectories setting.
Current workarounds
- Use Edit/Write tools instead of bash (requires read+write, inefficient)
- Ask user to run the command
- Add to
excludedCommands (security tradeoff)
Proposal
The underlying sandbox-runtime already supports filesystem.allowWrite. Expose this in Claude Code settings, e.g.:
{
"sandbox": {
"additionalWriteDirectories": ["/Volumes/Casa", "/path/to/other"]
}
}
Or make additionalDirectories grant write access too (simpler, matches user expectation).
Environment
- macOS Darwin 24.5.0
- Claude Code (latest as of 2026-02-02)
Summary
There's no way to configure sandbox write paths for bash commands. Write paths are hardcoded, and
additionalDirectoriesonly grants read access.Background
This was discussed in #10377 (now closed/locked). A commenter found the write paths are hardcoded:
Reproduction
Config:
{ "permissions": { "allow": ["Edit(/Volumes/Casa/**)"] }, "sandbox": { "enabled": true, "autoAllowBashIfSandboxed": true, "additionalDirectories": ["/Volumes/Casa"] } }Result:
Expected behavior
additionalDirectoriesshould grant both read and write access, or there should be a separateadditionalWriteDirectoriessetting.Current workarounds
excludedCommands(security tradeoff)Proposal
The underlying sandbox-runtime already supports
filesystem.allowWrite. Expose this in Claude Code settings, e.g.:{ "sandbox": { "additionalWriteDirectories": ["/Volumes/Casa", "/path/to/other"] } }Or make
additionalDirectoriesgrant write access too (simpler, matches user expectation).Environment