본문으로 건너뛰기
Skillpedia
에이전트48k · #4809

hierarchical-agent-memory

하는 일

이 도구는 컴퓨터 프로그램의 메모리를 체계적으로 관리하도록 돕습니다. 프로그램이 모든 것을 다시 읽는 대신, 프로젝트의 각 부분마다 정보를 정리한 '요약 메모'를 만듭니다. 이렇게 하면 시간과 자원을 아낄 수 있습니다.

사용하는 경우

  • ✓폴더가 많은 대규모 프로젝트가 있을 때.
  • ✓작업마다 프로그램이 사용하는 '메모리'(토큰)를 줄이고 싶을 때.
  • ✓얼마나 많은 시간과 비용이 절약되고 있는지 요약을 보고 싶을 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hierarchical-agent-memory/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hierarchical-agent-memory/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 프로젝트의 메모리를 설정해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

프로젝트의 각 폴더에 대한 '맥락' 파일을 만듭니다. 메인 파일에는 전반적인 정보가 들어가고, 다른 파일에는 각 부분의 세부 내용이 들어갑니다. 대시보드에서 얼마나 절약하고 있는지 보여 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Hierarchical Agent Memory (HAM)

Scoped memory system that gives AI coding agents a cheat sheet for each directory instead of re-reading your entire project every prompt. Root CLAUDE.md holds global context (200 tokens), subdirectory CLAUDE.md files hold scoped context (250 tokens each), and a .memory/ layer stores decisions, patterns, and an inbox for unconfirmed inferences.

When to Use This Skill

  • Use when you want to reduce input token costs across Claude Code sessions
  • Use when your project has 3+ directories and the agent keeps re-reading the same files
  • Use when you want directory-scoped context instead of one monolithic CLAUDE.md
  • Use when you want a dashboard to visualize token savings, session history, and context health
  • Use when setting up a new project and want structured agent memory from day one

How It Works

Step 1: Setup ("go ham")

Auto-detects your project platform and maturity, then generates the memory structure:

project/
├── CLAUDE.md              # Root context (~200 tokens)
├── .memory/
│   ├── decisions.md       # Architecture Decision Records
│   ├── patterns.md        # Reusable patterns
│   ├── inbox.md           # Inferred items awaiting confirmation
│   └── audit-log.md       # Audit history
└── src/
    ├── api/CLAUDE.md      # Scoped context for api/
    ├── components/CLAUDE.md
    └── lib/CLAUDE.md

Step 2: Context Routing

The root CLAUDE.md includes a routing section that tells the agent exactly which sub-context to load:

## Context Routing

→ api: src/api/CLAUDE.md
→ components: src/components/CLAUDE.md
→ lib: src/lib/CLAUDE.md

The agent reads root, then immediately loads the relevant subdirectory context — no guessing.

Step 3: Dashboard ("ham dashboard")

Launches a web dashboard at localhost:7777 that visualizes:

  • Token savings (HAM-on vs HAM-off sessions)
  • Daily token and cost trends
  • Per-directory session breakdown
  • Context file health (missing/stale/inherited CLAUDE.md coverage)
  • Routing compliance (how often the agent follows the routing map)
  • Carbon/energy estimates

Commands

Trigger What it does
go ham Set up HAM — auto-detect platform, generate CLAUDE.md files
ham savings Show token and cost savings report
ham dashboard Launch the interactive web dashboard
ham audit Health check on memory files
ham insights Generate actionable insights from session data
ham route Add/update Context Routing section in root CLAUDE.md
ham carbon Show energy and carbon efficiency data

Examples

Example 1: First-time setup

User: go ham

Agent: HAM setup complete. Created 8 files.
  - CLAUDE.md (root)
  - .memory/decisions.md
  - .memory/patterns.md
  - .memory/inbox.md
  - src/api/CLAUDE.md
  - src/components/CLAUDE.md
  - src/lib/CLAUDE.md
  - src/utils/CLAUDE.md

Baseline captured in .memory/baseline.json
Run "HAM savings" to see your token and cost savings.

Example 2: Checking savings

User: ham savings

Agent:
  Before HAM: ~7,500 tokens/prompt
  After HAM:    ~450 tokens/prompt
  Savings:    7,050 tokens (94%)

  Monthly projection (1,500 prompts):
    Sonnet: ~$31.73 saved
    Opus:   ~$158.63 saved

Best Practices

  • Keep root CLAUDE.md under 60 lines / 250 tokens
  • Keep subdirectory CLAUDE.md files under 75 lines each
  • Run ham audit every 2 weeks to catch stale or missing context files
  • Use ham route after adding new directories to keep routing current
  • Review .memory/inbox.md periodically — confirm or reject inferred items

Limitations

  • Token estimates use ~4 chars = 1 token approximation, not a real tokenizer
  • Baseline savings comparisons are estimates based on typical agent behavior
  • Dashboard requires Node.js 18+ and reads session data from ~/.claude/projects/
  • Context routing detection relies on CLAUDE.md read order in session JSONL files
  • Does not auto-update subdirectory CLAUDE.md content — you maintain those manually or via ham audit
  • Carbon estimates use regional grid averages, not real-time energy data

Related Skills

  • agent-memory-systems — general agent memory architecture patterns
  • agent-memory-mcp — MCP-based memory integration
자주 묻는 질문

'토큰'이란 무엇인가요?

프로그램이 이해하는 작은 텍스트 조각입니다. 더 많은 토큰을 사용할수록 비용이 더 듭니다.

CLAUDE.md는 무엇인가요?

프로그램이 지침이나 설명처럼 중요한 프로젝트 정보를 저장하는 파일입니다.

대시보드는 실시간 정보를 보여 주나요?

대시보드는 사용량과 저장된 데이터를 바탕으로 한 추정치를 보여 줍니다. 진행 상황과 비용을 시각적으로 파악하는 데 도움이 됩니다.

상세 정보

작성자의 원본 설명

Scoped CLAUDE.md memory system that reduces context token spend. Creates directory-level context files, tracks savings via dashboard, and routes agents to the right sub-context.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4809
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬