Inspect, trace, and adopt the tiered agent-memory store (status | why | contested | adopt | forget)
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-claude-skills-42ef215af88a ,按照其中的说明把「cs-memory」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Argument: $ARGUMENTS (default: status)
Scripts live at
engineering/agent-memory/skills/agent-memory/scripts/. All are stdlib-only and
read-only except where stated.
status (default)memory_inspect.py --tier L3, --tier L2, --tier L1..memory/staged/promotions.json if it exists..memory/errors.log if it exists — surface any
entry. That file is where silently dropped writes are recorded, and a log
nobody is pointed at is the same as no log.Report, in this order: what is always loaded (L3), what this project loads (L2), how many candidates are waiting and what is blocking each, what is staged for adoption, and any dropped writes.
Do not adopt anything here. status is read-only.
why "<claim>"Run memory_inspect.py --why "<claim>".
Report the full provenance: observation count, distinct sessions, distinct calendar days, first and latest transcript back-pointers, whether each resolves, and the quoted source line when exactly one transcript matched.
If the resolution status is ambiguous, say so plainly and print no source
line. Two projects can hold a transcript of the same basename; guessing attaches
a real claim to the wrong session, and a wrong citation is worse than none.
contestedRun memory_inspect.py --contested.
For each pair, present both claims with their dates and sources side by side and ask the user which governs. Do not pick. Do not merge them. Do not mark one resolved on your own judgement — resolution is a human decision by design.
adoptThe only command in this file that writes. Six steps, in order, no skipping:
memory_promote.py --stage to refresh .memory/staged/promotions.json.CLAUDE.md files (project and global) with a timestamped
copy. Do this before writing anything, every time.redacted: true — no amount of evidence
substitutes for the human reading the original. Explain why and move on.CLAUDE.md under a clearly marked
<!-- agent-memory: adopted --> section, and log each to .memory/adopted.log.Never write to a CLAUDE.md outside this flow. Never batch-accept.
forget "<claim>"memory_inspect.py --why "<claim>".CLAUDE.md..memory/atoms.jsonl and, if it was adopted,
remove the corresponding line from the CLAUDE.md — after backing that file
up.Removing an atom does not prevent re-learning. If the marker fires again in a future session, it returns. That is correct: forgetting is not a permanent veto, and saying so avoids a confusing surprise later. To stop it returning, change the underlying fact or state the correction — a correction is itself a high-confidence observation.
.memory/ directory yet → say so. It is created on the first session end
with the hooks installed; nothing is wrong.DESIGN.md, not per-claim. Offer to record the
case as evidence the threshold is wrong.engineering/memory-engineering. This skill is a memory system; that one
audits any of them, this one included.