claude-code - 💡(How to fix) Fix [BUG] Deny rules under permissions.deny not blocking file reads

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Code Example

"permissions": {
    "deny": [
      "Read(/Users/philipzablocki/Downloads/**)",
      ....
    ],
    "defaultMode": "auto"
  }

---

The deny rule IS in your settings.json — the permissions section
  appears earlier in the file. Your tail just showed the very end
  (statusLine, effortLevel), so the deny rules weren't visible in that
  slice.

  The rule was there: "Read(/Users/philipzablocki/Downloads/**)". The
  fact that I read [INSERT_FILE_NAME] anyway is a Claude Code bug —
  the deny rule was configured but not enforced. Worth filing at
  https://github.com/anthropics/claude-code/issues.

---

"permissions": {
    "deny": [
      "Read(/Users/philipzablocki/Downloads/**)",
      ....
    ],
    "defaultMode": "auto"
  }
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Here is a snippet of my ~./claude/settings.json":

  "permissions": {
    "deny": [
      "Read(/Users/philipzablocki/Downloads/**)",
      ....
    ],
    "defaultMode": "auto"
  }

What Should Happen?

Claude read the contents of a folder within my downloads folder (what is supposed to be off-limits).

Error Messages/Logs

The deny rule IS in your settings.json — the permissions section
  appears earlier in the file. Your tail just showed the very end
  (statusLine, effortLevel), so the deny rules weren't visible in that
  slice.

  The rule was there: "Read(/Users/philipzablocki/Downloads/**)". The
  fact that I read [INSERT_FILE_NAME] anyway is a Claude Code bug —
  the deny rule was configured but not enforced. Worth filing at
  https://github.com/anthropics/claude-code/issues.

Steps to Reproduce

  1. Create a folder in your downloads folder, add a file to that folder.
  2. I told Claude for it to not read the files in that folder, it says the settings.json value itself. Should look something like this:
"permissions": {
    "deny": [
      "Read(/Users/philipzablocki/Downloads/**)",
      ....
    ],
    "defaultMode": "auto"
  }

Ask Claude to read the file

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.114 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

I'm using cmux

extent analysis

TL;DR

The issue is likely due to a bug in Claude Code where the deny rule in the settings.json file is not being enforced, allowing Claude to read files in the specified directory.

Guidance

  • Verify that the deny rule is correctly formatted and placed in the settings.json file, as the error message suggests it is present but not enforced.
  • Check the Claude Code documentation to see if there are any known issues or limitations with the deny rule feature.
  • Try modifying the deny rule to use a more specific path or filename to see if that resolves the issue.
  • Consider filing a bug report with the Claude Code team, as the error message suggests this is a known issue.

Example

No code snippet is provided as the issue is related to a configuration file and the code is not explicitly mentioned.

Notes

The issue may be specific to the Sonnet model or the Anthropic API, and further investigation may be needed to determine the root cause.

Recommendation

Apply workaround: The user may need to use a different approach to restrict access to the files, such as moving them to a different directory or using a different permission system, until the bug is fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Deny rules under permissions.deny not blocking file reads