Installation

Brain Memory can be installed with a single command. The interactive installer configures everything for your preferred AI agent(s).

Quick Install

npx brain-memory@beta

The interactive installer 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.

Non-Interactive Install

Pass flags to skip the interactive prompts:

# Claude Code, global
npx brain-memory@beta --claude --global
 
# Gemini CLI, local project
npx brain-memory@beta --gemini --local
 
# OpenAI Codex CLI, global
npx brain-memory@beta --codex --global
 
# All runtimes, global
npx brain-memory@beta --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/ and are created when you first run /brain:init.

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:

npx brain-memory@beta update

This auto-detects installed runtimes and refreshes commands and prompt sections. You can target specific runtimes:

npx brain-memory@beta update --claude
npx brain-memory@beta update --gemini
npx brain-memory@beta update --codex
npx brain-memory@beta update --all
Info

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

Uninstall

npx brain-memory@beta uninstall

This removes commands and prompt sections from your agent's configuration. Your ~/.brain/ directory (all your memories) is preserved by default.

To also delete your memories:

npx brain-memory@beta uninstall --delete-data

To skip confirmation prompts:

npx brain-memory@beta uninstall --yes
Warning

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