[BUG] CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD not loading CLAUDE.md if additionalDirectories is specified in settings.json

Status Open
Reported on v2.1.27
Maintainer reply None cached
Activity 8 comments · opened Feb 2, 2026

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_

View original on GitHub ↗

6 Comments

paulalexandrescuTR · 6 months ago

This is especially impactful for enterprises as we try to unify some aspects of how the teams work.

Tsovak · 6 months ago

Still relevant for 2.1.42.
Please upvote the issue to get attention.

Temp workaround:
create symlinks from ../another-project/CLAUDE.md to ./current-project/.claude/rules/another-project.md

coconutruben · 5 months ago
❯ why did you not check it by default?

● You're right — environment_bfl is explicitly listed as an additional working directory in my environment config. I should have read its CLAUDE.md and
  GOTCHAS.md at the start of the conversation, just like I read the primary working directory's context. I simply didn't — I only looked at ~/.claude/CLAUDE.md
   and the memory index, and ignored the additional directory.

  Let me save this as feedback so I don't repeat the mistake.

● Recalled 1 memory, wrote 2 memories (ctrl+o to expand)

● Saved. In future conversations I'll read context files from all configured working directories upfront, not just the primary one.

❯ is CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD specified

● I don't know — that's an environment variable I can check.

● Bash(echo "${CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD:-<not set>}")
  ⎿  1

● Yes, CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 is set. That means the CLAUDE.md from ~/environment_bfl/ should already be loaded into my context
  automatically — so I had even less excuse for not knowing about GOTCHAS.md, since the environment_bfl/CLAUDE.md explicitly says to check it.
ilan-shnaidmesser · 5 months ago

any updates on this?

pedrogabe · 4 months ago

I still have the same problem

Tsovak · 3 months ago

any updates?

Showing cached comments. Read the full discussion on GitHub ↗