Claude Code version 2.1.314, released on 30 October, adds one setting that closes a gap many people have worried about: an agent that is allowed to edit files wandering out of the project folder. With the setting on, the file-editing tools refuse any path outside the working folders. Adopt it if you run Claude Code with relaxed permissions, and read the limit below before you rely on it.
What it is
The changelog entry says the new key, permissions.blockWritesOutsideWorkingDirectories, makes the Write, Edit and NotebookEdit tools refuse paths outside the working directories "in every permission mode". That includes the modes where the agent normally does not ask before editing. The permissions documentation describes it as one of two keys you set to true, the other being a sibling that blocks reads outside the working folders. It requires version 2.1.314 or later.
What it does not do
This is the important part. The documentation says the key does not limit shell commands, MCP tools, or the programs hooks run. (MCP is the protocol agents use to call outside tools; hooks are scripts that run around the agent's actions.) So an agent that can run a shell command can still write anywhere your account can. For that, the documentation points to sandboxing, which limits where shell commands may write. The setting also leaves out some of Claude Code's own files, such as plan files.
Think of it as a lock on one door of a house with several doors. It is a good lock, and the other doors still need their own.
What to do
Adopt. Turn the key on in your user settings if you ever run with relaxed permissions, and if you need real containment, add a sandbox rather than trusting this key alone. If you need to reach one folder outside the project, add it as a working directory, as the documentation describes.