# CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1

## Think of it like

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

## 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

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.

## Example code

```bash
export CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1
claude --add-dir ../shared-lib
```

Load the shared library's own rules too.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [/add-dir Command](https://learn.benibix.com/term/ai/add-dir-command)
- [CLAUDE.md](https://learn.benibix.com/term/ai/claude-md)
- [Claude Code Rules](https://learn.benibix.com/term/ai/claude-code-rules)

![Which memory files load into the chat under each variable, from CLAUDE.md to auto memory.](https://learn.benibix.com/diagrams/env-memory-load.svg)

---

Source: https://learn.benibix.com/term/ai/claude-code-additional-directories-claude-md-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
