Skip to content

CLAUDE.md file creation causes Python package shadowing when working in subdirectories #697

@nyflyer

Description

@nyflyer

When working in a subdirectory of a Python package, Claude Mem creates CLAUDE.md files using relative paths that recreate the parent directory structure. This creates a local folder with the same name as the installed package, causing Python's import system to find the empty local folder instead of the real package.

Steps to Reproduce:

  1. Have a Python package installed (e.g., my_package) as editable
  2. Navigate to a subdirectory: my_package/subdir/study/
  3. Use Claude Code with Claude Mem plugin
  4. Claude Mem attempts to write CLAUDE.md to track another folder in the repo
  5. A local ./my_package/ folder is created relative to CWD
  6. Imports like from my_package import ... fail with ModuleNotFoundError

Expected Behavior:
CLAUDE.md files should be written using absolute paths, or to a location that doesn't recreate parent directory names

Actual Behavior:
Relative paths create shadowing directories that break Python imports.

Workaround:
rm -rf ./my_package # from the subdirectory where shadowing occurred

Impact: High - breaks all package imports until manually removed

Version: 9.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions