Before I use Claude Code in a work repository, I want to understand what it can read. The project has a local .env file and some test credentials excluded from Git, but those files still exist in the working directory.
Does Claude Code respect those exclusions when exploring the project, or is .gitignore unrelated to its file access permissions? I’m especially unsure whether file discovery, direct reads, and shell commands follow the same restrictions.
I don’t want to mistake Git ignore rules for a security control. What is the documented way to configure Claude Code file access so sensitive files are off-limits? If that requires an isolated checkout or environment rather than a project setting, I’d like to understand the trade-off before connecting a real repository.
Can you answer this question?
Write Answer0 Answers