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

memory-audit · awrshift — скилл для Claude Code: аудит памяти

Проверяет MEMORY.md, находит устаревшие и повторяющиеся записи и готовит план правок. Подходит для переполненного кэша памяти.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add awrshift/agent-memory-kit --skill memory-audit -a claude-code
Открыть на GitHub

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

Скилл читает .claude/memory/MEMORY.md, проверяет knowledge/concepts/*.md, handoff-файлы и связанные правила. Он классифицирует разделы: ищет сессионные блоки, повтор правил, устаревшие записи, скопированные числа и устоявшиеся паттерны, которым место в базе знаний.

Результат сначала оформляется таблицей с действиями, целями и причинами. После явного одобрения скилл переносит материалы, объединяет их с существующими концепциями или удаляет лишнее атомарно, а затем обновляет заголовок и отчёт. До одобрения плана запись файлов не выполняется — это важно, если вы хотите сначала проверить каждое перемещение.

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

  • проверить MEMORY.md после срабатывания лимита
  • найти сессионные блоки и разложить их по темам
  • перенести устоявшиеся паттерны в knowledge/concepts/
  • убрать копии правил и устаревшие записи

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

  • Запусти /memory-kit:memory-audit и подготовь таблицу изменений для MEMORY.md.
  • Проверь память: найди сессионные блоки и кандидатов на перенос в knowledge/concepts/.
  • Почисти память после срабатывания лимита, но сначала дождись моего одобрения плана.

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

1Через Skills CLI (Vercel)

npx skills add awrshift/agent-memory-kit --skill memory-audit -a claude-code

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

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

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

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о memory-audit

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

Выполните npx skills add awrshift/agent-memory-kit --skill memory-audit -a claude-code, затем проверьте файл ~/.claude/skills/memory-audit/SKILL.md.

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

Скилл проверяет MEMORY.md, классифицирует его разделы и создаёт таблицу плана. После одобрения он переносит, объединяет или удаляет записи и обновляет отчёт.

Когда memory-audit начинает работу?

Он продолжает проверку при сработавшем лимите, отмеченном сессионном блоке или найденном устоявшемся паттерне. Если таких условий нет, скилл останавливается.

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

SKILL.md · MIT
---
name: memory-audit
description: Audit MEMORY.md against the memory discipline — oversized sections, settled multi-session patterns that belong in knowledge/concepts/, session-headed chronicle blocks, restated rules, copied numbers, stale entries. Produces a move plan as a table for approval, then executes the approved moves atomically. Use when the SessionStart hook reports a tripped cap or session-headed blocks, when PreCompact blocks on an oversized cache, or when the user says "/memory-kit:memory-audit", "audit memory", "проверь память", "почисти память". Refuses only when no cap is tripped, no session block is flagged AND no settled-pattern candidate exists.
allowed-tools: Read, Grep, Glob, Edit(.claude/memory/**), Edit(knowledge/**)
---

# Memory audit — the surgical one-file pass

This is the **cap-trip response**, not the daily ritual. `/memory-kit:close-session` runs every
session and captures; this runs when the hot cache has actually outgrown itself and something
must LEAVE it. Keeping them separate is the point: a daily ritual that also has to do surgery
becomes a ritual people skip.

**Always pause for approval before writing.** The user talks; you write — including here.

## Inputs

- `.claude/memory/MEMORY.md` — read in full.
- `knowledge/concepts/*.md` — filenames + first 5 lines, for duplicate detection (the directory
  may not exist yet; the first move creates it).
- `context/handoffs/` — to confirm a session narrative already lives there → **drop**, not move.
- The newest `context/audits/memory-audit-deferred-*.md`, if one exists — the candidates the
  previous audit left; start from them.

## Step 1 — classify every section

Scan by `## ` heading (and `###` inside a long section). For each, count lines and mark exactly
one action. Also read the project's `CLAUDE.md`, the `.claude/rules/*.md` without `paths:` and
the plugin's `reference/` titles — you need them for `restates-rule`.

| Mark | When |
|---|---|
| `move (create)` | a settled pattern (confirmed on 3+ distinct dates) with >25 lines of reference detail |
| `move (merge)` | same, but a concept article on the topic already exists |
| `session-block` | the heading names a session or a date, not a topic (`### s66 (2026-09-25)`, `## Session 65 wrap`, `## Findings [date] — …`; the SessionStart hook flags these) → dissolve by topic: each settled lesson → one line under its topic heading or a concept; the rest → drop |
| `drop` | a per-session chronicle — it already lives in a handoff; distil at most one settled line |
| `restates-rule` | the entry says what `CLAUDE.md`, an always-loaded rule or a `reference/` file already says → drop, or one pointer line if the link is not obvious. The agent reads those files every session; a second copy only drifts |
| `point to SSOT` | a derivable number — price, count, version, limit — whose source of truth lives elsewhere (a price table in code, a config, a vendor page) → replace the value with a pointer to that source (`reference/doc-governance.md` R1). A copied number outlives the thing it described |
| `update in-place` | stale: names a deleted file, a closed ticket, a superseded decision |
| `simplify` | true and useful, but three times longer than it needs to be |
| `keep` | earns its lines |

## Step 2 — the move plan (a table, never prose)

| # | Section | Lines | Action | Target | Reason |
|---|---|---|---|---|---|
| 1 | … | N | move / merge / session-block / drop / restates-rule / point to SSOT / simplify / keep | `knowledge/concepts/<slug>.md` or — | … |

Close the table with: estimated line savings, and the projected line/byte count afterwards
against the caps (180 lines / 32 KB / 3000 chars per line). **Target well below the caps — at
most ~60 % of the byte cap (≈ 20 KB).** A cache audited to «just under» refills past the cap
within days: the cap works as a fill line, not a ceiling. If the plan does not reach the target,
say which sections keep it above and why they earn their bytes.

## Step 3 — PAUSE

Print the plan and ask for approval. Wait for an explicit yes or edits. No writes before that.

## Step 4 — execute the approved moves, atomically

- **move (create):** write `knowledge/concepts/<slug>.md` with frontmatter matching
  `knowledge/index.md`'s spec, then add its one-line entry to that index in the same pass.
- **move (merge):** put the fact INTO the body of the article's topic section, with a short date tag
  (`[since YYYY-MM-DD]`); the line it replaces moves to the article's final `## History` section. Never
  append a dated «From MEMORY.md» block at the end — appended blocks turn an article into a log nobody can
  read as current truth. Never duplicate a section that already says the same thing.
- **in MEMORY.md:** replace the moved section with a one-line pointer plus a one-line teaser.
  A move without a pointer orphans the content — that is the failure this audit exists to prevent.
- **drop:** delete; keep at most one distilled line.
- **session-block:** put each surviving lesson under its topic heading (create the topic heading
  if none fits), then delete the session heading and the rest of its block.
- **restates-rule / point to SSOT:** delete the copy; where a reader would not find the source
  unaided, leave one line naming the file (and the symbol or section) that holds it.

## Step 5 — the header, then the report

Replace the MEMORY.md current-state header (≤3 lines, dated). Report before/after line and byte
counts, every file touched, and save declined candidates to
`context/audits/memory-audit-deferred-YYYY-MM-DD.md` (create the dir if absent) so the next audit
starts from them. Not in `context/handoffs/`: the SessionStart hook injects the newest file there
as the session handoff, so a deferred list saved there replaces the real handoff at the next start.

## Refuse when

- No cap is tripped, no session-headed block is flagged AND no settled-pattern candidate exists →
  say "no audit needed" and stop. A SINGLE tripped cap or flagged block is reason enough to
  proceed (one 3000-char line qualifies).
- The user declines the plan → save it to `context/audits/` as above and stop.

## Anti-patterns

- Writing anything before the approval.
- Creating a new concept when a keyword grep matches an existing one — merge bias broken.
- Promoting a session CHRONICLE into a knowledge article. Concepts hold settled patterns;
  narrative belongs to handoffs, and the action for it here is `drop`.
- Stopping at «just under the cap». The next few sessions refill it; aim for the ~60 % target.
- Keeping a rule «as a reminder». If the always-loaded layer already says it, memory repeating
  it is how two versions of one rule start to disagree.
- Burying the plan in prose. The table is what makes it reviewable in ten seconds.

© awrshift · MIT · awrshift/agent-memory-kit

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →

Сначала — memory-audit от других авторов.

memory-audit nhadaututtheky Проверяет качество памяти NeuralMemory по шести измерениям и выдаёт отчёт с оценкой и списком проблем. Пригодится, когда агент путается в старых записях. CX Codex +1 602установок setup-matt-pocock-skills Matt Pocock Скилл настраивает репозиторий для инженерных скиллов Matt Pocock: задаёт трекер задач, метки триажа и расположение доменной документации. Запустите его перед первым использованием остальных скиллов. 1 052 851установок ask-matt Matt Pocock Помогает выбрать подходящий скилл или рабочий поток из набора Matt Pocock. Пригодится, когда непонятно, с чего начать задачу: от идеи до разбора бага. 766 587установок to-tickets Matt Pocock Разбивает план, спецификацию или переписку на небольшие сквозные задачи и отмечает, какие из них блокируют остальные. Пригодится, когда нужно согласовать порядок работы до публикации задач в трекере. 711 230установок writing-plans Jesse Vincent Скилл превращает требования к многошаговой задаче в подробный план реализации до начала работы с кодом. Пригодится, когда исполнителю нужно зафиксировать файлы, интерфейсы и проверки. CX Codex 282 859установок caveman-review JuliusBrussee Пишет замечания к коду одной строкой: место, проблема, исправление. Пригодится, когда ревью диффа или PR надо пройти быстро и без воды. CX Codex +1 411 800установок caveman-compress JuliusBrussee Сжимает CLAUDE.md, списки задач и другие текстовые файлы в краткий формат, сохраняя читаемую резервную копию. CX Codex +1 411 500установок

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

tour Скилл проводит экскурсию по Memory Kit на файлах вашего проекта. Запустите его после настройки или попросите показать, как устроена система. CX Codex +1 ★ 34звёзд репо system-audit Проводит периодическую самопроверку агентской системы с опорой на файлы и команды: что работает, что устарело, что удалить. Пригодится, когда правила и память разрослись. CX Codex +1 ★ 34звёзд репо session-review Скилл запускает разбор завершённой сессии разработки: независимые ревьюеры ищут спорные решения, а агент применяет безопасные правки и фиксирует план по остальным. CX Codex +1 ★ 34звёзд репо second-opinion Скилл запускает независимых ревьюеров, которые проверяют ответ агента до того, как тот попадёт к вам. Пригодится на архитектурных решениях и выборе между вариантами. CX Codex +1 ★ 34звёзд репо document Пишет текст о правке — тело PR, запись в чейнджлог, релиз-ноут или постмортем — и кладёт его в нужный файл. Черновик строится только на выводе git diff и git log. CX Codex +1 ★ 34звёзд репо

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

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