[BUG] Memory files not read or Docs need a review
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Claude Code CLI
- Claude CLI version: latest version
- Operating System: macOS
- Terminal:
Bug Description
CLAUDE.md files in subdirectories are not being automatically loaded when accessing files in those directories, contrary to what the documentation states. The memory system only loads CLAUDE.md files from parent directories (recursively up), but not from the current working directory when reading files.
Steps to Reproduce
- Create a project structure:
- /project/
- CLAUDE.md
- src/
- credits/
- CLAUDE.md
- error.ts
- credits/
- Add content to
/project/CLAUDE.md(root level) - Add test content to
/project/src/credits/CLAUDE.md(subdirectory level) - Ask Claude to review the file
/src/credits/error.ts - Check Claude's context/memory
Expected Behavior
According to the official documentation, when working in /project/src/credits/ or reading files in that directory, Claude should load:
/project/CLAUDE.md(recursively up) ✅/project/src/credits/CLAUDE.md(current directory) ✅
The docs specifically state: "When reading files in subdirs: /project/src/feature/subdir/CLAUDE.md ✅ (loaded on access)"
Actual Behavior
- Claude only loads the root
/project/CLAUDE.md✅ - Claude does NOT automatically load
/project/src/credits/CLAUDE.md❌ - The subdirectory CLAUDE.md file must be manually attached to the conversation
Additional Context
This behavior contradicts the documented memory loading pattern. The documentation suggests that CLAUDE.md files should be loaded from the directory containing the file being accessed, but in practice, only parent directory CLAUDE.md files are being loaded.
This significantly impacts the ability to use directory-specific context and instructions, which is a key feature of the memory system for organizing large projects.