
brain — the recorder
io.github.mordechaipotashPublished by GitHub account mordechaipotashv2.0.0Updated Oct 24, 2026
Records your Claude Code, Codex and Pi history before deletion. Cited-or-abstain recall.
The publisher's own server: BrainDog
Overview
Locally records Claude Code, Codex and Pi session transcripts before they are deleted, and lets an assistant search them with verifiable citations.
- What you can do
- Search recorded AI conversation history with cited hits or an explicit abstention
- Fetch the raw lines behind a citation and verify them by sha256
- List recent activity and per-day session cards by agent
- Report capture health per lane, including what agents deleted, and whether the recorder itself is running
- Run a verified backup of the recorded archive to a destination outside it
- When to use it
- Useful when you want an assistant to recall what you actually wrote in past Claude Code, Codex or Pi sessions, with checkable citations, and when you want a local copy of transcripts that the agents' own cleanup would otherwise delete.
- Requirements
- Runs as a local Python package (pipx or uvx) over stdio on macOS or Linux; Windows is out of scope. Needs the agent transcript folders it watches, a data directory set by BRAIN_HOME (default ~/.brain), and a one-time download of DuckDB's full-text-search extension for indexing.
Installation
In SourceWeft
- Open brain — the recorder in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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.
Source: README.md at commit 78d8a4f
Tools
0Version history
2- v2.0.0LatestOct 4, 2026
- v2.0.0b3Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Other Brain integrations

BrainDog
dog.brainOfficial publisher
BrainDog is a hosted record of projects, decisions and money that connected AI agents read before starting work and write their results into.

Codebase Brain
Published by GitHub account Nomannazir
Indexes a local or public git codebase so an assistant can search it, trace git history, check change impact and find stale docs, all with path:line citations.

Personal Brain
Published by GitHub account zhang-liz
Gives an AI assistant memory of your professional network, stored as a graph in FalkorDB, so it can look up contacts, find people by topic, and save who you…

Second Brain
Published by GitHub account ara-5
Shared Graph-RAG memory for AI agents: markdown vault, wikilink recall, tasks, messaging.

Make0 Brain
Published by GitHub account make0-official
Local, offline memory server that gives Claude Code, Cursor, Codex and other MCP agents one shared, versioned store of durable facts.