claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Memory files not read or Docs need a review

Open RicSala opened this issue 6 months ago • 0 comments

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

  1. Create a project structure:
  • /project/
    • CLAUDE.md
    • src/
      • credits/
        • CLAUDE.md
        • error.ts
  1. Add content to /project/CLAUDE.md (root level)
  2. Add test content to /project/src/credits/CLAUDE.md (subdirectory level)
  3. Ask Claude to review the file /src/credits/error.ts
  4. 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.

RicSala avatar Jun 08 '25 18:06 RicSala