denyRead vs Read Permission Rule
People think a denyRead entry stops Claude from reading a file. It only stops shell commands in the sandbox, such as cat. Claude's own Read tool runs outside the sandbox and follows Read rules. A Read deny rule does more. It blocks the tool. With the sandbox on, it is copied into denyRead as well.
sandbox.filesystem.denyRead
A list of paths sandboxed commands may not read.
sandbox.filesystem.denyRead is a settings key that hides paths from reading. Commands in the sandbox cannot read the paths it lists. By default they can read most things, even secret files such as ~/.aws/credentials. Use this key to hide those. Lists from all files are joined, and the paths from your Read deny rules are added too.
Read Permission Rule
A rule that stops Claude from reading a file, like your keys.
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.
In one line
- sandbox.filesystem.denyRead
- A list of paths sandboxed commands may not read.
- Read Permission Rule
- A rule that stops Claude from reading a file, like your keys.