memory — скилл для Claude Code: порядок в памяти агента
Скилл задаёт дисциплину ведения памяти узла: что писать, как раскладывать по страницам и когда подчищать. Пригодится, если агент копит историю вместо знаний.
npx skills add plasma-ai/fractal --skill memory -a claude-codeЧто делает memory
Память узла лежит в каталоге $MEMORY_DIR и считается его долговременным хранилищем. Скилл описывает, как её читать при ориентации и как складывать туда находки до конца итерации. Синхронизация тоже может писать в память, когда по радио приходит что-то важное.
Главное правило — писать знание, а не историю. Ни номеров итераций, ни меток времени: читатель не должен догадываться, сколько прогонов уже прошло. Перед COMMIT скилл советует просканировать память и страницы, которые вы продвигаете, и вычистить оттуда номера и метки — при продвижении ваши привычки переезжают на общие поверхности. Организация по темам, а не по времени: обновляйте существующую страницу темы вместо новой записи.
Первая запись задаёт раскладку — по странице на тему (environment, decisions, state, todo, имена можно менять под работу), никакой одной свалки. Страница без desc: во фронтматтере невидима для wiki map, поэтому после добавления или переноса страниц нужен wiki update --path=$MEMORY_DIR. Одна страница текущего состояния, перезаписываемая на месте. Внутривики-ссылки пишутся без префикса: [[state]], а не [[./state]].
Какие задачи решает
- разложить память узла по тематическим страницам вместо одной свалки
- убрать из памяти номера итераций и метки времени
- свернуть страницы завершённой фазы в устойчивые факты
- сделать страницы видимыми для
wiki mapчерезdesc:во фронтматтере - вести список открытых задач вместо журнала выполненных
Примеры запросов агенту
- прочитай
$MEMORY_DIRи скажи, где мы сейчас - сложи находки этой итерации в память и подчисти номера итераций
- прогони
wiki update --path=$MEMORY_DIR, чтобы у новых страниц появился фронтматтер
Как установить memory
1Через Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a claude-code2Вручную: положить файлы
~/.claude/skills/memory/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/memory/
1Через Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a codex2Вручную: положить файлы
.agents/skills/memory/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a cursor2Вручную: положить файлы
.cursor/skills/memory/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install plasma-ai/fractal memory2Вручную: положить файлы
.github/skills/memory/SKILL.md1Через Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a gemini-cli2Командой платформы
gemini skills install https://github.com/plasma-ai/fractal --path fractal/_node/skills/memoryВручную: положить файлы
.devin/skills/memory/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add plasma-ai/fractal --skill memory -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о memory
Как установить memory в Claude?
Выполните npx skills add plasma-ai/fractal --skill memory -a claude-code. Файл скилла окажется по пути ~/.claude/skills/memory/SKILL.md.
Что делает скилл memory?
Описывает, как вести долговременную память узла в $MEMORY_DIR: что туда писать, как раскладывать по темам и когда удалять устаревшее.
Почему страница не появляется в wiki map?
Скорее всего, у неё нет ключа desc: во фронтматтере — близкий по написанию description: не считается. После добавления или переноса страниц запустите wiki update --path=$MEMORY_DIR.
Исходный текст
SKILL.md · Apache-2.0
--- name: memory description: How to maintain node memory well -- the node's persistent knowledge store. --- # Memory Memory (`$MEMORY_DIR`) is the node's durable brain. Read it when you orient and fold findings back before each iteration ends. Sync may also write to memory when crucial information arrives via radio. See the `wiki` skill for how memory relates to the shared project wiki; this doc is the discipline for keeping memory useful. Run `wiki --help` and `wiki <command> --help` for the CLI. ## Conventions - **Write knowledge, not history.** Never reference iteration numbers, timestamps, or chronological markers -- a reader shouldn't be able to tell how many iterations have run. Before COMMIT, scan memory and any page you promote for iteration numbers and run labels and rewrite them out -- promotion carries your habits onto shared surfaces. - **Organize by topic, not time.** Update the existing page for a topic; don't append a new entry. - **Start with a topical layout.** Your FIRST memory write creates the layout -- one page per topic (`environment`, `decisions`, `state`, `todo` -- rename to fit the work; stubs are fine), never a single grab-bag page; when a page starts covering two topics, split it. A leaf expecting to finish within an iteration or two may keep just the `state` page. - **One current-state page.** Keep exactly one present-tense `state` page for where-am-I / what's-next, overwritten in place -- no "prior run" sections; per-iteration narrative belongs in the plan post-mortem, never memory. - **Pages need `desc:` frontmatter.** A page without it (a near-miss key like `description:` counts as without) is invisible to `wiki map`; after adding or moving pages, run `wiki update --path=$MEMORY_DIR` so they gain frontmatter and index entries. Quote a one-line `desc:` that contains `: ` or ` #`. - **Fold at phase ends.** When a phase or a child's run ends, collapse its pages into durable facts and delete the rest -- memory carries what is still true, not what happened. - **No append-only logs.** If you're adding dated entries, stop -- replace outdated content with current understanding. - **Todo lists are living state.** Keep your private working checklist here as current open items, pruned as they complete -- never a done-log. A todo list other nodes should see and track belongs in the project wiki instead. - **Keep indexes lean.** Keep each `_index.md` under ~100 lines below the `***`; factor overflow into child pages. - **Wikilinks stay within one wiki.** Reference anything outside this wiki -- the project wiki, source files, configs -- in plain text or backticks, never as a wikilink; `wiki lint` notes a wikilink that points outside the wiki. Write in-wiki links prefix-free (`[[state]]`, never `[[./state]]` or `[[../state]]`).
© plasma-ai · Apache-2.0 · plasma-ai/fractal