[BUG] /init command ignores ./claude/settings.json permissions
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
/init command ignores permissions set in .claude/settings.json
When running /init in a repository with the following .claude/settings.json file, the generated CLAUDE.md file describes the contents of the .env* files e.g. what are the key environment variables.
Example .claude/settings.json file
{
"permissions": {
"deny": [
"Read(./.env)",
"Read(./.env.*)",
"Read(./dist/*)"
]
}
}
This should prevent claude from reading .env files altogether, but appears not to be doing so as /init will generate a CLAUDE.md file which describes the content of these files
What Should Happen?
/init should skip over reading any files blacklisted as denying read permissions in .claude/settings.json
Error Messages/Logs
Steps to Reproduce
- Take an existing project with any significant complexity and several
.env,.env.developmentetc files in the root director - Define the
.claude/settingsfile as shown above - run
claude /initin the project root - Allow claude to generate the
CLAUDE.mdfile
Review the contents of the file and look for references to the .env file contents
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.92 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗