/dstack-knowledge:memory-cleanfrom DStack Knowledge
Audits a durable memory store for stale entries, duplicates, dangling index links, and suspected credentials, with human-gated repairs and rollback.
Ships in DStack Knowledge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Durable memory rots: entries go stale, near-duplicates accumulate, index links dangle, and suspected credentials creep in. This skill audits the memory store, shows the human exactly what it proposes to change, applies only what the human confirms, and proves the result with a fresh audit. Start it only when a human explicitly asks to audit memory or find stale or duplicate memories. Writing new memories belongs to memory-update, not here.
Every repair is human-gated. Preview each target and its consequence, and get explicit confirmation for each repair group before changing data at rest in $MEMORY_DIR, which lives outside version control by default. An override the resolver reports git would track is refused. The only other write is the snapshot copy taken first, and rollback restores the store from that snapshot.
MEMORY_DIR override.SESSION_HISTORY_GLOB for session-based staleness evidence. MEMORY_CLEAN_SKILL_SCRIPTS relocates only the bundled audit-memory.py; it never selects the resolver.Run ../memory-update/scripts/resolve-paths.sh memory_dir and ../memory-update/scripts/resolve-paths.sh session_history_glob. When MEMORY_UPDATE_SKILL_SCRIPTS is set, run $MEMORY_UPDATE_SKILL_SCRIPTS/resolve-paths.sh instead; that variable is memory-update's relocate hook, not a clean-skill hook. Reject resolver errors, control characters, forbidden shell metacharacters, and unsafe whitespace rather than interpreting them. The resolver refuses a memory directory git would track. Move on only when both paths resolve without error; otherwise stop with a blocked diagnostic.
$MEMORY_DIR and nothing else. Do not create new memories, edit another store, redact suspected credentials, or widen the requested scope. This step holds when the boundary is stated and no out-of-scope target is queued.$MEMORY_DIR in /tmp and record its path. This step holds when the snapshot directory exists and its path is recorded, or when the run stops without changing the store.audit-memory.py "$MEMORY_DIR" "$SESSION_HISTORY_GLOB" and preserve its JSON output. The deterministic audit checks index orphans and dangling links, schema and required sections, index size limits, credential patterns, fix-recipe and path-pinned content, relative dates, body-line Jaccard similarity above 0.70, missing reference targets, past project dates without historical-anchor phrases, and feedback rules contradicted by session evidence. This step holds when the JSON report is captured and preserved regardless of exit status.MEMORY.md; remove a dangling index line; merge a near-duplicate pair while naming the superseded file and index update; make a targeted structural edit; or update, archive, or delete a stale memory. Show a file's content before proposing its deletion. For a suspected credential, report the critical finding and make no redaction. Nothing unpreviewed gets queued for repair.$MEMORY_DIR, preserving unrelated content. When an applied repair fails partway, stop further mutation and restore every file that group touched from the snapshot before reporting the failure.blocked with the resolver diagnostic.blocked: MEMORY_DIR is inside version control.blocked with the failed snapshot target.blocked with the diagnostic. Never infer omitted findings.blocked rather than treating absence of evidence as freshness.blocked and identify every potentially changed file.non-converged with the remaining critical findings and residual warnings or information. Do not widen scope or invent a fix.The snapshot path, the resolved audit scope, the severity-grouped JSON findings, per-group previews and confirmation decisions, applied and restored file lists, the fresh re-audit result, residual warnings and information, and exactly one terminal classification: complete, blocked, or non-converged. The complete reading is valid only when the fresh audit contains zero critical findings.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
memory-audit, stale-memory, duplicate-detection, memory-store, rollback
npx claudepluginhub gosuda/dstack-skills --plugin dstack-knowledge8 skills in this plugin
/memory-updateUse when the user explicitly says to save something to memory or scan this session for memories. Not for auditing memory: use memory-clean./mutual-syncUse when the user and agent may hold different pictures of current state after a gap, sync request, or exposed stale claim. Not for persistence: use memory-update./riffrec-feedback-analysisUse when a Riffrec capture or other screen, voice, or notes artifact needs interpretation into bug or requirements evidence. Not for generic recordings without product feedback, and not for capturing durable learning./weekly-reviewUse when asked to summarize authored work over the last week or a named date range, commit range, or branch. Not for source or remote-system changes./workflow-evidence-miningUse when authorized workflow history may contain a repeated process worth extracting and replay-testing. Produces a contradiction-tested workflow mined from authorized history./workflow-from-chatsUse when a user asks to mine recent chats for workflow preferences. Don't use for tasks that require source or remote-system changes.Other plugins' skills for the same job