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@betaThe 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.
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 --globalWhat 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,GEMINI.md, orAGENTS.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.mdGemini CLI
# Copy commands
cp -r commands/brain/ ~/.gemini/commands/brain/
# Append prompt section to GEMINI.md
cat prompts/gemini.md >> ~/.gemini/GEMINI.mdOpenAI 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.mdUpdate
To update Brain Memory to the latest version:
npx brain-memory@beta updateThis 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 --allUpdating never touches your memories in ~/.brain/. It only refreshes the command prompts and prompt sections.
Uninstall
npx brain-memory@beta uninstallThis 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-dataTo skip confirmation prompts:
npx brain-memory@beta uninstall --yesUsing --delete-data permanently removes all your memories. Consider using /brain:sync export to back them up first.