skills/memory-clean/SKILL.md
Audit memory directory for structural issues (orphans, dangling refs, duplicates, missing sections, oversized entries) and staleness against session-history transcripts; report-first, fix-on-confirmation. Use when the user says "audit memory", "memory hygiene", or "find stale/duplicate memories".
npx skillsauth add outlinedriven/odin-codex-plugin memory-cleanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit memory for structural rot and staleness, report with evidence, fix only on user confirmation.
Audits and fixes existing memory files. Does not create new memories from session signals (that is memory-update). Does not redact PII or credentials (that is memory-sanitize, which memory-clean will recommend when it detects suspected credentials at critical severity).
Scripts live under this skill's own scripts/ directory. Resolve the skill root from $HOME (the conventional install path is $HOME/.claude/claude/skills/memory-clean/):
SKILL_SCRIPTS="${MEMORY_CLEAN_SKILL_SCRIPTS:-$HOME/.claude/claude/skills/memory-clean/scripts}"
MEMORY_DIR=$("$SKILL_SCRIPTS/resolve-paths.sh" memory_dir)
SESSION_HISTORY_GLOB=$("$SKILL_SCRIPTS/resolve-paths.sh" session_history_glob)
Set MEMORY_CLEAN_SKILL_SCRIPTS to override when the skill is installed outside $HOME/.claude. Abort on non-zero exit from the resolver. Overrides via MEMORY_DIR / SESSION_HISTORY_GLOB env vars.
cp -r "$MEMORY_DIR" /tmp/memory-snapshot-$(date +%s)
Never mutate originals without a snapshot.
./scripts/audit-memory.sh "$MEMORY_DIR" "$SESSION_HISTORY_GLOB" > /tmp/memory-audit-$(date +%s).json
The script emits JSON with these arrays:
| Field | What it detects |
|---|---|
| orphans | Files in dir with no MEMORY.md entry |
| dangling | MEMORY.md entries pointing to missing files |
| near_duplicates | File pairs with >70% content overlap |
| structural | Missing frontmatter, missing Why:/How to apply:, index line > 150 chars, MEMORY.md > 200 lines, type-mismatch, fix-recipe content |
| staleness | Memories whose stated rule conflicts with recent session evidence |
Read references/AUDIT-CHECKLIST.md for full detection rules per category.
CRITICAL (N)
[cred-scan] feedback_no-html-comments.md — suspected credential on line 7
→ Recommend: run memory-sanitize first
WARN (N)
[near-dup] feedback_consistent-config.md ↔ feedback_no-html-comments.md (82% overlap)
[stale] feedback_bump-minor-versions.md — rule contradicted in 4 recent sessions
Evidence: turns uuid-aaa, uuid-bbb, uuid-ccc, uuid-ddd
INFO (N)
[orphan] user_role_data_scientist.md — not in MEMORY.md index
[index-long] project_auth-rewrite.md — index entry is 163 chars (limit 150)
For staleness items, always show the specific turn IDs and a snippet of the contradicting evidence.
Present each fix group with a diff preview. Wait for explicit user confirmation before applying. Never auto-fix.
Edit tool../scripts/audit-memory.sh "$MEMORY_DIR" "$SESSION_HISTORY_GLOB"
Report residual warn/info items; leave them for the user to act on separately if desired.
/tmp/ snapshot.memory-sanitize).testing
ODIN's compress-operations dispatcher under the Compressor/Extender role. Invoke on "tidy", "clean up", "tidy this file/memory/workspace/git/docs", or when active context (current file, diff, stack, memory directory) has structural rot to resolve before touching behavior. Detects target domain from context and routes to the sibling skill. Requires explicit target or clear active-context signal — do not invoke speculatively.
development
Cross-domain taste skill — apply distinctive judgment to any artifact (prose, code, design, decisions) instead of converging to AI defaults. Two modes — `audit` (judge work against the two-sided charter and portable anchors) and `anchor` (load register before producing). Auto-detects by phrasing; override via `/taste audit | anchor`. Trigger on "is this slop?", "overkill?", "elegant?", "taste-test this".
tools
One-shot bootstrap of strict-mode tooling per ecosystem plus per-task GOALS.md scaffolding so an agentic loop can self-verify. Writes typechecker/linter/schema-validator config for TS (strict + noUncheckedIndexedAccess + exactOptionalPropertyTypes), Python (Pyright strict, Ruff strict), Rust (Clippy deny-correctness), Go (golangci-lint with staticcheck), OCaml (dune --release); establishes `.agent-tasks/<id>/GOALS.md` per-task convention distinct from project-stable AGENTS.md. C++/Java/Kotlin and framework specifics (Spring Boot, Nest, React-strict) are out of scope. Trigger on new project bootstrap, agentic-task setup, "make this self-verifying", "set the loop's goal", "scaffold goals for this issue". Pairs with `llm-self-loop` runtime.
tools
Install git pre-commit hooks via the project's hook tool — Husky+lint-staged (JS), pre-commit (Python/OCaml), lefthook (Go), cargo-husky (Rust). Use when the user wants commit-time formatting, linting, type-checking, or test gates. Detects ecosystem first.