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.
npx skills add alexeyshishin/as-skill --skill memory-bank-defraggit clone --depth 1 https://github.com/alexeyshishin/as-skillWrote 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.
[](https://agentmods.dev/skills/alexeyshishin/as-skill/memory-bank-defrag)<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.
<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>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.
| Model | Per session | Once 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 |
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' \ 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:
.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.- Auto-memory — the cross-session memory at
~/.claude/projects/<slugified-cwd>/memory/(anMEMORY.mdindex plus one file per fact). Local only — absent on cloud/headless runs; skip silently if the directory doesn't exist. - 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).
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.
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.
- 11d ago First seen · 260 lines · 143 tokens per session scan A 16a399049e99
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.
Other skills, from other repositories
knowledge-ops
Use when an Obsidian knowledge system needs classification, deduplication, retrieval, synchronization, debt queues, or governed Agent/Wiki promotion.
context-manager
Use when a long-running agent task needs context budgeting, checkpointing, compaction, retrieval, or capability-based model routing.
session-learn
Use when a completed work session should yield durable concepts, corrections, decisions, reusable patterns, and a traceable next action.
session-manager
A fallback skill for recording development sessions and restoring project context from an Obsidian vault, a folder of linked notes. It handles explicit resume, handoff, status, and end-of-session requests when automatic capture is unavailable.
cds-stats
Show project memory statistics: session count, observation counts by type, entity count, top entities, and project planning status.
cds-search
Search past session observations using the sessions.search MCP tool. Falls back to CLI if the MCP server is not available.