OmniscioGuidesWrites outside the working directories
Claude Code: writes outside the working directories are blocked
The message names the setting that refused the write, so the fix is a settings change or one added directory, and an allow rule will not do it. Adding a folder in general is on the add a directory guide.
Last checked against Anthropic's documentation on November 24, 2026. By the Omniscio team. Updated .
What is the exact message?
<path> is outside <dirs>; the permissions.blockWritesOutsideWorkingDirectories setting blocks writes outside the working directories. Ask the user to add the directory with /add-dir, or to remove that setting.The refusal has a second wording:
<path>: Writes outside the working directories are blocked (permissions.blockWritesOutsideWorkingDirectories). Add the directory with /add-dir, or remove that setting.The message names the file Claude tried to write and the directories the session may write in.
What does it mean?
One settings key, permissions.blockWritesOutsideWorkingDirectories, is set to true and is doing its job. Anthropic's reference says it makes the Write, Edit and NotebookEdit tools refuse paths outside the session's working directories, in every permission mode. The setting requires Claude Code v2.1.314 or later.
That “every mode” is the part people miss. It applies in bypassPermissions too, so changing permission mode, or starting with --dangerously-skip-permissions, does not get the write through.
The key covers the file tools only. Anthropic states plainly that it does not limit shell commands, MCP tools, or the programs hooks run, and points at sandboxing for shell writes.
What it refuses besides your own files
- Claude Code's settings files. These are refused inside the working directories too, because a settings file can lift the block. Anthropic's instruction is to edit a settings file yourself.
- A directory only repository settings add, where
additionalDirectorieslists it only in.claude/settings.json, or in.claude/settings.local.jsonunless git reports that file as untracked. - A subagent's worktree, when an
isolation: worktreesubagent's worktree sits outside the working directories. - Auto memory in a directory the repository chose, where
autoMemoryDirectorynames it in repository settings.
Some of Claude Code's own files stay writable: plan files, the scratchpad, a background session's tmp directory, and .md files in the project's auto memory.
Why it is on when you did not set it
The key has a scope of “any file”: a true in any settings file the session loads applies. That means it can arrive from a place you do not think of as your settings:
- Your user settings, at
~/.claude/settings.json. - The project's settings, in
.claude/settings.jsonor.claude/settings.local.json. A repository can turn the block on for itself this way, but it cannot lift yours. - A
--settingsfile, or a host application that launches Claude Code with its own settings. - Managed settings. The block is also on while Claude Code cannot read the
permissionsobject in your managed settings, which Anthropic lists among the keys that fail closed.
Anthropic's own line for the last case: if none of your settings files has the key, it can come from --settings or from a host application, and the person who launches or manages the session is the one to ask.
How do I fix it?
- If Claude should not write there, do nothing. The refusal is the setting working as intended.
- To let Claude write to an existing directory, run
/add-dir <directory>at the Claude Code prompt, or pass--add-dir <directory>when you start Claude Code. - To make one directory reachable in every session, list it under
permissions.additionalDirectoriesin your user or managed settings. The directory list is the way in, not anEditrule. - If the path is a Claude Code settings file, edit it yourself. Adding its directory with
/add-dirdoes not help, because Claude Code then refuses the write as a settings file. - To turn the block off, remove
permissions.blockWritesOutsideWorkingDirectoriesfrom every settings file that sets it, then restart Claude Code. - If it came from somewhere else, ask whoever launches or manages the session about
--settingsand managed settings.
/add-dir needs a directory that exists. For subagent worktrees, Anthropic says to name the .claude/worktrees directory at the repository root.
What does not help
- An
Editallow rule for the file. Anthropic states that no allow rule lets Claude's file tools through the block. The directory list is the documented route. - Switching permission mode. The block applies in every mode,
bypassPermissionsincluded. - Restarting without changing anything. The key is still set in the file that set it, so the next session refuses the same path.
How do I know it is fixed?
- Ask Claude to run the same write again. The same path gets a real result instead of the refusal.
- If you turned the key off, start a new session first: a running session keeps the settings it loaded.
- Anthropic's own test is to ask Claude to write a file outside the working directories, such as
~/block-test.txtwhen your home directory is not one of them. A refusal names the setting; a successful write means it is off.
Where these answers come from
- Anthropic's error reference, read November 24, 2026: both wordings and the steps it gives.
- Anthropic's settings reference: what the key blocks, the v2.1.314 requirement, the scope, what stays writable, and the directory list that lets one through, plus the rule that
/add-dirneeds a directory that exists and the.claude/worktreesnote for subagent worktrees. - Anthropic's permissions page: the pair of blocking keys, and the note that shell writes need sandboxing.
Common questions
What does “the permissions.blockWritesOutsideWorkingDirectories setting blocks writes outside the working directories” mean?
A settings key is on that makes Claude Code's Write, Edit and NotebookEdit tools refuse any path outside the session's working directories, in every permission mode including bypassPermissions. The path named in the message is the one Claude tried to write. Nothing is broken, and the same write will be refused until the folder is added or the key is removed.
Does allowlisting the file with an Edit rule fix it?
No. Anthropic states that no allow rule lets Claude's file tools through either the read or the write block. The documented ways past it are adding the directory as a working directory, or removing permissions.blockWritesOutsideWorkingDirectories from every settings file that sets it and restarting Claude Code.
Why does it still refuse when I am in bypassPermissions mode?
Because the setting applies in every permission mode, bypassPermissions included. It is a boundary rather than a prompt, so the permission mode does not decide it. The documented way through is /add-dir or a change to the setting itself.
Does it stop shell commands from writing outside the project too?
No. Anthropic says the key does not limit shell commands, MCP tools, or the programs hooks run. To limit where shell commands write, it points to sandboxing instead.