hierarchical-agent-memory

Generate directory-scoped CLAUDE.md memory files and a token savings dashboard.

27|5|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/Fandry96/k3-agentic-skills --skill hierarchical-agent-memory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hierarchical-agent-memory
Source: https://github.com/Fandry96/k3-agentic-skills/tree/main/skills/hierarchical-agent-memory
Command: npx skills add https://github.com/Fandry96/k3-agentic-skills --skill hierarchical-agent-memory

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces token spend by providing directory-scoped CLAUDE.md memory, so agents load the right sub-context instead of rereading entire project files.

Core Features & Use Cases

  • Directory-scoped context: root CLAUDE.md holds global context; subdirectories hold scoped context
  • Memory dashboard and audit trail to track decisions and savings
  • Use case: onboarding a new repo with deep directory structures to improve response time and reduce prompts

Quick Start

Run HAM setup to auto-detect your project, generate CLAUDE.md memory files, and launch the per-directory memory dashboard.

Frequently Asked Questions about hierarchical-agent-memory

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

FAQPage Schema
How do I reduce token usage when my AI agent keeps rereading entire project files?

You can reduce token waste by implementing directory-scoped CLAUDE.md memory files. This approach provides sub-context for specific directories so agents load only the relevant context instead of rereading entire project structures repeatedly.

What is directory-scoped memory for AI agents and when do I need it?

Directory-scoped memory is a context routing technique using root and per-directory CLAUDE.md files. You need it for multi-directory projects where agents repeatedly read the same files, causing unnecessary token consumption and slower response times.

How do I set up per-directory CLAUDE.md files for my repository?

Run HAM setup to auto-detect your project structure and generate CLAUDE.md memory files. This creates a root file for global context and subdirectory files for scoped context, then launches a dashboard to visualize token savings.

Can I track token savings and context health across multiple project directories?

Yes, you can track token savings using a lightweight .memory dashboard. It visualizes token savings and context health while providing an audit trail to monitor directory-scoped memory decisions across your project.

Does directory-scoped context routing work for onboarding new repositories with deep structures?

Yes, directory-scoped context routing works well for onboarding repos with deep directory structures. It improves response time and reduces prompts by ensuring agents load targeted sub-context rather than scanning the entire project.

What are the limitations of using CLAUDE.md files for AI agent memory management?

This approach requires maintaining both a root CLAUDE.md and per-directory files, which adds setup overhead. It is best suited for multi-directory projects where agents repeatedly read identical files and prompts.