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.toRelated stories
The code was never the point: Hacktoberfest, AI, and the value of the climb
Hacktoberfest has officially moved away from counting pull requests, signaling a shift in how the open-source community values contributions in the ag…
Understanding Claude Code Hooks: Why Exiting 1 Fails to Block Commands
A recent technical guide highlights a common misconception regarding Claude Code hooks: exiting with a status of 1 does not actually block command exe…
In his recent blog post, Colin Breck addresses the growing trend of using Large Language Models (LLMs) to generate technical content. Breck argues tha…



