One Claude Code setting now keeps it from writing anywhere outside your project, even when you skip permission prompts
Claude Code 2.1.314 added a permissions setting called blockWritesOutsideWorkingDirectories. When it's on, the Write, Edit and NotebookEdit tools refuse any path outside your working directories in every permission mode, including the mode that skips approval prompts. Daniel San tested it with Write and Edit and both were blocked. The same release adds idle compaction in the VS Code extension and the desktop app.
Why it matters
Running Claude with fewer prompts is faster, but a stray edit to a dotfile or another repo is painful. This draws a hard line around the project folder.
Who it's for
Claude Code users who run long sessions with few approval prompts, and teams setting safe defaults for everyone.
How to try it
- Update Claude Code to 2.1.314 or later.
- Open your settings.json and set blockWritesOutsideWorkingDirectories to true under permissions.
- Restart the session and ask Claude to edit a file outside the project to confirm it's refused.
- Add any extra folders it should be allowed to touch as working directories instead of turning the setting off.
Plan & availability: Claude Code 2.1.314 or later, on any plan that includes Claude Code. Listed in Anthropic's Claude Code changelog, checked October 31, 2026. It covers the file-writing tools; shell commands follow your normal permission rules.
Source: Daniel San (@dani_avila7) on X
Written by Carlos Mendoza from the original post. Checked Oct 31, 2026. Features, plans and availability can change, so confirm on the source before you rely on it.
claude-codepermissionssecuritysettingstips
More Claude tricks
- One URL and one key for all your MCP servers: ngrok's MCP Gateway is live · Dec 2
- OpenCode 2.4.2 cuts about 700 tokens per request and tunes GPT-6.2 · Nov 26
- OpenCode 2.4 gives your coding agent a browser, automations, and video generation · Nov 24
- Claude Code 2.1.330 draws your charts with easel and lets scheduled tasks run 30 days · Nov 21