Installation

Brain Memory is installed in two steps: a global npm install (for CLI tools) and a setup wizard (for slash commands and prompts).

Install

npm install -g brain-memory@beta
brain

The 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, Gemini CLI, OpenAI Codex CLI, or all) and whether to install globally or for the current project.

tip

Global installation is recommended for most users. It makes your brain available across all projects with any supported agent.

warning

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
 
# Gemini CLI, local project
brain --gemini --local
 
# OpenAI Codex CLI, global
brain --codex --global
 
# OpenCode, global
brain --opencode --global
 
# All runtimes, global
brain --all --global

What Gets Installed

The installer copies two things to your agent's configuration directory:

  1. Command prompts — Slash command definitions (e.g., /brain:memorize, /brain:remember) that teach the agent how to use the memory system
  2. Prompt section — Instructions appended to your agent's main prompt file (CLAUDE.md, GEMINI.md, or AGENTS.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.md

Gemini CLI

# Copy commands
cp -r commands/brain/ ~/.gemini/commands/brain/
 
# Append prompt section to GEMINI.md
cat prompts/gemini.md >> ~/.gemini/GEMINI.md

OpenAI Codex CLI

# Each command becomes a skill
for f in commands/brain/*.md; do
  name=$(basename "$f" .md)
  mkdir -p ~/.codex/skills/brain-"$name"
  cp "$f" ~/.codex/skills/brain-"$name"/SKILL.md
done
 
# Append prompt section to AGENTS.md
cat prompts/openai.md >> ~/.codex/AGENTS.md

Update

To update Brain Memory to the latest version:

npm install -g brain-memory@beta
brain update

The 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 --gemini
brain update --codex
brain update --opencode
brain update --all
info

Updating never touches your memories in ~/.brain/. It only refreshes the command prompts and prompt sections.

Uninstall

brain uninstall
npm uninstall -g brain-memory

The 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-data

To skip confirmation prompts:

brain uninstall --yes
warning

Using --delete-data permanently removes all your memories. Consider using /brain:sync export to back them up first.