deny rule for a specific path is silently not enforced for Write/Edit tools

Status Fixed / completed
Reported on v2.1.223
Maintainer reply None cached
Activity 1 comment · opened Aug 7, 2026 · closed Aug 25, 2026

Description

A deny rule scoped to a specific directory in settings.local.json
does not block file-write tool calls to that path — the write succeeds
with no prompt and no error, as if the rule weren't present.

Steps to reproduce

  1. Add to .claude/settings.local.json:

{
"permissions": {
"deny": ["Edit(/path/to/protected-dir/**)"]
}
}

  1. Start a session (tested both fresh sessions and mid-session after

editing the config).

  1. Use the Write tool to create a file inside /path/to/protected-dir/.

Expected

Write is blocked (deny rule matches).

Actual

File is written successfully. No permission prompt, no denial message.

Additional notes

  • Also tested with "deny": ["Write(/path/to/protected-dir/**)"]

in this case the CLI emits a startup warning stating that Write()
rules aren't evaluated by file permission checks, only Edit() is,
and recommends using Edit() instead ("Edit rules cover all
file-editing tools").

  • After switching to Edit()-only per that guidance, the Write tool

call in step 3 still succeeded — the rule still had no effect.

  • Reproduced 4 times total across both rule syntaxes and both

same-session and fresh-session conditions. Consistent failure
every time.

Environment

  • OS: macOS 15.6.1 (24G90)
  • Claude Code version: 2.1.223

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗