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.00163 | $0.02721 |
| Opus 5.5 | $0.00065 | $0.01088 |
| Sonnet 5.5 | $0.00033 | $0.00544 |
| Haiku 4.5 | $0.00016 | $0.00272 |
Grade A, and why
memory-bank-defrag scanned grade A with 0 findings 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 13d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 231 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 cut it down to current state. The memory bank is three things:
.memory-bank/in the repo — the project encyclopedia thememory-bankskill maintains:index.md,product-overview/,steerings/,tech-details/,tasks/. Operate on whatever files exist; don't create folders the project doesn't use.- Auto-memory — the host's cross-session memory (Claude Code: a
MEMORY.mdindex plus one file per fact). Take its path from the session context; don't guess it. Skip silently if the context names none or the directory doesn't exist (cloud/headless runs, other hosts). - Repo current-state docs — files that assert what is true now:
README.md,AGENTS.md/CLAUDE.md, design specs. Update them only when a change proves a statement stale. Do not touch raw source records that capture what happened — transcripts, chat dumps, extracted content — those are evidence; keep them verbatim.
Every run has two phases:
- Actualize — what changed in the repo since the last defrag → stale facts, dangling references, uncaptured decisions.
- Compact — the whole memory bank, regardless of what changed → same facts, less text.
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.
- Compact the form, never the facts. Every substantive fact survives: what is true now, where it lives, why it was decided (when the reason isn't obvious from the code). Narrative goes: how we got there, step-by-step logs, debugging history, "first we tried X". A reversal that carries decision-relevant context (why we moved off X) stays as one supersession line — that's history, not a patch.
- Don't rephrase for style. Text that already states a current fact tersely stays as is. Edit only to remove something (patch, narrative, duplicate) or fix something (stale, dangling). This keeps a repeat run on an unchanged bank a no-op.
- Only substantive facts — no process noise. The memory bank records the project, not your maintenance of it. Do not add "actualized on " or "synced the docs" entries, and do not repeat the same standing rule across many files — state it once in its authoritative home and link to it. When a sync makes an old "needs updating" caveat stale, delete the caveat.
- Don't invent. No facts, paths, dates, or decisions that aren't in the changes, 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.
- 13d ago Changed · -29 lines · +20 tokens per session 970be8109e32
- 27d ago Changed a4554b4ef056
- 3mo 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 (6 stars, last pushed yesterday), licensed MIT. It adds 163 tokens to every session and 2,721 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
memory-bank-defrag compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| memory-bank-defragalexeyshishin/as-skill | Skill | 6 | yesterday | MIT | A | 163 | Claude Code |
| knowledge-opsMark393295827/third-brain-v7-skills | Skill | 140 | 2mo ago | MIT | A | 33 | Claude Code, Codex |
| context-managerMark393295827/third-brain-v7-skills | Skill | 140 | 2mo ago | MIT | A | 28 | Claude Code, Codex |
| session-learnMark393295827/third-brain-v7-skills | Skill | 140 | 2mo ago | MIT | A | 29 | Claude Code, Codex |
| session-managerEnakoneschniy/claude-dev-stack | Skill | 5 | 2mo ago | MIT | A | 108 | Claude Code |
| cds-statsEnakoneschniy/claude-dev-stack | Skill | 5 | 2mo ago | MIT | A | 29 | Claude Code, Codex |
| cds-searchEnakoneschniy/claude-dev-stack | Skill | 5 | 2mo ago | MIT | A | 27 | Claude Code |