Installation
There are two ways to give an agent a brain:
- The hosted MCP connector — the universal path. One streamable-HTTP + OAuth
endpoint (
https://mcp.brainmemory.ai/mcp) reaches every supported host, including the Claude.ai and ChatGPT apps. Nothing to install locally. - The local-first native plugin — free, stores everything in
~/.brain/on your machine, and wires slash commands and prompt sections into the agent's own config.
Most people start with the connector; reach for the native plugin when you want a fully local, no-account brain.
The hosted MCP connector (universal)
The connector is a remote MCP server
(https://mcp.brainmemory.ai/mcp, streamable-HTTP + OAuth). A single connector
reaches Claude Code, OpenAI Codex CLI, OpenCode, GitHub Copilot CLI, Kilo, the
Claude.ai apps, ChatGPT (paid plans + Developer Mode), and Google Antigravity /
Gemini Enterprise. Point each host at the URL:
# Claude Code
claude mcp add --transport http brain https://mcp.brainmemory.ai/mcp
# OpenAI Codex CLI
codex mcp add brain --url https://mcp.brainmemory.ai/mcp- OpenCode — add a remote MCP server in
opencode.json(mcp→ remoteurl:https://mcp.brainmemory.ai/mcp). - GitHub Copilot CLI — add to
~/.copilot/mcp-config.json("type": "http","url": "https://mcp.brainmemory.ai/mcp"), then authenticate with/mcp authin-session. - Kilo — add to
kilo.jsonc(mcp→"type": "remote","url": "https://mcp.brainmemory.ai/mcp"). OAuth starts automatically on first connect. - Antigravity — set
serverUrltohttps://mcp.brainmemory.ai/mcpinmcp_config.json. - Claude.ai / ChatGPT apps — add a custom connector (URL + OAuth) in Settings → Connectors. See Use Brain in the Claude apps for the full walkthrough.
The connector needs a Brain Cloud account so your brain is reachable from any host. OAuth is handled automatically — leave any client ID / secret blank.
The local-first native plugin
Prefer a fully local brain with no hosted service? Install the plugin globally, then run the setup wizard.
Install
npm install -g brain-memory@beta
brainThe first command installs the package globally — this gives you both the interactive setup wizard and the brain CLI (brain recall, brain memorize, brain reinforce, …) that agents rely on for deterministic scoring.
The second command runs the setup wizard, which asks which runtime(s) to configure (Claude Code, OpenAI Codex CLI, OpenCode, GitHub Copilot CLI, Kilo, or Antigravity) and whether to install globally or for the current project.
Antigravity native support is experimental — it writes GEMINI.md plus skills under
~/.gemini/skills/. For Antigravity, the MCP connector is the more reliable path.
Global installation is recommended for most users. It makes your brain available across all projects with any supported agent.
Do not use npx brain-memory for installation. npx runs the setup wizard in a temporary directory that is discarded after execution. The brain CLI (brain recall, brain memorize, brain reinforce, …) won't be available in your PATH, and agents will fall back to less reliable manual file operations. Always use npm install -g.
Non-Interactive Install
Pass flags to skip the interactive prompts:
npm install -g brain-memory@beta
# Claude Code, global
brain --claude --global
# OpenAI Codex CLI, global
brain --codex --global
# OpenCode, local project
brain --opencode --local
# GitHub Copilot CLI, global
brain --copilot --global
# Kilo, global
brain --kilo --global
# Antigravity (experimental), global
brain --antigravity --global
# Core CLIs (Claude Code + Codex + OpenCode), global
brain --all --globalFor the deepest integrations, layer the dedicated plugins on top: the
Copilot CLI plugin
(copilot plugin install omelas-tech/brain:integrations/copilot/plugin) adds
session-start context injection via Copilot's native hooks, and the
Kilo runtime plugin
does the same through Kilo's plugin system.
What Gets Installed
The installer copies two things to your agent's configuration directory:
- Command prompts — Slash command definitions (e.g.,
/brain:memorize,/brain:remember) that teach the agent how to use the memory system - Prompt section — Instructions appended to your agent's main prompt file (
CLAUDE.md,AGENTS.md,GEMINI.md,copilot-instructions.md, or Kilo'srules/brain-memory.md) that enable session lifecycle behavior (auto-loading memories at start, suggesting memorization at end)
Your actual memories live in ~/.brain/, which the installer creates for you (it's also auto-created on your first /brain:memorize or /brain:sync).
Manual Install
If you prefer to install manually, copy the command files and prompt section yourself:
Claude Code
# Copy commands
cp -r commands/brain/ ~/.claude/commands/brain/
# Append prompt section to CLAUDE.md
cat prompts/claude.md >> ~/.claude/CLAUDE.mdOpenAI Codex CLI
# Each command becomes a skill
for f in commands/brain/*.md; do
name=$(basename "$f" .md)
mkdir -p ~/.agents/skills/brain-"$name"
cp "$f" ~/.agents/skills/brain-"$name"/SKILL.md
done
# Append prompt section to AGENTS.md
cat prompts/openai.md >> ~/.codex/AGENTS.mdOpenCode
# Copy commands
cp -r commands/brain/ ~/.config/opencode/command/brain/
# Append prompt section to AGENTS.md
cat prompts/openai.md >> ~/.config/opencode/AGENTS.mdGitHub Copilot CLI
# Each command becomes a skill (~/.agents/skills/ is shared with Codex)
for f in commands/brain/*.md; do
name=$(basename "$f" .md)
mkdir -p ~/.agents/skills/brain-"$name"
cp "$f" ~/.agents/skills/brain-"$name"/SKILL.md
done
# Append prompt section to the global instructions file
cat prompts/copilot.md >> ~/.copilot/copilot-instructions.mdKilo
# Slash commands (invoked as /brain-remember, /brain-memorize, /brain-status)
mkdir -p ~/.config/kilo/commands
cp integrations/kilo/commands/brain-*.md ~/.config/kilo/commands/
# Write the prompt, then register it in kilo.jsonc
mkdir -p ~/.config/kilo/rules
cp prompts/kilo.md ~/.config/kilo/rules/brain-memory.mdThen add "~/.config/kilo/rules/brain-memory.md" to the instructions array in
~/.config/kilo/kilo.jsonc (the installer does this automatically when the file
is strict JSON).
Antigravity (experimental)
# Each command becomes a skill
for f in commands/brain/*.md; do
name=$(basename "$f" .md)
mkdir -p ~/.gemini/skills/brain-"$name"
cp "$f" ~/.gemini/skills/brain-"$name"/SKILL.md
done
# Append prompt section to GEMINI.md
cat prompts/gemini.md >> ~/.gemini/GEMINI.mdUpdate
To update Brain Memory to the latest version:
npm install -g brain-memory@beta
brain updateThe first command updates the package and CLI tools. The second command refreshes the slash command prompts for your installed runtimes. You can target specific runtimes:
brain update --claude
brain update --codex
brain update --opencode
brain update --copilot
brain update --kilo
brain update --antigravity
brain update --allUpdating never touches your memories in ~/.brain/. It only refreshes the command prompts and prompt sections.
Uninstall
brain uninstall
npm uninstall -g brain-memoryThe first command removes slash commands and prompt sections from your agent's configuration. The second removes the package and CLI tools. Your ~/.brain/ directory (all your memories) is preserved by default.
To also delete your memories:
brain uninstall --delete-dataTo skip confirmation prompts:
brain uninstall --yesUsing --delete-data permanently removes all your memories. Consider using /brain:sync export to back them up first.