Read and Edit Rules
Read and Edit Rules
Read and Edit rules both follow the gitignore specification, with four distinct pattern types:
//Absolute from filesystem root — useful for system files, logs, or any path you know exactly regardless of where Claude Code is run from. E.g.Read(//etc/hosts),Read(//var/log/app/*.log)~/From home directory — useful for dotfiles, personal configs, and user-specific directories consistent across projects. E.g.Read(~/Documents/**),Edit(~/.zshrc)/Relative to project root — the most common style for project work; anchored to wherever the repo root is, so it's portable across machines. E.g.Read(/src/**/*.ts),Edit(/src/components/**)- No prefix /
./Relative to current working directory — useful for files in whatever directory you launched Claude Code from; great for env files, local scripts, and scratch files. E.g.Read(*.env),Edit(*.md)
Example deny list: Read(//etc/passwd), Read(//etc/shadow), Read(~/Documents/personal/**), Edit(/src/**/*.test.ts), Read(.env.production)
Related: Permission Rules