additionalWritePaths in sandbox settings not honored
Summary
The sandbox.additionalWritePaths setting in both .claude/settings.local.json and ~/.claude/settings.json is not being applied to the sandbox filesystem allowlist.
Steps to reproduce
- Add
additionalWritePathsto.claude/settings.local.json:
``json``
{
"sandbox": {
"enabled": true,
"additionalWritePaths": [
"/Users/me/.cache"
]
}
}
- Restart Claude Code
- Attempt to write to that path:
````
echo "test" > ~/.cache/test-file
Result: operation not permitted
The sandbox config printed at session start confirms the path is not in the filesystem write allowlist, despite being set in settings.
What I tried
- Setting in
.claude/settings.local.json— not honored - Setting in
.claude/settings.json(project-level) — not honored - Setting in
~/.claude/settings.json(global) — not honored - Using
~/.cache(tilde) vs/Users/me/.cache(absolute) — neither works
Impact
This blocks tools that need to write to common cache/config directories from working inside the sandbox. Specific examples:
- GPG signing fails because
gpgcan't create lock files in~/.gnupg - prek (pre-commit hook runner) fails because it can't write logs to
~/.cache/prek/
Workarounds exist for some tools (e.g., setting PREK_HOME to $TMPDIR), but not all (GPG requires write access to its home directory for lock files).
Environment
- macOS (Darwin 25.4.0)
- Claude Code CLI
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗