
brain — the recorder
io.github.mordechaipotash由 GitHub 账号 mordechaipotash 发布v2.0.0更新于 Oct 24, 2026
Records your Claude Code, Codex and Pi history before deletion. Cited-or-abstain recall.
发布方自己的服务:BrainDog
概览
在 Claude Code、Codex 和 Pi 的会话记录被删除前本地留存,并让助手带可核验引用地检索这些历史。
- 可以做什么
- 检索已记录的 AI 对话历史,返回带引用的命中或明确的“未找到”声明
- 取出引用背后的原始行并用 sha256 校验
- 按时间列出近期活动,并按日期和代理生成会话卡片
- 报告各通道的采集健康状况、代理删除了什么,以及记录机制本身是否在运行
- 把记录归档做可验证的备份,写到归档之外的目标位置
- 适用场景
- 当你希望助手回忆你在过去 Claude Code、Codex 或 Pi 会话中实际写过的内容,并且需要可核对的引用时;也适合在代理自身清理机制删除记录前,保留一份本地副本。
- 运行要求
- 以本地 Python 包(pipx 或 uvx)通过 stdio 运行,支持 macOS 与 Linux,Windows 不在范围内。需要它所监视的代理会话目录、由 BRAIN_HOME 指定的数据目录(默认 ~/.brain),以及首次建索引时下载一次 DuckDB 全文检索扩展。
安装
在 SourceWeft 中
- 打开 控制台中的 brain — the recorder,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
brain-mcp — the recorder for your AI conversations
Your AI history is being deleted right now. Claude Code deletes session files older
than cleanupPeriodDays (default 30) at startup. Run this and see your own cliff edge:
The oldest date you see is where your history ends. brain-mcp records it before it goes —
the whole session, subagent transcripts and saved tool output included, byte-exact,
content-hashed, locally — makes it queryable with citations you can verify with sed and
shasum, tells you what was deleted, and puts it back.
If Claude Code deleted it
restore never overwrites different bytes (identical bytes are a no-op), is all-or-nothing,
and takes --dry-run and --to <dir>. It is a CLI verb only — no MCP tool writes outside
the floor.
Install
Or as a Claude Code plugin (hooks + server in one step):
What it does
- Captures at source. Claude Code via Stop/SessionEnd hooks (line-deltas + a final
snapshot); Codex, Pi, and everything inside a Claude Code session's own folder (subagent
and workflow transcripts,
.meta.json,tool-results/) via a 60-second poll-scan. One spool, one floor. - Keeps the bytes. The floor is
~/.brain/lake/<lane>/<session>.jsonl— append-only, byte-identical to the original, with an append-only sha256 manifest. Nothing is parsed and discarded; the DuckDB index is a cache, fully re-derivable from the lake. - Cites or abstains. Every search hit carries
{file, line span, sha256}— checkable by anyone withsed -n 'A,Bp' file | shasum -a 256, no database required. Zero hits return an explicit abstention naming the lanes and dates actually searched. - Reports health honestly.
fresh= the floor holds everything the agent's files show;stale= the agent has content the recorder missed;unknown= unmeasured, not healthy — never folded into "looks fine". - Backs up verifiably.
brain-mcp backup <dest>syncs lake+manifest and re-hashes sampled files at the destination. The verify can fail; that is the point. - One network fetch, ever, and it is not about you. No telemetry, no cloud, no
accounts, and no HTTP client in this package. The exception: DuckDB downloads its
full-text-search extension (
fts) from DuckDB's own extension repository the first time the index is built, and caches it under~/.duckdb.brain-mcp installdoes that fetch up front and says so;brain-mcp doctorreports whether it is cached.
The 7 MCP tools
🤖 For AI Assistants
You're reading this because your human runs THE RECORDER and gave you access to their AI history. This is the honesty contract.
The one rule: everything you state from these tools is either CITED or ABSTAINED —
there is no third state. A cited claim carries a checkable pointer (file + line span +
sha256); verify it with brain_get(expect_sha256=...) before building on it. An
abstention means "not found above threshold in the lanes and dates the tool measured" —
it does NOT mean "it never happened". Never fill an abstention with your own guess.
- Present recall as their words, dated: "On 2026-08-19 you wrote: '…' (sess-7f2a.jsonl:412)" — never as your own knowledge. One claim, one citation.
verified: falsefrom brain_get means the floor changed since indexing. Say so plainly.- A health response containing any
unknownlane is never "everything looks fine". The honest sentence is: "2 lanes fresh, 1 stale, 1 unmeasured." - "What do I think about X" →
brain_search(query, role="user"). That returns what the PERSON wrote: text the harness injected under the user role (skill bodies, reminders, slash-command wrappers, compaction summaries, Codex context blocks — a quarter to two thirds of "user" rows, measured) is excluded unless you passinclude_machine=True, and subagent transcripts unlessinclude_subagents=True. "How did my thinking evolve" → addorder="time_asc"; bound it withsince/until. The server has no opinion about your human's mind; it has their words, with receipts.
The floor format
Where your agents keep their transcripts: Claude Code ~/.claude/projects/**/*.jsonl
(rolling window!), Codex ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl, Pi
~/.pi/agent/sessions/**/*.jsonl.
Other verbs
v1 → v2
v2 is a rebuild around one principle: capture the bytes first; derive everything else.
v1 parsed conversations into a parquet and discarded the originals — v2's floor makes that
structurally impossible. v1's 25 tools became 7: the synthesis tools ("cognitive patterns",
"switching cost") are gone because a claim that can't carry a line-span citation isn't one
this server makes. Migration: brain-mcp migrate-v1 — v1 rows are kept, marked as derived,
and floor-backed rows win wherever the source still exists.
Windows: out of scope for v2.0. Scheduling is LaunchAgent (macOS) / systemd user timer (Linux).
MIT.
来源:README.md,提交 78d8a4f
工具
0版本历史
2- v2.0.0最新Oct 4, 2026
- v2.0.0b3Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Brain 集成

BrainDog
dog.brain官方发布者
BrainDog 是一个托管记录库,集中保存项目、决策与资金,接入的 AI 代理在开工前读取、结束后写入。

Codebase Brain
由 GitHub 账号 Nomannazir 发布
为本地或公开 git 代码库建立索引,让助手能检索代码、追溯 git 历史、分析改动影响并发现过期文档,结果均带路径与行号引用。

Personal Brain
由 GitHub 账号 zhang-liz 发布
为 AI 助手提供职业人脉记忆,数据以图的形式存放在 FalkorDB 中,可查询联系人、按话题找人并记录你见过的人。

Second Brain
由 GitHub 账号 ara-5 发布
面向AI智能体的共享Graph-RAG记忆:markdown vault、wikilink召回、任务、消息传递。AI 翻译

Make0 Brain
由 GitHub 账号 make0-official 发布
本地离线运行的记忆服务器,让 Claude Code、Cursor、Codex 等 MCP 代理共享一份带版本记录的持久事实库。