
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 代理共用一份具版本紀錄的長期事實庫。