Central Brain
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Central Brainwhat's my active goal and any decisions I should know about?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Central Brain
Persistent, goal-oriented memory and work ledger for Claude Code.
Claude sessions forget everything when they end. Central Brain gives them one durable memory that every session, in every project, reads and writes:
Goals, not tasks. Each piece of work is a goal with a locked contract: objective, scope, constraints and success criteria.
Evidence, not claims. A goal completes only when each criterion has verified evidence and the converge report is clean.
Memory that compounds. Decisions, failures and their fixes, learnings and project knowledge are stored, searched and reused.
It is a local SQLite database (~/.central-brain/brain.db) with a CLI, an MCP server for Claude Code, and session hooks that inject context automatically. There are no external services: search is hybrid full-text plus local ONNX embeddings.
The full design is in ARCHITECTURE.md, and the agent operating rules are in CLAUDE.md.
Quickstart
Requirements: Node.js 20+, Claude Code, and jq and sqlite3 on PATH (used by the prompt hook).
git clone https://github.com/localhost-anon/central-brain.git ~/Projects/central-brain
cd ~/Projects/central-brain
npm install
npm run build
npm link # optional: puts `brain` on your PATH
brain init # creates ~/.central-brain/brain.db and applies migrationsThe hook scripts assume the repo lives at ~/Projects/central-brain. If you clone it somewhere else, edit the paths in hooks/ and bin/brain-claude.
Register the MCP server so Claude Code can call the brain_* tools in every project:
claude mcp add --scope user central-brain -- node ~/Projects/central-brain/dist/mcp/server.jsWire the hooks in ~/.claude/settings.json:
Event | Script | What it does |
|
| Injects |
|
| Reminds the session to consult Brain first and names the active goal |
|
| Reminds the session to persist decisions, learnings and verification |
{
"hooks": {
"SessionStart": [{ "hooks": [{ "type": "command", "command": "~/Projects/central-brain/hooks/session-start.sh" }] }],
"UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "~/Projects/central-brain/hooks/user-prompt.sh" }] }],
"Stop": [{ "hooks": [{ "type": "command", "command": "~/Projects/central-brain/hooks/stop.sh" }] }],
"PreCompact": [{ "hooks": [{ "type": "command", "command": "~/Projects/central-brain/hooks/stop.sh" }] }]
}
}Optionally, register your projects with brain project scan ~/Projects, and run brain embed reindex to enable semantic search. The first run downloads a small embedding model to ~/.central-brain/models.
Related MCP server: waypath
How a goal flows
create → intake → lock → plan (work units) → start → work → verify → converge → completeCreate. Run
brain goal create "<title>" -o "<objective>".Intake. Run
brain goal intake <id>. It surfaces related memory and contract gaps, and asks two standing questions:review:behaviour: which user-visible choices does this involve?review:coverage: which areas still need contract lines? The areas are behaviour, data, failure modes, edge cases, non-functional, integration and completion.
Sessions may add at most 5 material questions of their own, each with a recommended answer. Ask them in one batch.
Lock. Run
brain goal lock <id>. Lock refuses unless:the contract is complete;
every required success criterion states one claim and has a verify method (
test | command | api | inspection | manual);every applicable principle is acknowledged (see Principles below).
Plan and start. Create work units with
--serves <criterion ids>.brain goal startrefuses while any required criterion has no work unit serving it.Verify. For each criterion, run
brain verify add … --verdict verified|partial|failedwith the real observed output.partialnever counts as passing, and averifiedverdict needs actual output plus a verification type that matches the criterion's verify method.Converge. Run
brain goal converge <id>. It lists typed findings:missing, partial or contradicting evidence;
stale evidence (recorded before later work finished);
unfinished work;
open failures;
uncovered criteria.
Fix them until it reports converged.
Complete.
brain goal complete <id>refuses while CRITICAL or HIGH findings remain.--forceneeds--reason; the reason is recorded as a decision and the goal is permanently marked as force-completed. A goal that was never locked cannot complete without force.
Failures resolve only with a solution that has --verdict verified and a --reproduction note saying how the original symptom was re-checked. Passing tests alone count as partial.
Principles are durable rules stored as knowledge with category principle, scoped either GLOBAL or to a project (for example "sandbox first"). Link a goal to its project with brain goal link-project. Then acknowledge each principle with brain principle ack, either as honoured or as an exception with a reason; an exception is recorded as a decision.
Rules versions. Goals locked before these rules shipped stay on rules_version 0 and keep the original, simpler completion check. Every goal locked afterwards gets rules_version 1.
Staleness. Open goals with no activity for BRAIN_STALE_DAYS (default 7) are skipped by brain goal current and listed at session start. Close them with goal complete, or retire them with brain goal cancel <id> <reason>.
Command reference
brain <group> --help shows every option. Every command prints JSON.
Group | Commands |
Setup |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The MCP server exposes the same operations as brain_* tools. Examples include brain_goal_intake, brain_goal_converge, brain_principle_ack and brain_failure_solution_add. Their descriptions carry the rules above, so sessions learn them from the tool list.
Data and safety
Location. The database is at
~/.central-brain/brain.db. Override it withBRAIN_DB. The database never lives in the repo.No secrets. Do not store secrets in Brain. Reference environment variable or credential names instead.
No auto-migration. Sessions never migrate the live database. After pulling schema changes, run
brain migrate, which snapshots first. Until then,context getreturns a "schema update pending" notice.Check migrations on a copy.
npx tsx scripts/check-migration-on-copy.tsmigrates a copy of your database and confirms all goals are unchanged.
Development
npm test # vitest (in-memory and temp-file databases only)
npx tsc --noEmit # type check
npm run build # compile to dist/
npm run db:generate # generate a drizzle migration after editing src/db/schema.tsThe code is organised as follows:
src/services/: one module per concern.src/services/contract-rules.ts: every gate rule, as pure functions.src/cli/andsrc/mcp/: thin wrappers over the services.drizzle/: migrations. They must be additive.
Contributing
main is protected. All changes, including the owner's, go through a pull request, and every PR needs the code owner's approval before it merges. Open a branch, keep npm test and npx tsc --noEmit green, and describe the outcome in the PR.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent cross-session memory shared by Codex, Claude Code, ChatGPT, and other AI agents.
The project brain for AI coding agents — memory, decisions, sprints, knowledge base via MCP.
- SeturosOAuthcom.seturos
Shared work memory for Claude Code, Codex, Cursor and chat, scoped to each repository.
- vibsyncOAuthcom.vibsync
One shared brain for your AI coding agents: team memory, agent Q&A, tasks, and file claims.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceLocal-first persistent memory layer for AI agents. Provides hybrid search (FTS5 keyword + vector embeddings) over 223K+ knowledge chunks via MCP. Tools: brain_search, brain_store, brain_entity, brain_subscribe. Features pub/sub with stable agent identity, delivery tracking, and Claude --channels integration. SQLite + BrainBar Swift daemon on Unix socket.2,101 PyPI9Apache 2.0
- AlicenseAqualityCmaintenanceLocal-first external brain for Claude Code, Codex, and any MCP client. Stores decisions, entities, and session artifacts in one SQLite file and exposes MCP tools for recall, page, promote, review, graph-query, and source-status.119 npm5MIT
- AlicenseBqualityDmaintenanceProvides persistent memory, skill tracking, failure indexing, and context sharing for Claude Code using SQLite with FTS5 full-text search.2321 npm1MIT
- AlicenseNot gradedqualityDmaintenanceProvides persistent, searchable memory for Claude Code using local SQLite, semantic embeddings, and full-text search, enabling Claude to recall and retrieve context across sessions and projects without external services.21 npm4MIT