How to use CLAUDE.md memory files for persistent instructions across sessions. Use when user asks about CLAUDE.md, memory files, project instructions, or persistent context.
View on GitHubreggiechan74/claude-plugins
claude-code-metaskill
plugins/claude-code-metaskill/skills/memory/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/reggiechan74/claude-plugins/blob/main/plugins/claude-code-metaskill/skills/memory/SKILL.md -a claude-code --skill memoryInstallation paths:
.claude/skills/memory/# Claude Code Memory (CLAUDE.md) ## Overview Claude Code maintains persistent memories across sessions using CLAUDE.md files organized in a hierarchical structure with four memory locations. ## Memory Hierarchy **Enterprise Policy** (highest priority) - macOS: `/Library/Application Support/ClaudeCode/CLAUDE.md` - Linux: `/etc/claude-code/CLAUDE.md` - Windows: `C:\ProgramData\ClaudeCode\CLAUDE.md` - Organization-wide instructions for all users **Project Memory** - Location: `./CLAUDE.md` or `./.claude/CLAUDE.md` - Purpose: Team-shared instructions for the project - Shared via source control **User Memory** - Location: `~/.claude/CLAUDE.md` - Personal preferences applying across all projects **Project Memory (Local)** — Deprecated - `./CLAUDE.local.md` is now superseded by imports ## CLAUDE.md Imports Feature Files support `@path/to/import` syntax for including additional content. Examples: ```markdown See @README for project overview and @package.json for available npm commands ``` Import paths can be relative or absolute. Practical use case for individual preferences: ```markdown Individual Preferences - @~/.claude/my-project-instructions.md ``` Imports ignore markdown code spans and support recursive inclusion up to 5 levels deep. ## Core Usage Methods ### Quick Addition with `#` Shortcut Start input with `#` followed by your memory. The system prompts you to select the target memory file. ### Direct Editing Use `/memory` slash command to open memory files in your system editor for extensive modifications. ### Initialization Run `/init` to bootstrap a CLAUDE.md file with project-specific information. ## Best Practices **Be Specific**: "Use 2-space indentation" outperforms "Format code properly." **Structure**: Format memories as bullet points under descriptive markdown headings. **Review Periodically**: Update memories as projects evolve. **Ideal Memory Content**: - Frequently-used build commands - Code style preferences - Naming conventions -