Skip to content
Proposals/Enable blockWritesOutsideWorkingDirectories in C
proposalteamP5Worth a lookClaude Code

Enable blockWritesOutsideWorkingDirectories in Claude Code permissions

Turn on permissions.blockWritesOutsideWorkingDirectories so Write, Edit, and NotebookEdit refuse paths outside working directories in every permission mode. Align sandbox.excludedCommands, worktree resume, and --setting-sources with the v2.1.314 permission and sandbox fixes.

Why this loop

Claude Code v2.1.314 adds permissions.blockWritesOutsideWorkingDirectories, which makes Write, Edit, and NotebookEdit refuse paths outside the working directories in every permission mode, not only stricter modes. That is the highest-leverage control in this release for anyone who lets the agent edit files. The same release also changes nearby permission surfaces you may already rely on: sandbox protections now apply when a worktree is entered with claude -p --resume or --continue; sandbox.excludedCommands unsandboxes a call only when every command in that call matches an entry; a settings file excluded with --setting-sources no longer still supplies auto mode rules or saved permission consents; auto mode no longer reports a call as blocked when its safety check gave no verdict. Put the new write block in project and managed settings, then fix excludedCommands lists and resume/worktree habits so they match post-upgrade behavior. Cap PreCompact hook output at 10,000 characters so oversized hook stdout cannot fail or repeat compaction. Ignore the 29 omitted changes.

Proposed actions

  1. Add to .claude/settings.json and to managed/user settings: {"permissions":{"blockWritesOutsideWorkingDirectories":true}} so Write, Edit, and NotebookEdit refuse any path outside the working directories in every permission mode.
  2. Rewrite sandbox.excludedCommands so every command in a multi-command call is listed; after v2.1.314 a call runs outside the sandbox only when every command matches an entry, not when one of them does.
  3. Keep sandbox on when entering a git worktree with claude -p --resume or --continue; v2.1.314 now applies sandbox protections on those entry points.
  4. Stop using --setting-sources to exclude a settings file if you still need its auto mode rules or saved permission consents; v2.1.314 no longer leaks those from excluded files.
  5. Trim each PreCompact hook's output to 10,000 characters so oversized hook stdout cannot fail or repeat compaction.

Agent prompt

Paste into your agent or query via MCP (get_agent_prompt) — free, no extra AI cost

Paste into Claude Code / CLAUDE.md task

DevAgentRadar → Claude Code

You are helping me adopt a real coding-assistant change. Work only from the facts below. Do not invent features.

Context

Assistant: Claude Code Proposal: Enable blockWritesOutsideWorkingDirectories in Claude Code permissions Summary: Turn on permissions.blockWritesOutsideWorkingDirectories so Write, Edit, and NotebookEdit refuse paths outside working directories in every permission mode. Align sandbox.excludedCommands, worktree resume, and --setting-sources with the v2.1.314 permission and sandbox fixes. Primary source: https://github.com/anthropics/claude-code/releases/tag/v2.1.314

Why it matters

Claude Code v2.1.314 adds permissions.blockWritesOutsideWorkingDirectories, which makes Write, Edit, and NotebookEdit refuse paths outside the working directories in every permission mode, not only stricter modes. That is the highest-leverage control in this release for anyone who lets the agent edit files. The same release also changes nearby permission surfaces you may already rely on: sandbox protections now apply when a worktree is entered with claude -p --resume or --continue; sandbox.excludedCommands unsandboxes a call only when every command in that call matches an entry; a settings file excluded with --setting-sources no longer still supplies auto mode rules or saved permission consents; auto mode no longer reports a call as blocked when its safety check gave no verdict. Put the new write block in project and managed settings, then fix excludedCommands lists and resume/worktree habits so they match post-upgrade behavior. Cap PreCompact hook output at 10,000 characters so oversized hook stdout cannot fail or repeat compaction. Ignore the 29 omitted changes.

Suggested actions

  1. Add to .claude/settings.json and to managed/user settings: {"permissions":{"blockWritesOutsideWorkingDirectories":true}} so Write, Edit, and NotebookEdit refuse any path outside the working directories in every permission mode.
  2. Rewrite sandbox.excludedCommands so every command in a multi-command call is listed; after v2.1.314 a call runs outside the sandbox only when every command matches an entry, not when one of them does.
  3. Keep sandbox on when entering a git worktree with claude -p --resume or --continue; v2.1.314 now applies sandbox protections on those entry points.
  4. Stop using --setting-sources to exclude a settings file if you still need its auto mode rules or saved permission consents; v2.1.314 no longer leaks those from excluded files.
  5. Trim each PreCompact hook's output to 10,000 characters so oversized hook stdout cannot fail or repeat compaction.

Config surfaces this release may change

  • MCP servers (high confidence) — check your repo before applying
  • skills (high confidence) — check your repo before applying
  • background and headless runs — check your repo before applying
  • slash commands — check your repo before applying
  • context and compaction settings — check your repo before applying
  • agent context files — check your repo before applying
  • permission rules — check your repo before applying
  • sandbox settings — check your repo before applying
  • subagent definitions — check your repo before applying

After you finish

Do not report this as applied to DevAgentRadar. You cannot write the visitor's loop.

Tell the human: open https://devagentradar.com/proposals/claude-code-v2-1-314-enable-blockwritesoutsideworkingdirectories-in-clau and mark Applied, Skipped, or Failed. Proposal id: 73a4fd0d-f299-45c8-a19e-f57793a6646b

Your job

  1. Restate the change in one sentence.
  2. Propose a minimal plan for my repo (or a throwaway pilot).
  3. Implement only what I approve; prefer small diffs and tests.
  4. Call out risks (permissions, breaking APIs, cost).

Start by confirming you understood the proposal.

agentmcpmodelsecurityideRelease source ↗

Your loop

This browser · no sign-in · not shared as “you”

After you run the prompt

Only you can mark this. Agents cannot write your loop.

Your decision stays on this device. A public tally appears after a few votes.

Originating release signal

Claude Codev2.1.314Oct 30, 2026

v2.1.314

Added permissions.blockWritesOutsideWorkingDirectories: Write, Edit and NotebookEdit refuse paths outside the working directories in every permission mode · Added an optional groups list to Claude apps gateway upstreams: only developers in the listed IdP groups are sent to that upstream, on failover too · Added guardrail_trace to Claude apps gateway Bedrock upstreams, to log which Amazon Bedrock guardrail filter fired on a request, without the matched text · +82 more changes
Verified excerpt — the source's own words

What's changed

  • Added permissions.blockWritesOutsideWorkingDirectories: Write, Edit and NotebookEdit refuse paths outside the working directories in every permission mode
  • Added an optional groups list to Claude apps gateway upstreams: only developers in the listed IdP groups are sent to that upstream, on failover too
  • Added guardrail_trace to Claude apps gateway Bedrock upstreams, to log which Amazon Bedrock guardrail filter fired on a request, without the matched text
  • Added idle compaction to VS Code and Claude Desktop's Code tab: a 200K+ token conversation left idle is summarized, and the summary is used on your next message if the prompt cache has expired
  • Fixed sessions failing turn after turn with "Invalid effort level" when an organization's admin caps a model's effort: Claude Code now lowers the effort, retries, and says which level it uses
  • Fixed claude -p exiting with code 0 and no output when startup failed; it now prints the error and exits 1
  • Fixed Bedrock sessions with many images failing every turn and /compact with "400 Input is too long." instead of removing older images and compacting

Excerpt ends here — this release continues at the source ↗.

Primary source ↗