[BUG] CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD not loading CLAUDE.md if additionalDirectories is specified in settings.json
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?
When I setup CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD env and additionalDirectories in settings.json like this:
"additionalDirectories": [
"../raptor-ui"
],
"env": {
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1"
}
Claude Code doesn't seem to load the CLAUDE.MD from the additional directory. If I pass the --add-dir argument , then the CLAUDE.MD from the additional directory is loaded.
What Should Happen?
The CLAUDE.MD should load from additional directory when the CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD and additionalDirectories are specified in settings.json
Error Messages/Logs
No error message
Steps to Reproduce
Set up settings.json with additionalDirectories and the define the CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: 1 in the env section.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.27
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗