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

agent-memory

하는 일

이 스킬은 AI 에이전트를 위한 메모리 시스템을 설정해, 교훈이 계속 반복된 뒤에야 보관되게 합니다. 프로젝트 지침 파일이 복잡해졌거나 에이전트가 같은 수정 사항을 계속 다시 배우는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓에이전트가 세션마다 같은 수정 사항을 다시 배울 때.
  • ✓프로젝트 지침 파일이 너무 길어져 중요한 사실과 사소한 사실이 섞일 때.
  • ✓기억된 규칙의 출처를 추적해야 할 때.

스킬 링크

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-memory/skills/agent-memory/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-memory/skills/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에게 요청하는 예시

“제 에이전트가 우리가 pnpm을 쓴다는 것을 자꾸 잊습니다. 반복해서 나오는 교훈만 남기는 메모리 시스템을 설정해 주세요.”

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

작동 방식

사실은 원시 세션 메모에서 항상 로드되는 프로젝트 맥락까지 네 계층을 거쳐 올라갑니다. 사실은 여러 세션과 여러 날에 걸쳐 반복될 때만 위로 올라가며, 마지막 단계는 사람이 확인합니다.

기술 내용 (원본 SKILL.md)

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

Agent Memory — promotion is earned, not asserted

Portability: stdlib only. No database, no embeddings, no network, no LLM calls.

The problem

A project's CLAUDE.md is a memory system with one tier and no eviction: every durable fact and every passing preference land in the same always-loaded file, until the important lines are diluted by the incidental ones. Facts learned mid-session vanish at teardown unless someone writes them down.

The fix is not more storage — it is a promotion ladder. A claim earns its way toward always-loaded context by recurring; a human confirms the last step.

The four tiers

Tiers are distinguished by injection policy, not storage format.

Tier Holds Injected Committed
L0 raw session transcripts never no (already on disk)
L1 candidate atoms on relevance, at prompt time no (gitignored)
L2 this project's context every session start yes, after adopt
L3 stable cross-project persona always yes, after adopt

The gates

Nothing moves up because it sounded important. It moves up because it recurred.

  • L0 → L1 — an explicit marker fires (a directive, a correction, a stated preference, a named lesson, a reproducible failure). Rule-based, high precision, deliberately low recall.
  • L1 → L2 — ≥ 3 distinct sessions spanning ≥ 2 distinct calendar days. A claim stated outright needs 2 sessions; the distinct-day rule still applies. A verified claim promotes on one observation and is the only day-exempt path.
  • L2 → L3 — held in ≥ 2 distinct projects, aged ≥ 30 days, uncontested.

Two gates refuse rather than guess. A claim whose text was altered by redaction never promotes on evidence alone — the flag firing is evidence the source was sensitive, and a lexical filter finding one secret is not proof it found all of them. A claim with an open contradiction is frozen at L1 until a human resolves it; the incumbent is never silently overwritten.

Use it

# what is remembered, and what is blocking the next promotion
python3 scripts/memory_inspect.py --tier L1

# where did this line come from — sessions, days, transcript, quoted source
python3 scripts/memory_inspect.py --why "PR base branch is dev"

# every claim with an open contradiction, both directions of the join
python3 scripts/memory_inspect.py --contested

# dry-run the promotion pass; writes nothing
python3 scripts/memory_promote.py

Three hooks run the loop unattended: SessionStart injects L2 + L3, UserPromptSubmit recalls relevant L1 atoms, SessionEnd captures and stages. Each is disabled independently with AGENT_MEMORY_SESSIONSTART=0, AGENT_MEMORY_USERPROMPTSUBMIT=0, AGENT_MEMORY_SESSIONEND=0. Every hook fails open: a broken memory system costs you memory, never a session.

Hard rules

  1. Redact before writing. Every atom passes the filter before it reaches disk. Anything altered is quarantined from promotion.
  2. Propose, never apply. Promotions land in .memory/staged/. Only an explicit /cs-memory adopt touches a CLAUDE.md, and it backs both up first.
  3. Cite, don't invent. Every atom carries a back-pointer to the transcript line that produced it. --why resolving to ambiguous prints nothing rather than guess: a wrong citation is worse than a missing one.
  4. Never surface a contested claim as fact. It is still injected — hiding the conflict is worse — but always tagged.
  5. The committed tiers carry no paths. Promotion strips the back-pointer prefix, which embeds an OS username.

Forcing questions

Walk these one at a time before trusting the store.

  1. Which line in your CLAUDE.md did you last actually read before acting?
  2. Would you rather the agent forget a true thing, or remember a false one?
  3. When two remembered rules disagree, who decides — and when?
  4. What would make you delete .memory/ entirely?

Rationale, open decisions, field schema: ../../DESIGN.md.

More in this skill

Load these only when the task needs them.

자주 묻는 질문

데이터베이스나 AI 호출을 쓰나요?

아닙니다. 이 스킬은 데이터베이스, 임베딩, 네트워크 호출, AI 호출 없이 표준 스크립트만 씁니다.

프로젝트 파일에 넣기 전에 누가 사실을 승인하나요?

사람이 마지막 단계를 adopt 동작으로 확인합니다.

사실은 왜 반복되어야 하나요?

반복은 교훈이 중요하다는 뜻이므로, 우연한 메모가 항상 로드되는 맥락을 어지럽히지 않습니다.

상세 정보

작성자의 원본 설명

Use when an agent keeps relearning the same correction, CLAUDE.md has grown unreadable, or you need to trace where a remembered rule came from. Promotes facts through four tiers only on recurrence across sessions and days, with memory_promote.py and a human adopt step.

repo: alirezarezvani/claude-skills

인기도

GitHub 스타
29k
순위
#9525
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬