{"version":"2.1.314","anchor":"remote-sessions-strip-blockwritesoutsideworkingdirectories-a","canonical_anchor":"new-setting-blockwritesoutsideworkingdirectories","heading":"New setting blocks file writes outside the working directories","tier":"use","area":"Sandbox","scope":"both","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.314\/e\/remote-sessions-strip-blockwritesoutsideworkingdirectories-a","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.314","markdown":"### New setting blocks file writes outside the working directories\n\n`blockWritesOutsideWorkingDirectories` stops Claude's file tools writing outside your working folders and protects settings files, but is not sent to remote runs\n\n**What**\n\nA new permissions setting, `blockWritesOutsideWorkingDirectories` (in full, `permissions.blockWritesOutsideWorkingDirectories`), stops Claude Code from writing files outside the working directories. The working directories are the folders the session has been given to work in. The setting mirrors the existing `blockReadsOutsideWorkingDirectories`, which does the same for reading.\n\n- Refuses writes by the file tools `Write`, `Edit` and `NotebookEdit` outside the working directories, in every permission mode.\n\n- Refuses writes to Claude Code's own settings files while it is on.\n\n- Removes the `EnterWorktree` and `ExitWorktree` tools from the tools Claude is offered.\n\n- Does not limit shell commands, MCP tools (tools supplied by outside servers) or hooks (your own scripts that Claude Code runs at set moments).\n\n- When a write is refused, the message tells you to add the folder with `\/add-dir` or remove the setting.\n\n- The description of `blockReadsOutsideWorkingDirectories` now says that no allow rule lifts it.\n\n- For remote execution, the sandbox settings now drop `blockWritesOutsideWorkingDirectories` as well as `blockReadsOutsideWorkingDirectories` before the settings are forwarded. Before, only the read setting was dropped.\n\n**Why**\n\nThis gives a firm limit on where Claude's file tools can write. Two things to watch: shell commands, MCP tools and hooks can still write elsewhere, and the setting is not passed on to remote runs, so a remote session will not enforce it.\n\n- Area: Sandbox\n- Names: `blockWritesOutsideWorkingDirectories`, `blockReadsOutsideWorkingDirectories`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5\n- Scope: both\n- Heads-up: yes"}