Old-Friends-Gathering

Strata — Development skill for Claude Code

Development community

本地跨会话「自我迭代」记忆系统:DSH / Codex CLI / Claude Code 共用一份记忆,重点治冗余·重复·冲突·过时(MCP + append-only 真相层 + Agent 裁决闭环).

How to install Strata

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Old-Friends-Gathering/strata and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Strata does

本地跨会话「自我迭代」记忆系统:DSH / Codex CLI / Claude Code 共用一份记忆,重点治冗余·重复·冲突·过时(MCP + append-only 真相层 + Agent 裁决闭环).

Alternatives in Development

  • MCP Edit — tilth_write replaces the host Edit and Write tools 349 ★
  • Log Mistake — Append a one-line entry to the Mistakes Log (symptom · correction · codified) 168 ★
  • Dsh MCP — dsh as mcp, make your claude code or codex etc. faster, more powerful and more economic 118 ★

README

strata

**跨会话、跨客户端的本地记忆层:把"记忆"当数据库治理,而不是当 prompt 攒。**

[![ci](https://github.com/Old-Friends-Gathering/strata/actions/workflows/ci.yml/badge.svg)](https://github.com/Old-Friends-Gathering/strata/actions/workflows/ci.yml) [![quality](https://github.com/Old-Friends-Gathering/strata/actions/workflows/quality.yml/badge.svg)](https://github.com/Old-Friends-Gathering/strata/actions/workflows/quality.yml) [![security](https://github.com/Old-Friends-Gathering/strata/actions/workflows/security.yml/badge.svg)](https://github.com/Old-Friends-Gathering/strata/actions/workflows/security.yml) [![issue-link](https://github.com/Old-Friends-Gathering/strata/actions/workflows/issue-link.yml/badge.svg)](https://github.com/Old-Friends-Gathering/strata/actions/workflows/issue-link.yml) [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

DSH / Codex CLI / Claude Code 三端共用一份本地记忆。重点不是"检索得准",而是**治理得住**: 去重、冲突失效、过期不删只失效、投毒不进上下文、库自己会随使用收敛。


为什么叫 strata

记忆像地层(strata)一样**沉积**,而不是被反复改写覆盖:

地层 对应实现 规则
沉积层(真相层) $MEMO_HOME/items/.jsonl 只追加,任何"改过去"都是追加一条新版本;永不删除物理行
派生层(索引/摘要) 倒排索引、brief 渲染 随时可从真相层重建;坏了不丢数据
失效标记(不整合) superseded / tombstoned + bi-temporal 时间戳 过时的事实失效而非删除,asOf 可回看任意时点
风化层(维护) nightly 整合、配额淘汰、去重候选扫描 慢速、可离线、可重放;由 Agent 当裁判而不是纯算法

所以名字不是"又一个 memory 插件",而是一个**可回溯、可重建、可收敛**的沉积结构。 产品名是 `strata`;技术标识为了向后兼容保持不变:CLI 仍是 `memo`、环境变量仍是 `MEMO_*`、 MCP 工具名仍是 `memory_*`、`serverName` 仍是 `memo`(改这些要同步三端客户端配置与历史分库目录,v0.2 再做带兼容期的重命名)。

它解决什么

常见做法的问题 strata 的做法
记忆越攒越多,重复/矛盾条目一起进上下文 写入门控(hash 短路 → 同 slot 判等 → 近重复 noop)+ 冲突 slot 失效
换措辞的同一条事实被判成"冲突" 在线只做零误杀去重;语义判断交给正在运行的 Agent(dedupe_scan → curate_apply),零 API 成本、可离线
只有"删掉"这一种清理手段 真相层不可变;过时=打 validTo 失效,删除=墓碑 + 延迟物理清理
记忆里被塞进指令型内容,悄悄影响后续会话 写入打标 + 读路径默认遮蔽([suspicious withheld])+ brief 逐行复检;10 种投毒变体实测 0 泄露
换个客户端就"失忆" MCP 是唯一缝:DSH / Codex / Claude 同读写一份真相层;memory_scope 解决常驻进程 cwd 固