← Back to Skills Marketplace
casperkwok

memory-doctor

by Casper · GitHub ↗ · v0.1.2 · MIT-0
cross-platform ✓ Security Clean
38
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install memory-doctor
Description
Keep an LLM agent's long-term memory healthy — the cure for context rot. Use when a memory store exists and the user wants to check or tidy it ("记忆体检", "整理记忆...
README (SKILL.md)

memory-doctor — keep agent memory healthy

Memory skills write memory; almost none maintain it. Over time a store grows long, contradicts itself, sprouts dead links, and its index drifts — the agent then burns tokens parsing stale history instead of acting. That is context rot. This skill governs an existing store; it does not produce memory.

Producers write, memory-doctor keeps it alive. Complements memory skills, doesn't replace them. Source & issues: \x3Chttps://github.com/casperkwok/memory-doctor>

When to use

  • A memory store exists (a MEMORY.md + *.md notes, or a *.mneme file) and the user wants to check or clean it: "记忆体检 / 整理记忆 / memory health / cleanup / dedup / fix the index".
  • Memory has clearly grown long, repetitive, or the index no longer matches the files.

How to run (zero deps, Python ≥ 3.9)

# read-only — safe anytime; print the health card first
python scripts/curate.py report --dir \x3Cmemory-dir>

# auto-memory only: preview then apply the index reconciliation (snapshots first)
python scripts/curate.py lint --dir \x3Cmemory-dir>
python scripts/curate.py lint --dir \x3Cmemory-dir> --fix

# revert the last write
python scripts/curate.py undo --dir \x3Cmemory-dir>

The format is auto-detected (*.mneme present → mneme, else auto-memory); override with --format auto-memory|mneme.

What the report checks

  • dead links, stale notes, oversized files, lexical duplicate candidates, and a freshness score (per-type exponential decay).
  • auto-memory: index drift (MEMORY.md vs files) and orphans (no inbound link, unindexed).
  • mneme: history cells (superseded/retired/proposed) excluded from active health, and supersede back-link symmetry; freshness uses each cell's seen date.

What it fixes (v0.1 — deterministic & reversible only)

  • Index reconciliation (auto-memory): add missing MEMORY.md entries, drop dangling ones, preserving your hand-written hooks. A full-directory snapshot is taken first; undo reverts.
  • mneme's spine is derived, so there is no index to reconcile — use report.

Semantic fixes that need a model — true duplicate merge, contradiction reconcile, oversized compaction — are flagged in v0.1 and resolved in v0.2 (no embeddings; manual-apply, snapshot-backed). Never auto-edit memory content on the user's behalf without confirmation.

Safety

Every write snapshots the whole directory to .memory-doctor/snapshots/\x3Cts>/ and logs to .memory-doctor/changelog.md; undo restores it. v0.1 only ever rewrites the index file.

Optional: a read-only health nudge

hooks/health_nudge.py (in the repo) can be wired to a Claude Code SessionStart hook to print a one-line nudge when health drops. It is read-only and never edits anything. Opt-in.

Usage Guidance
Install only if you are comfortable letting it read a chosen memory directory. Run report and lint first, review the dry-run output, and use --fix only when you want MEMORY.md rewritten. Keep your own backup for important memory stores because the bundled snapshot is not a full recursive directory backup.
Capability Assessment
Purpose & Capability
The skill's stated purpose is to report on and tidy an existing agent memory store, and the code matches that purpose: it reads local markdown or mneme memory files, reports health issues, and can reconcile the auto-memory MEMORY.md index.
Instruction Scope
The instructions distinguish read-only report, dry-run lint, explicit lint --fix, and undo. The artifact does not instruct automatic execution or hidden edits, and it says memory content should not be auto-edited without confirmation.
Install Mechanism
The package bundles executable Python scripts with no external dependencies or install-time execution. Metadata does not declare file read/write permissions, but the SKILL.md run commands disclose local file reads and writes.
Credentials
Access is limited by the user-supplied --dir path and is proportionate for memory-store maintenance. The code shows no network calls, credential handling, subprocess execution, or external API use.
Persistence & Privilege
When explicitly run with --fix or undo, the tool writes inside the chosen memory directory by updating MEMORY.md and creating .memory-doctor snapshots/changelog. The docs overstate snapshot scope as whole-directory; implementation snapshots top-level .md files, which is enough for the current MEMORY.md rewrite but should be documented more precisely.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install memory-doctor
  3. After installation, invoke the skill by name or use /memory-doctor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.2
v0.1.2 — rename working dir to .memory-doctor/ and remove residual 'curator' wording (branding consistency). No functional change.
v0.1.1
v0.1.1 — fix repo URL to github.com/casperkwok/memory-doctor (project renamed from memory-curator for consistent branding). No functional change.
v0.1.0
v0.1.0 — first release. Read-only health report + safe, reversible MEMORY.md index reconciliation (snapshot/undo). Two formats auto-detected: Claude Code auto-memory and mneme (.mneme). Zero dependencies, zero LLM. Semantic merge/reconcile/compact flagged now, resolved in v0.2.
Metadata
Slug memory-doctor
Version 0.1.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is memory-doctor?

Keep an LLM agent's long-term memory healthy — the cure for context rot. Use when a memory store exists and the user wants to check or tidy it ("记忆体检", "整理记忆... It is an AI Agent Skill for Claude Code / OpenClaw, with 38 downloads so far.

How do I install memory-doctor?

Run "/install memory-doctor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is memory-doctor free?

Yes, memory-doctor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does memory-doctor support?

memory-doctor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created memory-doctor?

It is built and maintained by Casper (@casperkwok); the current version is v0.1.2.

💬 Comments