Skip to content
BENIBIX Learn

Read Permission Rule

AI⌨️ Claude CodeConfiguration

Also known as Read(./.env), Read deny rule

A rule that stops Claude from reading a file, like your keys.

Think of it like

It is like a lock on one drawer. The rest of the desk stays open.

Example

Lucy's project has a .env file with live keys. She denies Read(./.env), and Claude can no longer open it.

Why it matters

A file Claude reads goes into the chat. A deny rule keeps a secret from ever getting there.

Definition

A Read permission rule matches the files Claude may read. It is written as Read and a path, such as Read(./.env) or Read(./secrets/**). As a deny rule it keeps Claude's file tools away from that path. It also blocks Edit and Write there, and it tries to cover Grep, Glob and @file mentions too. A .claudeignore file does nothing, so put those paths here.

Example code

json
{
  "permissions": {
    "deny": ["Read(./.env)", "Read(./.env.*)", "Read(./secrets/**)"]
  }
}
Keep secrets out of the chat.
Read rules start their paths in these four ways.

Common mistake

Writing a .claudeignore file. Claude Code ignores it. Use Read deny rules instead.

Key takeaways

  1. 1
    Read and a path. Read(./.env).
  2. 2
    Blocks edits too. Same path.
  3. 3
    No .claudeignore. Use this.

Compare