Git-backed shared memory lets AI coding agents keep durable context outside a single chat or process. The brain project implements that pattern with local notes stored as git commits in ~/.brain, search indexing, and CLI/TUI/MCP access, so Claude Code, Cursor, Codex, OpenClaw, Hermes, and other MCP-capable tools can share the same memory without cloud accounts or daemon-heavy infrastructure.
What brain does
brain is a local memory layer for agents that need persistent context across sessions and across tools. The repo describes three core surfaces:
- A CLI for note-taking, lookup, logs, onboarding, and diagnostics
- A TUI for browsing and interacting with the local memory store
- An MCP server so compatible agent tools can read and write the same memory
Notes are stored as git commits in ~/.brain, which makes the event log inspectable and easy to sync. The implementation also builds a local index for search, so memory retrieval is meant to be fast enough for day-to-day use rather than a manual archive.
Why the design matters
The interesting part is not just persistence, but the fact that brain treats memory as shared infrastructure across multiple agent products. That matters in practice because agents are no longer one-off chat experiences: people move between Claude Code, Cursor, Codex, and other tools, and the useful context often lives in the overlap.
This design also avoids a common failure mode in AI tooling: pushing context into a cloud service that is opaque, hard to migrate, and disconnected from the developer's local workflow. Git gives the system a clear source of truth, a reviewable history, and a built-in sync model.
Onboarding and wiring
The onboarding flow is explicit about what it will change before it writes anything. Depending on which agents are selected, brain can manage config files for:
- Claude Code
- Cursor
- Codex
- OpenClaw
- Hermes
That is a practical pattern for agent tooling more broadly: discover the local integration points, show the exact files to be written, and require confirmation before modifying them. The repo emphasizes that it does not create cloud accounts, install daemons, or store API keys.
Relationship to AI workflows
brain sits at the intersection of ai-coding-assistants, ai-agent-infrastructure, and cognitive-debt. It extends AI coding tools with a memory substrate, but it also creates a discipline around what gets remembered and how. Shared memory can reduce repeated explanations and re-entry costs, but it only helps if the stored context stays understandable and reviewable.
The repo's architecture also fits probabilistic-engineering: agent work becomes less about a single deterministic run and more about maintaining a durable, inspectable system of notes, history, and retrieval that can support repeated probabilistic execution.