memory-hierarchy

Organize and retrieve Claude Code memory files with import syntax and precedence.

9|Updated Oct 29, 2025
One-click install
npx skills add https://github.com/yebot/rad-cc-plugins --skill memory-hierarchy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-hierarchy
Source: https://github.com/yebot/rad-cc-plugins/tree/main/plugins/documentation-tools/skills/memory-hierarchy
Command: npx skills add https://github.com/yebot/rad-cc-plugins --skill memory-hierarchy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Effectively managing Claude Code's memory system, including various file types, locations, and import syntax, can be complex. This skill provides a complete reference to the memory hierarchy, enabling you to organize knowledge efficiently and ensure Claude Code always has the right context.

Core Features & Use Cases

  • Comprehensive Memory Locations: Understand the priority and purpose of Enterprise, Project, User, and Local memory files, ensuring optimal context loading.
  • Modular Rules & Path-Specific Scoping: Learn to organize rules in .claude/rules/ and use YAML frontmatter with glob patterns to apply rules to specific file types or directories.
  • Import Syntax & Best Practices: Master @path/to/file imports for linking documentation and follow guidelines for content, organization, and choosing the right memory type.

Quick Start

To add a project-specific rule for TypeScript files, ask the skill to "Show me how to create a rule in .claude/rules/ that applies only to src/api/**/*.ts files and enforces input validation."

Frequently Asked Questions about memory-hierarchy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize Claude Code's memory hierarchy across my project?

Claude Code's memory hierarchy prioritizes files by location: Enterprise policy, Project memory, Project rules, User memory, User rules, and Project-local memories. Organize by creating CLAUDE.md files at each level and storing rules in `.claude/rules/` directories. This ensures context loads in the correct priority order for your team and monorepo workflows.

What's the right way to structure rules for specific files in Claude Code?

Store rules in `.claude/rules/` and use YAML frontmatter with glob patterns to scope them to specific file types or directories. For example, add a rule targeting `src/api/**/*.ts` files to enforce input validation. Rules apply automatically based on the files you're working with.

How do I import documentation and link files in Claude Code's memory system?

Use the `@path/to/file` import syntax to link documentation and other memory files. Supports relative, absolute, and home-directory paths. Import statements enable modular organization and cross-reference of knowledge across Enterprise, Project, and User memory locations.

Can I use gitignored files in Claude Code's memory hierarchy?

Yes. Claude Code distinguishes between gitignored and non-gitignored memory files. Store sensitive or local-only context in gitignored memory files within your project structure, while keeping shared team memory in version-controlled CLAUDE.md and rules files.

Do I need to manually load CLAUDE.md files, or does Claude Code discover them automatically?

Claude Code automatically loads CLAUDE.md and rules files through upward recursive discovery. It searches from your current project directory up the directory tree, loading memory files and rules at each level according to the memory hierarchy priority order.

How do memory priorities work when the same rule appears at multiple levels?

Memory hierarchy enforces strict precedence: Enterprise policy overrides Project memory, which overrides User memory, which overrides Project-local memories. Explicit memory-priority ordering ensures that higher-level policies and rules always take effect, enabling consistent enforcement across team and individual workflows.