A cognitive layer for Claude Code that gives your AI assistant spatial awareness, conversation memory, safety guardrails, and behavioral learning across all your projects.
- Hippocampus — Code navigation: file aliases, blast radius analysis, term search, DB schema snapshots
- Cerebral Cortex v2 — Conversation recall: search past sessions, read decision context, drill into reasoning
- Hypothalamus — Safety hooks: warns before touching sensitive files, surfaces blast radius on edits
- Prefrontal — Behavioral system: learned lessons and relational forces that shape how Claude works with you
- Commands —
/hello,/continue,/wrapup,/dopamine,/oxytocin
Copy thebrain-package to your machine. Any location works — your home directory, a tools folder, wherever.
cd /path/to/thebrain-package && npm installRun these in your terminal (not inside Claude):
claude plugins marketplace add /path/to/thebrain-package
claude plugins install thebrain@thebrain-localAfter this, thebrain loads automatically on every claude launch — no --plugin-dir flag needed.
Alternative (manual per-session): If you prefer not to install permanently:
claude --plugin-dir /path/to/thebrain-packageStart a new Claude session. You should see <!-- brain-loaded --> confirming the plugin loaded. Then say:
"set up thebrain"
Claude walks you through:
- Registering your workspace directories
- A behavioral questionnaire (personalizes how Claude works with you)
- Seeding starter lessons and forces
- First code scan and conversation indexing
- Node.js 18+
- Claude Code CLI
- A C++ compiler for
better-sqlite3native build (or prebuilt binaries)
TheBrain scans multiple workspace roots and indexes conversations from all of them. Blast radius analysis crosses workspace boundaries — if a shared library is imported from two workspaces, edits to it surface dependents from both.
Configure workspaces in ~/.claude/brain/config.json.
| Command | What it does |
|---|---|
/hello |
Session greeting — restores recent context |
/continue |
Context preservation and restoration (4 modes) |
/wrapup |
Save session state for next time |
/dopamine |
Flag a behavioral moment — builds your lesson database |
/oxytocin |
Flag a relational dynamic — builds your force system |
All mutable state lives in ~/.claude/brain/:
config.json— workspace roots and conversation directoriessignals.db— behavioral lessons and relational forcesrecall.db— conversation indexhippocampus/— project DIR files and term indexprefrontal-cortex.md— short-term recallprefrontal-live.md— generated decision gates
After first install: Uninstall and reinstall the plugin to clear the cache:
claude plugins uninstall thebrain@thebrain-local
claude plugins marketplace remove thebrain-local
claude plugins marketplace add /path/to/thebrain-package
claude plugins install thebrain@thebrain-localAfter upgrading Node.js: The better-sqlite3 native module needs rebuilding. The session-start hook will detect this and tell you the fix, but if needed:
cd /path/to/thebrain-package && npm rebuild better-sqlite3Also rebuild in the plugin cache if installed:
cd ~/.claude/plugins/cache/thebrain-local/thebrain/1.0.0 && npm rebuild better-sqlite3Make sure the plugin is installed and enabled:
claude plugins listShould show thebrain@thebrain-local with status enabled. If not, follow the install steps above. Start a new Claude session after installing.
TheBrain requires Node.js 18+. The session-start hook checks this automatically. Upgrade with:
nvm install 22 && nvm use 22Then npm install again in the thebrain-package directory.
docs/quick-reference.md— How to view, modify, and maintain everythingdocs/tool-index.md— Full CLI reference for all brain toolsdocs/brain-map.md— Architecture overviewsetup/SETUP.md— What happens during setup (Claude reads this)