К основному содержанию
скилл Claude Code

memory-engineering — скилл для Claude Code: память и установка

Скилл помогает спроектировать и проверить память агента, посчитать цену записи и ввести правило забывания. Пригодится для аудита CLAUDE.md и memory store.

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add alirezarezvani/claude-skills
/plugin install memory-engineering@claude-code-skills
Открыть на GitHub

Что делает memory-engineering

memory-engineering разбирает системы памяти агента: long-context, RAG, graph и agentic memory. Он разделяет стоимость построения памяти и запросов, считает стоимость правильного ответа, классифицирует записи как FACT, SKILL, LOG или PROSE и проверяет, что из хранилища будет удаляться. Скилл также выявляет дубликаты, устаревшие записи и противоречия.

Внутри четыре скрипта на стандартной библиотеке Python: memory_cost_profiler.py, memory_architecture_picker.py, memory_density_auditor.py и forgetting_policy_linter.py. Они работают без API, вызовов LLM и сети. Линтер блокирует дизайн без явного правила забывания и не разрешает автоматически сливать противоречащие записи. Для установки нужен Claude Code и репозиторий alirezarezvani/claude-skills.

Ставьте скилл, если проекту нужно принять решение о памяти агента или проверить уже растущее хранилище. Для простого хранения истории он избыточен.

Какие задачи решает

  • выбрать архитектуру памяти агента
  • посчитать стоимость записи и запросов
  • разобрать содержимое каталога памяти
  • найти устаревшие записи и дубликаты
  • проверить правило забывания и обработку противоречий

Примеры запросов агенту

  • Спроектируй память агента и сравни long-context, RAG, graph и agentic memory.
  • Запусти аудит каталога `~/.claude/memory` и покажи долю FACT, SKILL, LOG и PROSE.
  • Проверь `design.json` через `forgetting_policy_linter.py` и объясни блокирующие результаты.

Как установить memory-engineering

1Через маркетплейс плагинов

/plugin marketplace add alirezarezvani/claude-skills
/plugin install memory-engineering@claude-code-skills

Команда ставит плагин memory-engineering целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

npx skills add alirezarezvani/claude-skills --skill memory-engineering -a claude-code

3Вручную: положить файлы

~/.claude/skills/memory-engineering/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/memory-engineering/

Из того же набора349

Весь набор →
engineering-skills Alireza Rezvani Каталог инженерных скиллов для Claude Code: помогает выбрать роль под задачу и загрузить только нужный SKILL.md. Подходит для архитектуры, тестов, DevOps и работы с данными. Claude Code 2 387установок finance-skills Alireza Rezvani Маршрутизирует финансовые запросы между тремя скиллами бандла: financial-analyst, saas-metrics-coach и month-end-close. Claude Code 2 312установок marketing-skills Alireza Rezvani Каталог и роутер для маркетинговых скиллов в Claude Code. Помогает выбрать нужный скилл для SEO, контента, CRO, каналов и других задач. Claude Code 2 264установок business-growth-skills Alireza Rezvani Маршрутизирует запросы по продажам и клиентскому сервису между четырьмя специализированными скиллами плагина в Claude Code. Claude Code 2 189установок engineering-advanced-skills Alireza Rezvani Индекс из 37 инженерных скиллов для архитектуры, автоматизации, надёжности и платформенных задач. Пригодится, когда проекту нужны отдельные рабочие сценарии. Claude Code 2 019установок product-skills Alireza Rezvani Оркестратор продуктовой работы для Claude Code. Маршрутизирует задачи между 16 направлениями и проверяет дерево возможностей скриптами. Claude Code 1 994установок pm-skills Alireza Rezvani Оркестрирует проектную работу через 8 PM-скиллов: Jira, Confluence, спринты, отчёты и коммуникации. Подходит для маршрутизации запросов и контроля delivery-цикла. Claude Code 1 975установок senior-backend Alireza Rezvani Скилл помогает проектировать архитектуру бэкенда, настраивать REST API и оптимизировать базы данных. Пригодится при создании роутов, ревью кода и нагрузочном тестировании. Claude Code 1 674установок

Похожие

skill-creator официальный anthropics Помогает создать новый скилл, доработать существующий и проверить результат через тестовые промпты и оценки. Claude Code Claude.ai 414 180установок writing-for-agents Matt Pocock Помогает писать скиллы и документы с инструкциями для агентов. Пригодится при правках AGENTS.md, CLAUDE.md и связанных справочных файлов. Claude Code 466 719установок media-use heygen-com Находит и генерирует ассеты для видео в HyperFrames — музыку, дикторский голос, аватары и эффекты. Сохраняет всё локально в assets. Claude Code CX Codex Cursor +1 1 100 000установок mcp-builder официальный anthropics Скилл проводит через создание MCP-сервера на TypeScript или Python: от изучения протокола до тестов и оценки качества. Claude Code Claude.ai 130 949установок subagent-driven-development Jesse Vincent Скилл выполняет план через отдельных субагентов для каждой задачи и проверяет результат после каждого шага. Подходит для независимых задач в одной сессии. Claude Code CX Codex 237 746установок orchestration stablyai Координирует воркеров Orca через DAG задач, циклы супервизора и цепочки сообщений. Пригодится для распределения сложной работы между агентами. Claude Code CX Codex Cursor +1 349 200установок

Вопросы о memory-engineering

Как установить memory-engineering в Claude Code?

В Claude Code выполните /plugin marketplace add alirezarezvani/claude-skills, затем /plugin install memory-engineering@claude-code-skills. Скилл также доступен через npx skills add alirezarezvani/claude-skills --skill memory-engineering -a claude-code.

Что делает memory-engineering?

Скилл оценивает стоимость памяти агента, выбирает архитектурный вариант, проверяет состав хранилища и требует явную политику забывания. Противоречия он оставляет для решения человеком.

Что нужно для работы memory-engineering?

Скилл использует четыре скрипта на стандартной библиотеке Python и работает без API, вызовов LLM и сети. Для проверки политики нужен файл вроде design.json.

Исходный текст

SKILL.md · MIT
---
name: memory-engineering
description: Use when designing, reviewing, or paying for an agent memory system — adding memory to an agent, choosing between long-context / RAG / graph / agentic memory, auditing what a CLAUDE.md or memory directory actually holds, deciding what to keep and what to expire, or when a memory store keeps growing and nobody has said what leaves it. Prices the write path, picks which cost to pay, classifies records as facts / skills / logs, and refuses a design that has no forgetting policy.
argument-hint: "[optional: path to a memory dir, design spec JSON, or a question]"
license: MIT
metadata:
  version: 1.0.0
  build_pattern: "Four-lens synthesis (Stanford / Microsoft / Anthropic / Nvidia) + 4 deterministic stdlib scripts, with a blocking forgetting gate"
  distinct_from: "llm-wiki (maintains one specific markdown vault; this audits and prices any memory system); skillopt-sleep (runs a nightly consolidation loop; this decides whether that loop's output is worth keeping); agent-harness (bounds a task loop; this bounds a store)"
---

# Memory Engineering — engineer the forgetting, not just the remembering

> **Portability:** 4 stdlib scripts, no APIs/LLM calls/network. They measure and gate; you decide.

## What this does

Anyone can give an agent memory: vector store, pipe in the history, retrieve
top-k. That works until the history outgrows the context window, the write path
costs more than every query it serves, and the store fills with stale state
nobody removes. Memory is not a bucket — it is a system with a metabolism.

**The shift:** a storer optimizes what a system remembers; a memory engineer
optimizes what it forgets. The problem was never that an agent forgets — it is
that it never forgets *on purpose*.

## The four lenses

| Lens | Question | The finding that hurts |
|---|---|---|
| **Stanford** | What does remembering cost? | Construction energy exceeds total query energy across 300 queries. The tuned half is the smaller half. |
| **Microsoft** | What is worth keeping? | More raw memory can make an agent *worse*. Keep facts and skills; drop the events. |
| **Anthropic** | Who controls what it keeps? | A wrong memory does not fail once — it persists into every future session that reads it. |
| **Nvidia** | Where does it hit hardware? | It is all KV cache in HBM. Construction is prefill-heavy and stalls the query a user is waiting on. |

## Workflow

```bash
# 1 - Price it first. Never quote a quality number without a cost number.
python scripts/memory_cost_profiler.py --print-sample-spec > workload.json
python scripts/memory_cost_profiler.py --spec workload.json
# 2 - Pick which cost to pay. No "best" verdict; on a tie it asks, exit 2.
python scripts/memory_architecture_picker.py --constraints workload.json
# 3 - Audit what the store actually holds (skip if greenfield).
python scripts/memory_density_auditor.py --dir ~/.claude/memory
# 4 - Gate on forgetting. Exit 4 is a stop, not a suggestion.
python scripts/forgetting_policy_linter.py --policy design.json
# 5 - No command. Prove each pass by hand before scheduling it.
```

Step 1 reports the construction/query split, **cost per correct answer**, and
amortization — if construction dominates, cut construction tokens *before*
touching retrieval. Step 2 names the cost the winning family makes you pay.
Step 3 classifies records FACT / SKILL / LOG / PROSE (`LOG-HEAVY` = archiving
events; `PROSE-HEAVY` = docs, not memory).

Step 4 is the gate: **F1** (explicit forgetting rule) and **F4** (contradictions
surfaced, never auto-merged) are blocking. Retrofitting forgetting onto two
years of records is a migration nobody does; auto-merging disagreeing memories
destroys the evidence the conflict existed.

Step 5 has no script — prove each pass by hand, then automate. Run it once
against real history and ask whether it changed a decision. If not, scheduling
it only makes noise. Ship order: `forgetting_policy_design.md` §7.

## Hard rules

1. **Never quote accuracy without cost per correct answer.**
2. **Never return a "best" memory system** — name the cost the choice makes you pay.
3. **Never auto-merge contradictions.** The system surfaces; the human decides.
4. **Never call a design done without a forgetting rule.** No evaluated system provides one by default.
5. **Never schedule a pass not yet run by hand.**
6. **Report findings as findings.** A non-zero exit is a result to surface, not an error to swallow.
7. **Attribute every number** with its confidence level. Vendor customer figures are testimonials, not benchmarks.

## Scripts

| Script | Role | Exit codes |
|---|---|---|
| `scripts/memory_cost_profiler.py` | Construction vs query split, cost per correct answer, amortization, co-location warning | 0 · 2 finding · 3 bad input |
| `scripts/memory_architecture_picker.py` | Scores 4 families, disqualifies, names the cost, refuses to pick on a tie | 0 · 2 ambiguous · 3 bad input · 4 none viable |
| `scripts/memory_density_auditor.py` | FACT/SKILL/LOG/PROSE, duplicates, staleness, density (`--dir` or `--jsonl`) | 0 dense · 2 finding · 3 bad input |
| `scripts/forgetting_policy_linter.py` | The gate: 8 checks, F1 and F4 blocking | 0 PASS · 2 CONDITIONAL · 4 FAIL |

All support `--output json` and `--sample` (no input file needed).

## References and assets

- [`references/memory_cost_canon.md`](references/memory_cost_canon.md) — construction dominance, energy per correct answer, the four families, ten recommendations (7 sources)
- [`references/what_to_keep.md`](references/what_to_keep.md) — PlugMem and MEMENTO: facts over logs, density over volume (7 sources)
- [`references/memory_control_and_governance.md`](references/memory_control_and_governance.md) — memory as files, scope/audit/rollback, poisoning, reading vendor numbers (7 sources)
- [`references/forgetting_policy_design.md`](references/forgetting_policy_design.md) — forgetting mechanisms, contradiction discipline, KV cache, ship order (7 sources)
- [`assets/memory_engineer_worksheet.md`](assets/memory_engineer_worksheet.md) — seven forcing questions with recommended answers + citations; walk one at a time
- [`assets/memory_design_spec.example.json`](assets/memory_design_spec.example.json) — one file covering every script's input
- [`assets/forgetting_policy_template.md`](assets/forgetting_policy_template.md) — fillable policy covering F1–F8

## Provenance

Framing from *"How to be a Memory Engineer"* by [@N01ennn](https://x.com/N01ennn/status/2083971749079581120); every
number is cited to a primary source instead, and two paraphrases are corrected — `memory_cost_canon.md` §2, `memory_control_and_governance.md` §4.

© Alireza Rezvani · MIT · alirezarezvani/claude-skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой