Skip to content
BENIBIX Learn

CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1

Set to 1, it loads CLAUDE.md from folders added with --add-dir.

Think of it like

It is like you read the rules on the wall next door too.

Example

Lucy works in an app but edits a shared library beside it. The library has its own CLAUDE.md, and with this set Claude follows it too.

Why it matters

An added folder often has its own rules. Without this, Claude edits it blind to them.

Definition

CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD set to 1 loads notes from added folders. You add a folder with --add-dir. Claude then reads its CLAUDE.md, its rules and its local notes too. By default, an added folder lends its files. It does not lend its notes.

Example code

bash
export CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1
claude --add-dir ../shared-lib
Load the shared library's own rules too.
The last column: added folders load too.

Common mistake

Adding a folder and expecting its CLAUDE.md to load. It does not, unless this is set.

Key takeaways

  1. 1
    Added folders. From --add-dir.
  2. 2
    Their memory files. CLAUDE.md and rules.
  3. 3
    Off by default. Set 1.