MCP HubMCP Hub
스킬 목록으로 돌아가기

manage-memory

pjt222
업데이트됨 Yesterday
1 조회
17
2
17
GitHub에서 보기
개발ai

정보

이 스킬은 MEMORY.md를 간결한 인덱스로 구성하고 세부 주제를 별도 파일로 추출하여 Claude Code의 지속적 메모리를 유지합니다. 오래된 항목을 자동으로 감지하고, 현재 프로젝트에 대해 정확성을 검증하며, 200줄 제한을 적용합니다. MEMORY.md가 줄 수 제한에 근접했을 때, 생산적인 작업 세션 후, 또는 프로젝트 변경으로 메모리 항목이 오래되었을 가능성이 있을 때 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/manage-memory

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Manage Memory

Maintain Claude Code's persistent memory dir → accurate, concise, useful across sessions. MEMORY.md loaded into system prompt every conv — lines after 200 truncated → file must be lean index pointing to topic files for detail.

Use When

  • MEMORY.md nearing 200-line limit
  • Session produced durable insights worth preserving (new patterns, arch decisions, debugging solutions)
  • Topic section in MEMORY.md > 10-15 lines → extract
  • Project state changed (renamed files, new domains, updated counts) → entries may be stale
  • Starting new work area → check if relevant memory exists
  • Periodic maintenance between sessions

In

  • Req: Access to memory dir (typically ~/.claude/projects/<project-path>/memory/)
  • Opt: Specific trigger ("MEMORY.md too long", "just finished major refactor")
  • Opt: Topic to add / update / extract

Do

Step 1: Assess Current State

Read MEMORY.md + list all files in memory dir:

wc -l <memory-dir>/MEMORY.md
ls -la <memory-dir>/

Check line count vs 200-line limit. Inventory existing topic files.

→ Clear picture of total lines, # topic files, which sections exist in MEMORY.md.

If err: Memory dir doesn't exist → create. MEMORY.md doesn't exist → minimal one w/ # Project Memory header + ## Topic Files section.

Step 2: ID Stale Entries

Compare memory claims vs current project state. Common staleness:

  1. Count drift: File counts, skill counts, domain counts changed after additions/removals
  2. Renamed paths: Files / dirs moved / renamed
  3. Superseded patterns: Workarounds no longer needed after fixes
  4. Contradictions: Two entries saying diff things about same topic

Use Grep to spot-check:

# Example: verify a skill count claim
grep -c "^      - id:" skills/_registry.yml
# Example: verify a file still exists
ls path/claimed/in/memory.md

→ List of stale entries w/ correct current vals.

If err: Can't verify claim (refs external state) → leave but add (unverified) note rather than silently preserve potentially wrong info.

Step 3: Decide What to Add

For new entries, apply filters before writing:

  1. Durability: Will this be true next session? Avoid session-specific (current task, in-progress, temporary).
  2. Non-duplication: CLAUDE.md / project docs already cover? Don't duplicate — memory for things NOT captured elsewhere.
  3. Verified: Confirmed across multi interactions, or single obs? Single → verify vs project docs before writing.
  4. Actionable: Does knowing change behavior? "Sky blue" ≠ useful. "Exit code 5 = quoting err → use temp files" changes how you work.

Exception: User explicitly asks to remember → save immediately, no multi confirmations needed.

→ Filtered list worth adding, each meeting durability + non-dup + verified + actionable.

If err: Unsure if worth keeping → err toward keeping briefly in MEMORY.md — easier to prune later than rediscover.

Step 4: Extract Oversize Topics

Section > ~10-15 lines → extract to dedicated topic file:

  1. Create <memory-dir>/<topic-name>.md w/ descriptive header
  2. Move detailed content from MEMORY.md → topic file
  3. Replace section in MEMORY.md w/ 1-2 line summary + link:
## Topic Files
- [topic-name.md](topic-name.md) — Brief description of contents

Naming conventions:

  • Lowercase kebab-case: viz-architecture.md, not VizArchitecture.md
  • Name by topic, not chronology: patterns.md, not session-2024-12.md
  • Group related: combine "R debugging" + "WSL quirks" → patterns.md vs one file per fact

→ MEMORY.md stays < 200 lines. Each topic file self-contained + readable w/o MEMORY.md ctx.

If err: Topic file < 5 lines → probably not worth extracting → leave inline.

Step 5: Update MEMORY.md

Apply changes: remove stale, add new, update counts, ensure Topic Files section lists all dedicated files.

MEMORY.md structure:

# Project Memory

## Section 1 — High-level context
- Bullet points, concise

## Section 2 — Another topic
- Key facts only

## Topic Files
- [file.md](file.md) — What it covers

Guidelines:

  • Each bullet 1-2 lines max
  • Inline formatting (code, bold) for scanability
  • Most frequently needed ctx first
  • Topic Files section always last

→ MEMORY.md < 200 lines, accurate, working links to all topic files.

If err: Can't get < 200 after extraction → ID least-freq-used section + extract. Every section candidate — even project structure overview can go to topic file if needed, leaving 1-line summary.

Step 6: Verify Integrity

Final check:

  1. Line count: MEMORY.md < 200
  2. Links: Every topic file referenced exists
  3. Orphans: Topic files not referenced in MEMORY.md
  4. Accuracy: Spot-check 2-3 factual claims vs project state
wc -l <memory-dir>/MEMORY.md
# Check for broken links
for f in $(grep -oP '\[.*?\]\(\K[^)]+' <memory-dir>/MEMORY.md); do
  ls <memory-dir>/$f 2>/dev/null || echo "BROKEN: $f"
done
# Check for orphan files
ls <memory-dir>/*.md | grep -v MEMORY.md

→ Line count < 200, no broken links, no orphans, spot-checked claims accurate.

If err: Fix broken links (update / remove). Orphans → add ref in MEMORY.md / delete if no longer relevant.

Check

  • MEMORY.md < 200 lines
  • All referenced topic files exist on disk
  • No orphan .md in memory dir (every file linked from MEMORY.md)
  • No stale counts / renamed paths
  • New entries meet durability / non-dup / verified / actionable
  • Topic files have descriptive headers + self-contained
  • MEMORY.md reads as quick-ref, not changelog

Traps

  • Memory file pollution: Writing every session obs to memory. Most findings session-specific + don't need persisting. Apply 4 filters (Step 3) before writing.
  • Stale counts: Updating code but not memory. Counts (skills, agents, domains, files) drift silently. Always verify vs source of truth before trusting memory.
  • Chronological organization: "When I learned" vs "what it's about". Topic-based (patterns.md, viz-architecture.md) > date-based files.
  • Duplicate CLAUDE.md: CLAUDE.md = authoritative project instructions. Memory captures things NOT in CLAUDE.md — debugging insights, arch decisions, workflow prefs, cross-project patterns.
  • Over-extraction: Topic file for every 3-line section. Only extract when > ~10-15 lines. Small sections inline.
  • Forget 200-line limit: MEMORY.md loaded every system prompt. Lines after 200 silently truncated. Grows past → bottom content effectively invisible.

  • write-claude-md — CLAUDE.md captures project instructions; memory captures cross-session learning
  • prune-agent-memory — inverse of manage-memory: auditing, classifying, selectively forgetting stored
  • write-continue-here — structured continuation file for session handoff; complements memory as short-term bridge
  • read-continue-here — read + act on continuation at session start; consumption side of handoff
  • create-skill — new skills may produce memory-worthy patterns
  • heal — self-healing may update memory as part of integration step
  • meditate — meditation sessions may surface insights worth persisting

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman-ultra/skills/manage-memory
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

qmd

개발

qmd는 BM25, 벡터 임베딩, 재순위화를 결합한 하이브리드 검색을 통해 로컬 파일을 색인화하고 검색할 수 있는 로컬 검색 및 색인화 CLI 도구입니다. 명령줄 사용과 Claude 통합을 위한 MCP(Model Context Protocol) 모드를 모두 지원합니다. 이 도구는 임베딩에 Ollama를 사용하고 색인을 로컬에 저장하여 터미널에서 직접 문서나 코드베이스를 검색하는 데 이상적입니다.

스킬 보기

subagent-driven-development

개발

이 스킬은 각 독립적인 작업마다 새로운 하위 에이전트를 배치하고 작업 사이에 코드 리뷰를 진행하여 구현 계획을 실행합니다. 이 리뷰 프로세스를 통해 품질 게이트를 유지하면서 빠른 반복 작업을 가능하게 합니다. 동일한 세션 내에서 대부분 독립적인 작업을 진행할 때 내장된 품질 검증과 함께 지속적인 진행을 보장하기 위해 사용하세요.

스킬 보기

mcporter

개발

mcporter 스킬은 개발자가 Claude에서 직접 Model Context Protocol(MCP) 서버를 관리하고 호출할 수 있도록 합니다. 이 스킬은 사용 가능한 서버를 나열하고, 인수를 사용해 해당 서버의 도구를 호출하며, 인증 및 데몬 생명주기를 처리하는 명령어를 제공합니다. 개발 워크플로우에서 MCP 서버 기능을 통합하고 테스트할 때 이 스킬을 사용하세요.

스킬 보기

adk-deployment-specialist

개발

이 스킬은 A2A 프로토콜을 사용하여 Vertex AI ADK 에이전트를 배포하고 오케스트레이션하며, AgentCard 검색, 작업 제출, 코드 실행 샌드박스 및 메모리 뱅크와 같은 지원 도구를 관리합니다. Python, Java 또는 Go 언어로 순차, 병렬 또는 루프 오케스트레이션 패턴을 갖춘 다중 에이전트 시스템 구축을 가능하게 합니다. Google Cloud에서 ADK 에이전트 배포 또는 에이전트 워크플로우 오케스트레이션을 요청받았을 때 사용하세요.

스킬 보기