CLAUDE.md files in your project folders. Each file contains a timeline of recent activity in that directory, giving Claude immediate awareness of what work has been done and where — without needing to search for it.
This feature is disabled by default. Enable it in
~/.claude-mem/settings.json.How it works
When you work with Claude Code in a project, Claude Mem tracks which files are read and modified. After each observation is saved, it automatically:- Identifies unique folder paths from the touched files
- Queries recent observations relevant to each folder
- Generates a formatted activity timeline
- Writes it to
CLAUDE.mdin that folder, inside<claude-mem-context>tags
What gets generated
Each folder’sCLAUDE.md contains a “Recent Activity” section with a markdown table:
Table column reference
| Column | Description |
|---|---|
| ID | Observation ID (e.g. #1234) or session ID (e.g. #S123) |
| Time | 12-hour format with AM/PM; ditto marks (") for repeated times |
| T | Type emoji indicator |
| Title | Brief description of the observation |
| Read | Estimated token count to read the full observation (e.g. ~250) |
Type indicators
| Emoji | Type |
|---|---|
| 🔴 | Bug fix |
| 🟣 | Feature |
| 🔄 | Refactor |
| ✅ | Change |
| 🔵 | Discovery |
| ⚖️ | Decision |
| 🎯 | Session |
| 💬 | Prompt |
Preserving your own content
The auto-generated section is wrapped in<claude-mem-context> tags. Any content you write outside these tags is preserved when the file is regenerated.
Project root exclusion
The project root (folders containing a.git directory) is excluded from auto-generation. Root CLAUDE.md files typically contain project-wide instructions you’ve written manually, and auto-generating at the root risks overwriting important documentation.
Subfolders are where folder-level context is most useful.
Git submodules — which have a
.git file rather than a directory — are correctly detected and are not excluded. They receive auto-generated context like any other subfolder.Enabling the feature
Open your settings file
Edit
~/.claude-mem/settings.json. The file is created automatically on first run.| Value | Behavior |
|---|---|
"false" (default) | Folder CLAUDE.md generation disabled |
"true" | Auto-generate folder CLAUDE.md files after each observation |
Manually regenerating context
To regenerate all folderCLAUDE.md files from the database:
Cleaning up generated files
The regenerate script includes a--clean mode to strip auto-generated content:
- Finds all
CLAUDE.mdfiles recursively - Strips
<claude-mem-context>...</claude-mem-context>sections - Deletes files that become empty after stripping
- Preserves files that have content outside the generated tags
Git integration
Whether to commit these files is your choice. Consider the trade-offs:- Commit them
- Gitignore them
Pros:
- Team members see folder-level context and recent activity
- New contributors can understand what happened where
- Code reviewers get additional context about recent changes
- Creates a historical record of work patterns in the repo
- Adds frequently-changing files to your repository
- Can create noise in diffs and commit history
- Different team members may generate different content
Gitignore patterns
To exclude subfolderCLAUDE.md files while keeping your root file:
CLAUDE.md files everywhere:
Recommended workflows
Solo developers: Keep files local (gitignore) for personal context, or commit them if you work across multiple machines. Teams: Discuss which approach works for your workflow. Committing is most valuable when onboarding is frequent. Before merging PRs: Use cleanup to remove generated files from the diff:Worktree support
When you’re working in a git worktree, context is automatically gathered from both the parent repository and the worktree directory. Observations about shared code remain visible regardless of which worktree you’re in. Claude Mem detects worktrees automatically. No configuration is needed, and the feature has no effect if you’re not using worktrees.Configuration
All settings including folder context options
Export and import
Move memory data between machines