From rekal-skills
Performs periodic memory maintenance and cleanup for the rekal database, detecting duplicates, conflicts, and stale conversations while requiring user approval for all changes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rekal-skills:rekal-hygieneThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Find and fix problems in the rekal database. Every change requires explicit user approval. Never auto-delete. Never auto-modify.
Find and fix problems in the rekal database. Every change requires explicit user approval. Never auto-delete. Never auto-modify.
memory_health()
Report one line:
"142 memories across 3 projects, spanning 6 months. 4 conflicts detected."
memory_conflicts() # global first
If > 10 conflicts, also run per-project: memory_conflicts(project="<name>")
Per conflict pair, classify and propose:
Conflict type?
├── One outdated, one current
│ └── Propose: memory_supersede(old_id="<outdated>", new_content="<current content>")
│
├── Both valid, different scope (e.g. PostgreSQL for OLTP, ClickHouse for analytics)
│ └── Propose: Keep both. Add project scope if missing.
│
├── Genuine contradiction, unclear which is correct
│ └── Ask user: "Which is correct? [A] or [B]?"
│
└── False positive (not actually contradictory)
└── Propose: Remove contradicts link.
memory_link(from_id="<id_a>", to_id="<id_b>", relation="related_to")
— or memory_delete the link if truly unrelated
Present as numbered list:
- "API uses v2" vs "API migrated to v3" Proposal: Supersede v2 with v3. [approve/reject]
- "Use PostgreSQL" vs "Use ClickHouse for analytics" Proposal: Not a real conflict — different use cases. Remove link. [approve/reject]
memory_topics() # or memory_topics(project="<name>")
For every topic cluster with count >= 3, search for near-duplicates:
memory_search(query="<topic name>", limit=10)
Read results. Group memories covering the same fact/preference/procedure.
Per duplicate group:
Format:
Duplicates (formatting preferences):
mem_abc: "User prefers Ruff" (2024-01)mem_def: "User prefers Ruff over Black for formatting" (2024-03)mem_ghi: "Use Ruff, not Black. Also handles import sorting." (2024-06)Proposal: Keep
mem_ghi(most complete). Supersedemem_abcandmem_definto it.memory_supersede(old_id="mem_abc", new_content="<content from mem_ghi>") memory_supersede(old_id="mem_def", new_content="<content from mem_ghi>")
conversation_stale(days=30)
conversation_threads(limit=20)
Flag conversations with 0 memories as cleanup candidates. Conversations with memories are fine — memories persist regardless.
Conversations are cheap storage. Only flag truly empty ones older than 30 days.
memory_timeline(limit=20)
Skip memories created < 24 hours ago — too fresh to judge.
Per memory, check against these rules:
Quality issue?
├── Content < 20 characters
│ └── Propose: reword with more context, or delete if worthless
│ memory_update(memory_id="<id>", content="<expanded content>")
│
├── Project-specific content but project=None
│ └── Propose: add scope
│ memory_update(memory_id="<id>", project="<correct project>") — NOT SUPPORTED
│ Note: memory_update cannot set project. Propose memory_supersede with project= set.
│
├── Wrong memory_type (e.g. a procedure stored as fact)
│ └── Propose: fix type
│ memory_update(memory_id="<id>", memory_type="<correct type>")
│
├── context-type AND older than 60 days
│ └── Propose: still true? → memory_update to fact. Stale? → memory_delete.
│ Ask user which.
│
└── No issues → skip
Compile ALL proposals from steps 2-5 into one summary:
Hygiene report:
- 4 conflicts: 2 supersede, 1 keep-both, 1 remove-link
- 3 duplicate clusters: 8 memories → 3
- 2 unscoped memories to re-scope
- 1 stale context memory to review
- 0 stale conversations
Approve all? Or review individually?
Wait for explicit approval. Do NOT execute anything until user approves.
After user approves (all or specific items):
memory_supersede for duplicates and outdated conflictsmemory_update for type/tag correctionsmemory_delete only for worthless entries (user explicitly approved)memory_link for relationship correctionsmemory_health() again, report improvement:"Done. 142 → 134 memories. 4 → 0 conflicts. 3 duplicate clusters resolved."
These are hard rules. No exceptions.
/rekal-save stores.Do NOT audit everything in one pass. Prioritize in this order:
After completing priority items, ask:
"Covered conflicts and top duplicate clusters. Want me to continue with a deeper audit?"
npx claudepluginhub janbjorge/rekal --plugin rekal-skillsAudits Pensyve memories for staleness (>30 days unaccessed or low retrievability), contradictions, low confidence (<0.5), and consolidation candidates, then offers confirmed cleanup actions. Use periodically.
Audits and selectively forgets stored Claude Code memories. Use when memory is large/uncurated, project state has shifted, or retrieval quality degraded.
Manages total-recall memory system: search, store, forget memories, inspect tiers, run eval, and configure. Automatically activates on memory-related queries.