katas-hierarchical-claude-memory

Organizes CLAUDE.md memory into user, team, and module levels with @imports and precedence rules.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/JaviMontano/claude-plugins --skill katas-hierarchical-claude-memory-javimontano
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: katas-hierarchical-claude-memory
Source: https://github.com/JaviMontano/claude-plugins/tree/main/plugins/claude-native-toolkit/skills/katas-hierarchical-claude-memory
Command: npx skills add https://github.com/JaviMontano/claude-plugins --skill katas-hierarchical-claude-memory-javimontano

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams waste tokens and create inconsistency when every session repeats conventions in prompts or when a single monolithic CLAUDE.md mixes personal preferences with shared rules. This Skill structures persistent agent memory into three cascading levels so each convention lives in exactly one authoritative place. ## Core Features & Use Cases - Three-level hierarchy: Separates memory into ~/.claude/CLAUDE.md (user), <repo>/CLAUDE.md (team), and <repo>/<subpath>/CLAUDE.md (module), with precedence subpath > repo > user. - @imports modularization: Keeps the main file short and cache-friendly by importing small files from docs/ instead of inlining thousands of lines. - Compaction boundary: Distinguishes transient Claude API compaction blocks (transcript continuity) from durable memory, requiring governed review before promoting content. - Use Case: A repo has a 2000-line CLAUDE.md mixing style guides, testing conventions, and personal preferences like "terse commits". This Skill refactors it into a short team file with @imports and moves personal preferences to the home file. ## Quick Start Audit my project's CLAUDE.md files and reorganize them into user, team, and module levels using @imports for the long sections.

Frequently Asked Questions about katas-hierarchical-claude-memory

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

FAQPage Schema
How do I organize CLAUDE.md files across user, repo, and module levels?▼

Place personal preferences in ~/.claude/CLAUDE.md, shared team conventions in <repo>/CLAUDE.md, and directory-specific rules in <repo>/<subpath>/CLAUDE.md. The most specific level wins: subpath overrides repo, which stacks over user.

How do I refactor a large monolithic CLAUDE.md file?▼

Move long stable sections like style guides and testing conventions into small files under docs/ and reference them with @imports on their own lines. Keep only short universal prohibitions inline so the root file stays short and cache-friendly.

What is the precedence rule when CLAUDE.md files conflict?▼

The more specific file wins: a module-level CLAUDE.md under a subpath overrides the repository-level file, which in turn stacks over the user-level home file. Resolve conflicts by applying the rule closest to the affected files.

Should personal preferences go in the repository CLAUDE.md?▼

No. Personal preferences like commit style or formatter choice belong in ~/.claude/CLAUDE.md, never in the repo. Putting them in the shared file contaminates the team's source of truth and diverges between machines.

Can a Claude API compaction block update CLAUDE.md automatically?▼

No. A compaction block preserves transcript continuity only and must be returned to the API; it never writes durable memory. Promoting content to CLAUDE.md requires a separate governed review of source, scope, privacy, and ownership.

When should I not use hierarchical CLAUDE.md memory?▼

Do not use it for path-conditional rules that load by glob, which belong to a different pattern, or for runtime tool policy such as PreToolUse hooks. It governs durable conventions, not transient task state or ephemeral tool output.