← 返回
未分类

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 ("记忆体检", "整理记忆...
保持 LLM 代理长期记忆健康,根治上下文腐烂。当存在记忆库且用户想检查或整理时使用("记忆体检"、"整理记忆")
casperkwok casperkwok 来源
未分类 clawhub v0.1.2 1 版本 100000 Key: 无需
★ 0
Stars
📥 73
下载
💾 1
安装
1
版本
#agent-memory#claude-code#context-rot#health#latest#maintenance#memory#mneme

概述

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:

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 <memory-dir>

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

# revert the last write
python scripts/curate.py undo --dir <memory-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// 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.

版本历史

共 1 个版本

  • v0.1.2 当前
    2026-06-09 19:09

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,129 📥 889,474
content-creation

Toonany

casperkwok
用于从小说和故事生成AI短剧(漫剧)的Claude Code技能,适用于用户提到“漫剧创作”“小说转剧本”“分镜生成”“短剧制作”“故事线生成”“大纲”等关键词时使用。
★ 1 📥 506
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 850 📥 330,120