Skip to content

Bug: Observation system creates CLAUDE.md files in project subdirectories and duplicate nested directories #641

@yungweng

Description

@yungweng

Description

The claude-mem plugin (v9.0.1) is creating CLAUDE.md observation files in project subdirectories where work is being done, and occasionally creates duplicate nested directories (e.g., backend/backend/, frontend/frontend/).

Steps to Reproduce

  1. Work on files in a project subdirectory (e.g., backend/simulator/iot/)
  2. Make edits to multiple files in that directory
  3. Check git status after the session

Observed Behavior

Spurious files appear:

?? backend/backend/
?? backend/database/migrations/CLAUDE.md
?? backend/seed/fixed/CLAUDE.md
?? backend/simulator/iot/CLAUDE.md

Each generated CLAUDE.md file contains:

<claude-mem-context>
# Recent Activity

<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->

*No recent activity*
</claude-mem-context>

Or populated observation tables from the session.

Expected Behavior

  • Observation data should be stored in the claude-mem database (~/.claude-mem/claude-mem.db), not written to project directories
  • No files should be created in the user's project working directory
  • No duplicate nested directories should be created

Environment

  • claude-mem version: 9.0.1
  • Platform: macOS (Darwin 25.2.0)
  • Claude Code: Latest

Additional Context

The duplicate directory issue (e.g., backend/backend/) appears to be a path handling bug where the directory name gets doubled during some operation.

This behavior pollutes the working directory with untracked files and requires manual cleanup after each session.

Workaround

Manually delete the files after each session:

find . -path "./.git" -prune -o -name "CLAUDE.md" -newer <start-of-session> -type f -print
# Then selectively delete spurious ones

Or add to .gitignore (but this hides legitimate CLAUDE.md files too).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions