[Brain OS: Forget your decisions? Brain OS remembers.]
[npm version]
[MIT License]
[MCP Compatible]
[brainos-hq.com]
[brainOS-HQ/brain-os MCP server]
One memory across your AI tools. Keep decisions, plans and next steps connected across ChatGPT, Claude, Cursor and other supported AI apps.
Brain OS
brainos-hq.com
Your AI remembers conversations. It still forgets project state.
Brain OS gives agents operational state: decisions, plans, blockers, and priorities that survive across sessions.
What is this?
AI agents are powerful inside a session, but long-running work has more state than any one chat: what you decided, what's blocked, what's active, and what should not be reopened. Brain OS gives agents operational state, not conversation logs:
- Entities — track projects, deals, initiatives with status, momentum, blockers, and next moves
- Decisions — log what was decided, why, what alternatives were rejected, and when to revisit
- Patterns — detect recurring blockers, stale work, avoidance signals, and theme convergence
- Focus — prioritize what to work on based on urgency, momentum, leverage, and staleness
- Verified operational state — compare package/Git facts with claimed and desired state without changing anything
- Semantic recall — search memory by meaning, not just ID
Brain OS is an MCP server that works with any MCP-compatible client: Claude Code, Cursor, Zed, GitHub Copilot, OpenAI Codex, Windsurf, or any agent that speaks the protocol.
What it looks like in use
Before the agent acts, it can check whether a proposed move conflicts with an existing decision:
That's the wedge: structured state with enforcement, so agents stop re-opening questions you already answered.
Quick start
Requires Node.js 20 or newer.
1. Connect the server
Claude Code:
Cursor (.cursor/mcp.json) and other MCP clients:
VS Code uses .vscode/mcp.json with a "servers" key and "type": "stdio" in place of "mcpServers".
2. Set up the project, from chat or from the terminal
From chat (no terminal): open your project and ask the agent:
The agent calls brain_setup. It shows the folder and the exact files it would create, and writes nothing until you say yes. Your existing AGENTS.md / CLAUDE.md are never overwritten. If you already have your own AGENTS.md, the Brain OS rules go to .claude/brain-os/AGENTS.md, and the setup lists any of your files that need a one-line pointer to it. Nothing is written outside the project.
From the terminal:
Either way, setup does three things:
- Creates a
.brain/ directory with your entity, decision, and pattern stores.
- Installs slash commands into
.claude/commands/ so you can run /brain, /brain:focus, /brain:decide, etc. directly in Claude Code. Bare aliases (/focus, /decide, etc.) install alongside them.
- Adds agent instructions so every MCP-compatible client behaves the same way.
AGENTS.md is the canonical file. Thin pointer files cover Claude Code (CLAUDE.md), GitHub Copilot (.github/copilot-instructions.md), Cursor (.cursor/rules/brain-os.mdc), Zed (.zed/rules.md), and Windsurf (.windsurfrules).
Flags (brain_setup takes the same options as minimal / include_commands):
npx brain-os init --minimal: install only AGENTS.md + CLAUDE.md and skip the other client pointers (clean-repo mode)
npx brain-os init --no-commands: skip the slash commands (MCP server only)
npx brain-os init --no-agent-instructions: skip all agent-instructions pointer files
Check live operational state
Brain OS can independently read a small, explicit set of repository facts and show drift without updating memory or project state:
The matching MCP tool, operational_state_check, observes only package.name, package.version, the current Git branch, and Git HEAD. Optional claimed state, desired state, and decision context are returned as separate layers: observations may be verified, stale, conflicting, unavailable, or different from a claim, but the checker never chooses a winner or applies a change.
The report is ephemeral JSON written to stdout. It creates no fact, evidence, issue, memory, entity, decision, plan, or audit record.
Configure semantic search (optional)
The semantic_recall tool needs an embeddings provider. Everything else (entity_update, decision_log, plan_*, etc.) works without one.
Brain OS does not install an embeddings SDK by default. This keeps the core install small and avoids pulling native ONNX/Sharp dependencies into users who do not need semantic search. Install the optional OpenAI provider beside brain-os, then add BRAIN_EMBEDDINGS to your MCP server env:
Then configure the provider in your MCP server environment:
If BRAIN_EMBEDDINGS is unset, the OpenAI provider is missing, or local mode is requested, semantic_recall returns a clear setup error. No silent provider install, model download, or API call occurs. Core tools continue working normally.
Never paste a raw sk-... key into your MCP config. ~/.claude.json and similar MCP config files are plaintext and easy to expose on screen or in backups. Instead, export the key once in your shell and reference it from the MCP process environment.
Tools
Slash commands
brain-os init installs slash commands into .claude/commands/ so the agent has a clear vocabulary for working with operational state. Each command installs in two forms: /brain:* (canonical, documented form) and a bare alias (/decide, /focus, etc.) for power-user brevity. /brain is the namespace root and installs once.
It also installs:
BRAIN_OS_PROTOCOL.md at .claude/brain-os/PROTOCOL.md (project) and ~/.claude/brain-os/PROTOCOL.md (user; written by npx brain-os init, or by brain_setup only with include_user_protocol=true). The protocol governs tool routing: when an agent runs a Brain OS slash command, it reads the protocol first, then calls entity_read/plan_read/focus_get/etc. as primary. Pulse files become fallback only.
brain-os-mode subagent at .claude/agents/brain-os-mode.md. When the main agent delegates Brain OS work to a subagent (e.g. Claude Code's Task tool), it picks up under the same protocol — no risk of subagents falling back to generic file search.
- Optional routing-guard hook at
templates/hooks/brain-os-routing-guard.py. Opt-in PreToolUse hook that warns if pulse files are read while a .brain/ workspace exists. Install instructions are printed by brain-os init.
Idempotent install
Re-running init is safe and repair-aware: existing Brain OS commands are preserved, and any missing form is installed. If a command path is taken by another tool, that path is skipped and reported — your file is never overwritten. You can install Brain OS into a project with existing /decide or /focus commands and the namespaced /brain:* forms will still land.
How it works
Brain OS stores everything as local JSON files in a .brain/ directory:
No cloud. No database. No account. Your data stays on your machine.
Why no UI?
The interface is the agent. Brain OS is read and written through MCP tool calls — /brain, /focus, /decide, decision_check, etc. — surfaced inline by whichever client you use (Claude Code, Cursor, etc.). There's no separate dashboard to keep open, no second tab to context-switch into, no UI state that can drift from the underlying files.
This is a design choice, not a missing feature. Brain OS state lives at the same level as your code; the agent is already there, already in the conversation, already the right surface to ask "what's the priority right now?" Adding a human dashboard would split attention between two interfaces for the same data.
If you want a visual at-a-glance view, .brain/ is plain JSON — render it however you want. The public MCP server stays agent-native by design.
Teams & sync
Brain OS is single-user by design today. But because .brain/ is just local JSON files, teams can share a brain through any synced filesystem — no product changes needed:
This works without any built-in sync because every Brain OS tool call reads fresh from disk — there's no in-memory cache to invalidate. Whatever your filesystem syncs, the next tool call sees. Same applies cross-tool: log a decision from Claude Code on Monday, open Cursor on Tuesday — same brain, both agents.
Native encrypted team sync with proper merge semantics is on the roadmap. The local-first foundation today is what makes that federation additive, not a retrofit.
Auto-loaded status
When an MCP client connects, Brain OS exposes a brain://status resource with an operational overview — active entities, alerts, top priority, and recent decisions. The agent starts every session with context, not amnesia.
Testing
Brain OS ships a smoke test suite at tests/smoke.mjs, wired to npm test and run on every push by .github/workflows/audit.yml. Run locally:
Current coverage (regression + happy-path):
decision_log — type-collision no-supersede, explicit supersedes works, cross-entity supersession rejected
decision_check — keyword-only flag stays caution without embeddings (no false STOPs), asymmetric semantic comparison (rejected vs chosen facet)
decision_refresh — clears dangling superseded_by when status transitions away from superseded
plan_advance — no over-promotion when an active step already exists
entity_update — apply diff and record changes, create missing entity, mode_reason required when parking, status-only updates apply, guarded ranking skips are visible
semantic_recall — throws EmbeddingsNotConfiguredError (not generic Error) when BRAIN_EMBEDDINGS is unset
- Store resolution — fails closed in a storeless cwd instead of silently creating an empty
.brain/
Known gaps (no direct coverage yet): focus_get scoring, pattern_detect heuristics, memory_*, plan_set/add/read, and the brain://status resource. Expanding the suite is on the roadmap.
If you hit a bug, please open an issue with the tool, input, and output — that's the fastest path to a fix.
Community
License
MIT