memory-clean
Audit memory directory for structural issues (orphans, dangling refs, duplicates, missing sections, oversized entries) and staleness against session-history…
Skill by OutlineDriven
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/outlinedriven-memory-clean
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Shell scripts
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/memory-clean
What's inside
- Skill name
memory-clean- Description
- 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".
- License
- Apache-2.0
- Instructions
- 95 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (6)
- SKILL.md
- AUDIT-CHECKLIST.md · references/
- STALENESS-RULES.md · references/
- audit-memory.sh · scripts/
- encode-memory-path.sh · scripts/
- resolve-paths.sh · scripts/
SKILL.md (first lines)
Audit memory for structural rot and staleness, report with evidence, fix only on user confirmation.
## Scope
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).
## Path resolution
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/`):
```sh
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.
## Workflow
### 1. Resolve paths (above)
### 2. Snapshot before any fix
```sh
cp -r "$MEMORY_DIR" /tmp/memory-snapshot-$(date +%s)
```
Never mutate originals without a snapshot.
### 3. Run structural audit
```sh
./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.
### 4. Render report grouped by severity
```
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.
### 5. Wait for confirmation per group
Present each fix group with a diff preview. Wait for explicit user confirmation before applying. Never auto-fix.
### 6. Apply confirmed fixes
- Orphan: append entry to MEMORY.md.
- Dangling: remove line from MEMORY.md.
- Near-duplicate: present merged draft; write merged file + remove the superseded one; update MEMORY.md.
- Structural: targeted in-place edit via `Edit` tool.
- Stale: present options — update the rule, archive the file, or delete it.
### 7. Re-run audit; confirm zero critical issues
```sh
./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.
## Anti-patterns (never do)
- Auto-fix without user confirmation.
- Mutate originals without the `/tmp/` snapshot.
- Delete a file without showing the user its content first.
- Attempt credential redaction (surface critical flag, recommend `memory-sanitize`).From OutlineDriven/odin-codex-plugin, Apache-2.0.
More from OutlineDriven/odin-codex-plugin
- 0.525score
git-branchless
OutlineDriven
Enforce idiomatic git-branchless during planning and executing tasks — detached-HEAD-first work, in-memory rebase via `git move`, event-log recovery via `git…
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
proof-driven
OutlineDriven
Proof-driven development.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
domain-model
OutlineDriven
Grill against the existing domain model.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
gh-fix-ci
OutlineDriven
Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize the failure, then plan and implement the fix after user approval.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
memory-update
OutlineDriven
Scan agent's session-history transcripts for save-worthy signals (corrections, preferences, decisions, references), propose and write auto-memory files with…
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
memory-sanitize
OutlineDriven
Produce share-safe copies of memory files under /tmp with PII redacted (paths, emails, session IDs, dates) and credentials scanned (tokens, keys); never…
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
cleanup-codebase
OutlineDriven
Reduce concepts, duplication, and ceremony in internal code while touching nearby code.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
design-by-contract
OutlineDriven
Design-by-Contract (DbC) development.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
fix
OutlineDriven
Polymorphic iterative repair loop — accept a verifier failure, structured findings (review/resolve/triage-issue), or a bug description; modify→verify→keep on…
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
design
OutlineDriven
Set visual and interaction direction for any UI surface (web, React, TUI, CLI, desktop, Qt, design-system tokens) before any UI code.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
improve-codebase-architecture
OutlineDriven
Surface deepening refactors that turn shallow modules into deep ones, informed by `CONTEXT.md` and `docs/adr/`.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
setup-gitignore
OutlineDriven
Initialize or idempotently revise the repo's .gitignore by composing gitignore.io templates, AI-tooling/IDE patterns, and confirmed noise from git status.
SkillCFreshness: C★ 14Claude Code +9
Signals
- Stars
- 14
- Forks
- 2
- Open issues
- 2
- Last commit (this folder)
- May 6, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Website
- outlinedriven.github.io
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from OutlineDriven
- 0.525score
design-by-contract
OutlineDriven
Design-by-Contract (DbC) development.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
fix
OutlineDriven
Polymorphic iterative repair loop — accept a verifier failure, structured findings (review/resolve/triage-issue), or a bug description; modify→verify→keep on…
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
cleanup-codebase
OutlineDriven
Reduce concepts, duplication, and ceremony in internal code while touching nearby code.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
design
OutlineDriven
Set visual and interaction direction for any UI surface (web, React, TUI, CLI, desktop, Qt, design-system tokens) before any UI code.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
domain-model
OutlineDriven
Grill against the existing domain model.
SkillCFreshness: C★ 14Claude Code +9 - 0.525score
gh-fix-ci
OutlineDriven
Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize the failure, then plan and implement the fix after user approval.
SkillCFreshness: C★ 14Claude Code +9
Cite this page
memory-clean skill. Agent Mart. https://agentmart.dev/skills/outlinedriven-memory-clean (last updated 2026-10-24)