blockWritesOutsideWorkingDirectories
A security setting in Claude Code that intercepts file write operations targeting locations outside the working directory at the tool execution layer, taking effect in all permission modes.
Timeline (last 90 days)
The trigger condition for blockWritesOutsideWorkingDirectories is that the target path falls outside the working directory; in that case the tool call is rejected rather than written first and then reported as an error.
Claude Code introduced the blockWritesOutsideWorkingDirectories setting in version 2.1.314.
blockWritesOutsideWorkingDirectories rejects out-of-bounds paths directly at the tool layer rather than relying on prompts to constrain the model.
In monorepo scenarios, if the session is started only in a sub-package directory, paths of other sub-packages in the same repository are also treated as outside the working directory.
The permission mode determines "whether to ask the user" and not "whether this path can be touched"; blockWritesOutsideWorkingDirectories introduces a path-dimension constraint, forming an orthogonal relationship with permission modes.
NotebookEdit sometimes triggers kernel execution or output writes, and these side effects are not covered by blockWritesOutsideWorkingDirectories' interception.
v2.1.314 adds the configuration permissions.blockWritesOutsideWorkingDirectories; once enabled, the three file-writing tools Write, Edit, and NotebookEdit reject paths outside the working directory under any permission mode.
All Facts (7)
The trigger condition for blockWritesOutsideWorkingDirectories is that the target path falls outside the working directory; in that case the tool call is rejected rather than written first and then reported as an error.
50%UnverifiedNotebookEdit sometimes triggers kernel execution or output writes, and these side effects are not covered by blockWritesOutsideWorkingDirectories' interception.
50%UnverifiedIn monorepo scenarios, if the session is started only in a sub-package directory, paths of other sub-packages in the same repository are also treated as outside the working directory.
50%UnverifiedblockWritesOutsideWorkingDirectories rejects out-of-bounds paths directly at the tool layer rather than relying on prompts to constrain the model.
50%UnverifiedThe permission mode determines "whether to ask the user" and not "whether this path can be touched"; blockWritesOutsideWorkingDirectories introduces a path-dimension constraint, forming an orthogonal relationship with permission modes.
50%Unverifiedv2.1.314 adds the configuration permissions.blockWritesOutsideWorkingDirectories; once enabled, the three file-writing tools Write, Edit, and NotebookEdit reject paths outside the working directory under any permission mode.
50%UnverifiedClaude Code introduced the blockWritesOutsideWorkingDirectories setting in version 2.1.314.
50%