memory-bank-defrag

memory-bank-defrag is a skill for Claude Code from alexeyshishin/as-skill. It costs 143 tokens per session (3,039 once invoked), scanned A, original, MIT.

A maintenance process for a project's knowledge files and automatic notes. It checks what changed in the repository and updates outdated documentation while keeping original records intact.

In plain words
What is it for?
Use it to synchronize project memory with the current code, clean up outdated facts, and update documents such as README files, requirements, and decision records.
Why use it?
It prevents project notes from becoming stale or filling up with layers of corrections that are hard to follow.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

Good fit Use it to synchronize project memory with the current code, clean up outdated facts, and update documents such as README files, requirements, and decision records.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alexeyshishin/as-skill/memory-bank-defrag
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alexeyshishin/as-skill --skill memory-bank-defrag
Clone the repo
git clone --depth 1 https://github.com/alexeyshishin/as-skill

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-bank-defrag

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexeyshishin/as-skill/memory-bank-defrag/github.svg)](https://agentmods.dev/skills/alexeyshishin/as-skill/memory-bank-defrag)
Your own site
<a href="https://agentmods.dev/skills/alexeyshishin/as-skill/memory-bank-defrag"><img src="https://agentmods.dev/badge/skills/alexeyshishin/as-skill/memory-bank-defrag/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for memory-bank-defrag

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexeyshishin/as-skill/memory-bank-defrag"><img src="https://agentmods.dev/badge/skills/alexeyshishin/as-skill/memory-bank-defrag.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 143 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,039 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00143 $0.03039
Opus 5 $0.00072 $0.01520
Sonnet 5 $0.00029 $0.00608
Haiku 4.5 $0.00014 $0.00304

Measured 11d ago against content hash 16a399049e99, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

memory-bank-defrag scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsS -X POST -H 'Content-Type: application/json' \
domains/core/skills/memory-bank-defrag/SKILL.md · 260 lines

How it starts

The opening of the file, as written. The whole thing — 260 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory Bank Defrag

Bring a project's memory bank back in sync with reality and remove cruft. The memory bank is three things:

  1. .assistant/ in the repo — the durable, version-controlled knowledge base (project context, requirements, decisions/ADRs, scope, open questions, stakeholders, glossary). Structure varies per project; operate on whatever files exist, don't assume a fixed layout.
  2. Auto-memory — the cross-session memory at ~/.claude/projects/<slugified-cwd>/memory/ (an MEMORY.md index plus one file per fact). Local only — absent on cloud/headless runs; skip silently if the directory doesn't exist.
  3. Repo current-state docs — files that assert what is true now and drift the same way: README.md, AGENTS.md/CLAUDE.md, design specs, proposals. Update these when a recent commit makes them stale. Do not touch raw source records that capture what happened — meeting transcripts, chat dumps, extracted board content — those are evidence; keep them verbatim (translate only by adding a summary alongside, never by overwriting).

The job is defragmentation, not rewriting: same facts, fewer patches. Amendment-on-amendment trails collapse into one current-state statement; resolved questions get closed; stale facts get corrected against the actual code/docs; new durable facts from recent commits get captured.

Non-negotiables

  • Accuracy > speed. Memory is point-in-time and may be wrong. Before you assert a fact as current, verify it against the live repo (file exists, symbol not renamed, deadline not passed, stack matches code). If a memory claim contradicts current code, trust the code and fix the memory.
  • Fold, don't lose. When collapsing patches, preserve every substantive fact. A reversal that carries decision-relevant context (why we moved off X) stays as a short supersession note — that's history, not a patch.
  • Only substantive facts — no process noise. The memory bank records the project, not your maintenance of it. Do not add "actualized on ", "switched to English", "synced the docs" timeline/history entries, and do not repeat the same standing rule (e.g. "working language is English") across many files — state it once in its authoritative home and link to it. When a sync you just did makes an old "needs updating" caveat stale, delete the caveat; don't leave a trail.
  • Don't invent. No facts, paths, dates, or decisions that aren't in the commits, the code, or the existing memory. Unknown stays unknown.
  • Review before commit. Make the edits, then show the diff and a summary. Do not auto-commit unless the user asks (interactive) or the unattended rules below apply. Auto-memory files live outside the repo and are written directly (not committed).
  • Convert relative dates to absolute (use the current date from context).

Read the full file on GitHub · 260 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 260 lines · 143 tokens per session scan A 16a399049e99

Subscribe to this mod's changes

memory-bank-defrag is a skill published in the GitHub repository alexeyshishin/as-skill (4 stars, last pushed 22d ago), licensed MIT. It adds 143 tokens to every session and 3,039 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.