additionalWritePaths in sandbox settings not honored

Resolved 💬 3 comments Opened Mar 29, 2026 by briandconnelly Closed Apr 1, 2026

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

  1. Add additionalWritePaths to .claude/settings.local.json:

``json
{
"sandbox": {
"enabled": true,
"additionalWritePaths": [
"/Users/me/.cache"
]
}
}
``

  1. Restart Claude Code
  2. 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 gpg can'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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗