MCPcopy Index your code
hub / github.com/codejunkie99/brain

github.com/codejunkie99/brain @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
415 symbols 1,322 edges 21 files 88 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

brain

Git-backed long-term memory for AI coding agents.

Rust License MCP

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.

Follow @Av1dlive on X

brain architecture

Install

Homebrew on macOS installs the prebuilt binary:

brew install codejunkie99/tap/brain
brain onboard

From source:

git clone https://github.com/codejunkie99/brain.git
cd brain
cargo install --path crates/brain-cli
brain onboard

First run

brain onboard

Onboarding 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 --yes

Refresh managed wiring later:

brain onboard --agents all --yes --reconfigure

Use it

brain note "remember that auth uses PKCE"
brain ask "auth"
brain log
brain tui

brain tui opens the terminal dashboard.

Agent files

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

Sync is explicit:

brain remote add origin <url>
brain push
brain pull

Troubleshooting

brain doctor
brain doctor --deep

Use 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>.

Commands

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 pull

License

Apache-2.0. See LICENSE.

Core symbols most depended-on inside this repo

push
called by 81
crates/brain-app/src/lib.rs
ingest
called by 40
crates/brain-index/src/ingest.rs
handle_key
called by 38
crates/brain-tui/src/lib.rs
connection
called by 36
crates/brain-index/src/lib.rs
sample_event
called by 36
crates/brain-index/src/ingest.rs
path
called by 32
crates/brain-store/src/repo.rs
observe_summary
called by 29
crates/brain-app/src/lib.rs
append_event
called by 28
crates/brain-store/src/repo.rs

Shape

Function 238
Method 108
Class 39
Enum 30

Languages

Rust100%

Modules by API surface

crates/brain-tui/src/lib.rs63 symbols
crates/brain-cli/src/main.rs62 symbols
crates/brain-index/src/query.rs49 symbols
crates/brain-app/src/lib.rs40 symbols
crates/brain-store/src/repo.rs36 symbols
crates/brain-store/tests/append_event.rs26 symbols
crates/brain-store/src/secrets.rs26 symbols
crates/brain-types/src/payload.rs22 symbols
crates/brain-index/src/ingest.rs22 symbols
crates/brain-index/src/lib.rs15 symbols
crates/brain-types/tests/serde_roundtrip.rs12 symbols
crates/brain-mcp/src/lib.rs11 symbols

For agents

$ claude mcp add brain \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact