Test: .claudeignore does nothing in Claude Code, file read 12 of 12 times
An experiment on Claude Code 2.1.289 found that a file listed in .claudeignore was read in all 12 attempts via Read, cat, grep -r, the Grep tool and an @-mention. A Read(./secret.txt) deny rule blocked everything except grep -r, which printed the secret in 2 of 2 runs; adding the file to .gitignore closed that gap too.
- File listed in .claudeignore was read in 12 of 12 attempts on Claude Code 2.1.289
- Read(./secret.txt) deny rule failed to stop grep -r: secret printed in 2 of 2 runs
- Adding the file to .gitignore closed the grep -r gap
- Claude Code docs state plainly that .claudeignore has no effect
Read next
Security