Git-backed long-term memory for AI coding agents.
brain gives Claude Code, Cursor, Codex, OpenClaw, Hermes, and MCP-capable
tools one shared local memory. Notes are stored as git commits in ~/.brain,
indexed for search, and available through the CLI, TUI, and MCP server.
Homebrew on macOS installs the prebuilt binary:
brew install codejunkie99/tap/brain
brain onboardFrom source:
git clone https://github.com/codejunkie99/brain.git
cd brain
cargo install --path crates/brain-cli
brain onboardbrain onboardOnboarding creates or keeps ~/.brain, lets you choose which agents to wire,
shows the exact files it will write, then asks before saving. It does not
create cloud accounts, install daemons, store API keys, or send memory anywhere.
You can type agent names naturally:
claude code
wire claude code and cursor
codex openclaw hermes
all
none
Scripted setup:
brain onboard --agents all --yes
brain onboard --agents claude-code,cursor,codex --yes
brain onboard --agents openclaw,hermes --yesRefresh managed wiring later:
brain onboard --agents all --yes --reconfigurebrain note "remember that auth uses PKCE"
brain ask "auth"
brain log
brain tuibrain tui opens the terminal dashboard.
When selected during onboarding, brain can write:
| Agent | Files |
|---|---|
| Claude Code | ~/.claude/mcp_servers.json, ~/.claude/CLAUDE.md |
| Cursor | <project>/.cursor/mcp.json, <project>/.cursor/rules/brain.mdc |
| Codex | ~/.codex/config.toml, ~/.codex/AGENTS.md |
| OpenClaw | ~/.openclaw/workspace/BRAIN.md |
| Hermes | <project>/AGENTS.md |
Existing files are not overwritten by default. Managed prompt blocks use
BRAIN:START / BRAIN:END markers so re-runs do not duplicate content.
Sync is explicit:
brain remote add origin <url>
brain push
brain pullbrain doctor
brain doctor --deepUse doctor --deep when search or log output looks inconsistent. It rebuilds
the local SQLite index from git without changing the source-of-truth event log.
By default, memory lives in ~/.brain. Override it with BRAIN_DIR or
--brain-dir <path>.
brain onboard
brain note "any text"
brain ask "word"
brain log
brain tui
brain doctor
brain serve --mcp
brain remote add origin <url>
brain push
brain pullApache-2.0. See LICENSE.