/install memory-doctor
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+*.mdnotes, or a*.mnemefile) 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
seendate.
What it fixes (v0.1 — deterministic & reversible only)
- Index reconciliation (auto-memory): add missing
MEMORY.mdentries, drop dangling ones, preserving your hand-written hooks. A full-directory snapshot is taken first;undoreverts. - 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.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install memory-doctor - 安装完成后,直接呼叫该 Skill 的名称或使用
/memory-doctor触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
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 ("记忆体检", "整理记忆... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 38 次。
如何安装 memory-doctor?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install memory-doctor」即可一键安装,无需额外配置。
memory-doctor 是免费的吗?
是的,memory-doctor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
memory-doctor 支持哪些平台?
memory-doctor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 memory-doctor?
由 Casper(@casperkwok)开发并维护,当前版本 v0.1.2。