Technologies
Back
Software Development & Open Source

Six CLAUDE.md files, six codewords: three at launch, two after a Read, one behind an env var

Dev.to
Advertisement468 × 90
Six CLAUDE.md files, six codewords: three at launch, two after a Read, one behind an env var

A recent technical investigation by Rulestack explores how Claude Code handles CLAUDE.md files across different directory structures. By placing unique codewords in six distinct locations, the researchers measured when and how these instruction files are loaded into the model's context. The findings reveal that files in parent and project directories load at launch, while subdirectory files are loaded lazily only when a file within those directories is read. Notably, files in directories added via the --add-dir flag remain invisible to the model unless a specific environment variable, CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD, is enabled. This study highlights the importance of understanding file loading behavior for developers managing complex project rules, as it directly impacts token usage and the effectiveness of agentic workflows. The researchers provide a reproducible lab setup for others to verify these behaviors in their own environments.

This is a summary. Read the full article at the original source:

Dev.to
Advertisement468 × 90
Share
Software Development & Open Source

Related stories

Advertisement970 × 250