claude-code-config: Skill for Claude Code

.claude/skills/memory-clean/SKILL.md

memory-clean is a skill for Claude Code from auerbachb/claude-code-config. It costs 109 tokens per session (1,633 once invoked), scanned A, original, MIT.

A checker for a project's durable memory files, which store notes that can survive between sessions. It reports orphaned files, broken index links, oversized indexes, and possible duplicates or outdated entries.

In plain words
What is it for?
Use it to audit memory, review pruning suggestions, and—after approval—remove chosen files and verify the index.
Why use it?
It helps keep saved project context useful and within its context budget. It only removes selected files after explicit confirmation.

Skill for Claude Code

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

This is auerbachb/claude-code-config's own configuration. It tells Claude Code how to work on claude-code-config itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-code-config configures →

Reuse

Borrowing it

Nothing to install: this file belongs to auerbachb/claude-code-config. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/auerbachb/claude-code-config/main/.claude/skills/memory-clean/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/auerbachb/claude-code-config

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-clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/auerbachb/claude-code-config/memory-clean/github.svg)](https://agentmods.dev/skills/auerbachb/claude-code-config/memory-clean)
Your own site
<a href="https://agentmods.dev/skills/auerbachb/claude-code-config/memory-clean"><img src="https://agentmods.dev/badge/skills/auerbachb/claude-code-config/memory-clean/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-clean

Your own site · 80×15
<a href="https://agentmods.dev/skills/auerbachb/claude-code-config/memory-clean"><img src="https://agentmods.dev/badge/skills/auerbachb/claude-code-config/memory-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,633 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00109 $0.01633
Opus 5.5 $0.00044 $0.00653
Sonnet 5.5 $0.00022 $0.00327
Haiku 4.5 $0.00011 $0.00163

Measured 2mo ago against content hash e0d2165e6fb0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

memory-clean 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 2mo 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.

.claude/skills/memory-clean/SKILL.md · 116 lines

How it starts

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

Audit this project's durable memory store and present prune recommendations. Same discipline as /pm-clean: evidence for every recommendation, conservative on "stale," and nothing is removed without an explicit yes. All detection and mutation lives in the shared, tested script .claude/scripts/memory-audit.py — this file is the recommend-then-confirm layer.

Step 0: Locate the audit script

Prefer the global install; fall back to the in-repo copy when developing the skill itself.

SCRIPT=""
for candidate in \
  "$HOME/.claude/skills-worktree/.claude/scripts/memory-audit.py" \
  "$HOME/.claude/scripts/memory-audit.py" \
  ".claude/scripts/memory-audit.py"; do
  if [[ -f "$candidate" ]]; then SCRIPT="$candidate"; break; fi
done
if [[ -z "$SCRIPT" ]]; then
  echo "ERROR: memory-audit.py not found (checked ~/.claude/scripts/, skills-worktree, in-repo)" >&2
  exit 1
fi

Parse $ARGUMENTS: pass through an explicit --dir PATH (for a non-current project or a relocated store) and translate --budget-kb N to --budget-bytes $((N*1024)). With no arguments the script auto-detects the current project's memory dir — the ROOT project, not the worktree, since memory is pinned to the root project across worktree sessions.

Step 1: Scan (read-only)

python3 "$SCRIPT" --check --json [--dir PATH] [--budget-bytes N]

Exit 0 = scanned (a clean store is a valid result). Exit 3 = memory dir not found — tell the user and offer to re-run with --dir PATH. The JSON has memory_dir, index (bytes, entry_count, file_count, budget_bytes, over_budget), orphans, dangling, and advisory (duplicate_names, superseded). Read memory_dir back to the user so they know exactly which store is in scope.

Step 2: Present recommendations

Group findings into scannable sections. Omit any empty section. If nothing is flagged and the index is under budget, report "Memory store is clean — {entry_count} entries, {bytes} bytes, nothing to prune." and stop.

Read the full file on GitHub · 116 lines

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. 2mo ago First seen · 116 lines · 109 tokens per session scan A e0d2165e6fb0

Subscribe to this mod's changes

memory-clean is a skill published in the GitHub repository auerbachb/claude-code-config (5 stars, last pushed 2d ago), licensed MIT. It adds 109 tokens to every session and 1,633 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

PlanGate 決定論的 GC 判定

A rule-based checker that decides whether stored files, logs, and other review records should be kept or removed. It applies retention limits and safety exceptions to a supplied file list.

s977043/river-review · 49 tokens

Closure Scope Retention Guard

Detects long-lived objects (caches, listeners, singletons) that capture an entire enclosing scope via closures/environment capture, keeping large arrays or buffers alive, and proposes copying only the needed fields.

s977043/river-review · 46 tokens

codex-context-keeper

Prepare or read explicit reviewed evidence-preserving context packs for Codex handoffs. Use when asked to preserve exact evidence across compaction or when a Context Keeper hook points to a staged snapshot. Never scan raw transcripts.

rhein1/fable5-codex · 49 tokens

memory-to-skill

Turn workflows from your MemSearch memory into reusable skills. Use when the user asks to make/create/extract/distill a skill from what they just did or from past work, review skill candidates, install a distilled skill, or 'turn this into a skill'. Manages MemSearch procedural-memory candidates under…

zilliztech/memsearch · 82 tokens

mindos

MindOS: local knowledge assistant & shared KB. Keeps decisions, notes, SOPs, debugging lessons, research findings, preferences across sessions/agents. Core: save notes, search KB, organize files, run workflows, review, append CSV, hand off context, distill lessons. NOT for app source or paths outside KB. Triggers…

GeminiLight/MindOS · 136 tokens

referee

Final arbiter for Bug Hunter. Independently verifies behavioral findings, resolves Skeptic challenges, and calibrates severity and confidence.

codexstar69/bug-hunter · 28 tokens