[Bug] Sandbox mode allows file creation in directories after permission removal via /permissions command

Resolved 💬 2 comments Opened Mar 23, 2026 by KamikazeZirou Closed Apr 21, 2026

Bug Description
In sandbox mode, we can create files in locations where writing is not permitted using bash commands.

Here are the steps:

  1. Launch Claude Code
  • Ensure sandbox mode is enabled in settings.json (set autoAllowBashIfSandboxed to true)
  1. Instruct Claude Code to create a file under directory X (outside the workspace) using the echo command
  2. Add directory X to the workspace using the /add-dir command
  3. Instruct Claude Code to create a file under directory X using the echo command
  4. Execute the /permissions command to remove directory X from the workspace
  5. Instruct Claude Code to create a file under directory X using the echo command

In step 2, the file cannot be created (as expected).
In step 4, the file can be created (as expected).
In step 6, the file can still be created (this is unintended).

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.81
  • Feedback ID: cc2ed60e-b8c4-492f-b4b7-42ae9d832647

Errors

[{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:244:3940)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-23T06:25:05.781Z"}]

View original on GitHub ↗

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