[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:
- Launch Claude Code
- Ensure sandbox mode is enabled in settings.json (set
autoAllowBashIfSandboxedtotrue)
- Instruct Claude Code to create a file under directory X (outside the workspace) using the
echocommand - Add directory X to the workspace using the
/add-dircommand - Instruct Claude Code to create a file under directory X using the
echocommand - Execute the
/permissionscommand to remove directory X from the workspace - Instruct Claude Code to create a file under directory X using the
echocommand
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"}]This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗