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.
Manages persistent instructions across sessions using hierarchical CLAUDE.md files. Use when users ask about memory files, project instructions, or persistent context.
/plugin marketplace add reggiechan74/claude-plugins/plugin install claude-code-metaskill@claude-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Claude Code maintains persistent memories across sessions using CLAUDE.md files organized in a hierarchical structure with four memory locations.
Enterprise Policy (highest priority)
/Library/Application Support/ClaudeCode/CLAUDE.md/etc/claude-code/CLAUDE.mdC:\ProgramData\ClaudeCode\CLAUDE.mdProject Memory
./CLAUDE.md or ./.claude/CLAUDE.mdUser Memory
~/.claude/CLAUDE.mdProject Memory (Local) — Deprecated
./CLAUDE.local.md is now superseded by importsFiles support @path/to/import syntax for including additional content. Examples:
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:
Individual Preferences - @~/.claude/my-project-instructions.md
Imports ignore markdown code spans and support recursive inclusion up to 5 levels deep.
# ShortcutStart input with # followed by your memory. The system prompts you to select the target memory file.
Use /memory slash command to open memory files in your system editor for extensive modifications.
Run /init to bootstrap a CLAUDE.md file with project-specific information.
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:
# Project Instructions
## Code Style
- Use 2-space indentation
- Prefer functional components in React
- Use TypeScript strict mode
- Follow ESLint rules without exceptions
## Build Commands
- `npm run dev` - Start development server
- `npm run test` - Run test suite
- `npm run build` - Production build
## Architecture
- API routes in `src/api/`
- Components in `src/components/`
- Utilities in `src/utils/`
- Follow feature-based folder structure
## Testing
- Write unit tests for all utilities
- Integration tests for API routes
- Use React Testing Library for components
## External Resources
See @README.md for project overview
See @CONTRIBUTING.md for contribution guidelines
Project-level CLAUDE.md:
Local overrides:
When Claude processes a request, it reads all applicable memory files in order of precedence:
Settings in higher-priority files take precedence over lower-priority ones.
Onboarding: New team members get instant context from project CLAUDE.md
Consistency: Team maintains consistent code style through shared memory
Personalization: Individual developers add personal preferences via user memory
Security: Enterprise policies enforce security requirements globally
Documentation: Import existing project docs to provide context