big-brain π§
One memory for every AI assistant you use: your notes, projects, and tasks, kept as plain markdown you own.
Each AI tool keeps its own private memory of you, and none of them share it. big-brain flips that around. Point it at a folder of markdown (a new vault, or the Obsidian vault you already have) and Claude Code, Claude Desktop, Cursor, Codex, or any other MCP client can search it, read it, capture into it, and keep your projects and tasks current. Switch models whenever you like; your context comes with you.
Replay of a real Claude Code conversation with a demo vault (transcript, recorded by scripts/demo-ai.mjs); timing is illustrative.
60-second start
npx @jzhao234/big-brain setup
That one command installs big-brain, creates a vault at ~/brain, connects Claude Code, Codex, and Antigravity (agy) if you have them (MCP server plus the /brain, /capture, and /weekly skills), and prints the config to paste into Claude Desktop or Cursor. Pass a folder to use a different one, such as your Obsidian vault: npx @jzhao234/big-brain setup ~/Obsidian. It's safe to run again (anything already set up is left alone), and --dry-run shows the plan without changing anything.
Then restart your assistant and ask "what am I working on?" or "capture: call the dentist on Friday". Other clients, and browser chats like claude.ai and ChatGPT, are covered in Connect your AI tools.
Prefer to do it by hand? These three lines are what setup does for Claude Code:
npm install -g @jzhao234/big-brain
big-brain init ~/brain
claude mcp add --scope user big-brain -- big-brain-mcp --vault ~/brain
Already use Obsidian? big-brain reads an existing vault as is: no config file, no migration, and nothing is written until you ask for a change (setup writes nothing into it either). Add a brain.config.json later to map your folder names, one entry per folder (for example, "folders": {"projects": "Projects", "inbox": "Inbox"}), so projects and captures land where you keep them. See docs/vault-spec.md.
What you get
- Plain markdown files. No database and no lock-in. Open the vault in Obsidian, grep it, or put it in git.
- An MCP server with 24 tools: search, capture, daily logs, projects, tasks, the link graph, related notes, and a vault health check.
- A CLI for humans:
big-brain status,big-brain capture,big-brain tasks, and more. - Skills for Claude Code, Codex, and Antigravity (
/brain,/capture,/weekly), installed with one command. - Projects as the unit of work. Each project is one file with a goal, checkbox tasks, and a running log.
- Deterministic retrieval first: fuzzy full-text search with title boosting,
[[wikilink]]backlinks, tags, and frontmatter filters. No API keys, and it works offline. - Optional local semantic search. Turn on
embeddings.enabledand a small on-device model (via@huggingface/transformers) adds meaning-based matches, fused with full-text search by Reciprocal Rank Fusion. Paraphrases match, exact terms still count, and nothing leaves your machine. It also powersrelated_notes. See docs/vault-spec.md. - Optional git auto-commit and push. Turn on
git.autoCommitand every note write from any tool commits only the files it touched; addgit.autoPushto push in the background so your other machines stay in sync. A git failure never blocks a save: if the commit fails the note is still saved, and if the push fails the commit stays local until the next push. - Edits that don't damage notes. Writes are atomic and locked per note, keep each note's line endings, never land inside code blocks or frontmatter, refuse to rewrite frontmatter they can't parse, and refuse to write anywhere that resolves outside the vault (such as through a symlink). docs/vault-spec.md lists the edge cases these don't cover.
Requires Node 22.12 or newer. big-brain is pre-1.0: it's used daily, but minor versions may still change behavior; see the changelog.
Install
npm install -g @jzhao234/big-brain
That puts three commands on your PATH: big-brain (the CLI), big-brain-mcp (the MCP server over stdio), and big-brain-mcp-http (the remote preview below). To try it without installing, npx @jzhao234/big-brain status --vault ~/brain works too.
The base install leaves out semantic search and its native dependencies. To enable local embeddings, install the add-on into the same place, then set embeddings.enabled to true in brain.config.json:
npm install -g @jzhao234/big-brain @huggingface/transformers@^3.8.1
To work on big-brain itself, install from source instead: git clone https://github.com/jzhao234/big-brain.git && cd big-brain && npm install && npm run build && npm link. See CONTRIBUTING.md.
Quickstart
big-brain init ~/brain --name "My Brain" # scaffold a vault
cd ~/brain
big-brain status # look around
big-brain install-skills # add the /brain, /capture, /weekly skills
Then connect an AI tool (below) and, optionally, seed the vault from your existing AI history.
Connect your AI tools
For local clients, run big-brain-mcp. The vault is chosen by --vault <dir> or the BIG_BRAIN_VAULT environment variable.
Claude Code
claude mcp add --scope user big-brain -- big-brain-mcp --vault ~/brain
claude mcp list # expect: big-brain ... β Connected
Antigravity CLI (agy)
agy mcp add big-brain -- big-brain-mcp --vault ~/brain
agy mcp list # expect: big-brain stdio enabled ...
Claude Desktop / Cursor / other MCP clients: add to the MCP config (e.g. claude_desktop_config.json). Use an absolute command path: GUI apps are launched without your shell's PATH, so a bare big-brain-mcp may not resolve (run which big-brain-mcp to get it).
{
"mcpServers": {
"big-brain": {
"command": "/absolute/path/to/big-brain-mcp",
"args": ["--vault", "/absolute/path/to/brain"]
}
}
}
Other local MCP clients: any client that speaks MCP over stdio works the same way. For clients without MCP, the CLI's --json output makes the vault scriptable.
Remote MCP preview: Big Brain can expose the same 24 tools through an authenticated Streamable HTTP endpoint:
export BIG_BRAIN_MCP_TOKEN="$(openssl rand -hex 32)"
big-brain mcp-http --vault ~/brain
# endpoint: http://127.0.0.1:3333/mcp
It binds to localhost by default and checks Authorization: Bearer <token> before parsing JSON. Bodies are capped at 1 MB (larger requests get HTTP 413 with a JSON-RPC error). Requests without Origin are allowed; requests with one require an exact match in --allowed-origins / BIG_BRAIN_MCP_ALLOWED_ORIGINS, which defaults to empty and refuses browser origins. Keep it behind an HTTPS reverse proxy or secure tunnel; never expose the plain HTTP listener directly. The static token is the first self-hosted transport milestone, not an OAuth implementation, so browser connectors that require OAuth still need an OAuth-capable gateway. See docs/mcp-setup.md.
Browser fallback (claude.ai / ChatGPT): the zero-infrastructure option is to connect the AI to your vault's GitHub repo so it can read the markdown directly, and write it where the connector allows (some GitHub connectors are read-only; you also lose the computed overview/search/task tools, since it's raw file access). See docs/browser-github-connector.md and paste prompts/browser-github-instructions.md.
Then teach the assistant how to use the vault: Claude Code reads the vault's CLAUDE.md automatically when you work inside the vault folder; elsewhere, and for other tools, paste prompts/agent-instructions.md into their custom instructions.
Using it: load and save
The whole point is that you never re-feed context. The assistant loads a small, relevant slice on demand and saves small pieces as you work. You just talk to it.
Load: orient at the start, pull details as needed:
| You want to⦠| In Claude Code | CLI |
|---|---|---|
| "What am I working on?" | /brain | big-brain status |
| Find notes about X | "search my brain for X" | big-brain search X |
| Read one note | "read the Auth project" | big-brain show "Auth" |
| See tasks / projects | "what's due?" | big-brain tasks, big-brain projects |
| Pull surrounding context | "what's related to X?" | big-brain related X |
Save as decisions, progress, and ideas happen (append-first; never destructive):
| You want to⦠| In Claude Code | CLI |
|---|---|---|
| Stash a stray thought | /capture <text> | big-brain capture "β¦" |
| Log a decision / progress | "log that I shipped X" | big-brain daily --log "β¦" |
| Add a task | "add a task to project Y" | big-brain task add "β¦" --note Y |
| Finish a task | "mark that done" | big-brain task done <id> |
| Start a project | "new project: β¦" | big-brain project new "β¦" |
| Add to a note | "add that to the Auth note's Log" | big-brain append "Auth" --heading Log -- "- β¦" |
| Fix a passage | "Auth's summary is out of date, fix it" | big-brain edit "Auth" --old "β¦" --new "β¦" |
| Change metadata | "set Auth's due date to β¦" | big-brain frontmatter "Auth" due=2026-11-01 |
| Retire a note | "archive that note" | big-brain archive "Auth" |
Review: /weekly runs a guided pass: triage the inbox, prune projects, reschedule overdue tasks, fix broken links, and consolidate: big-brain doctor flags Summaries that fell behind their Log, bloated notes and near-duplicates, and the review proposes Summary refreshes, Log trims, merges and stale-fact fixes for your approval. Capture and search keep a brain useful; consolidation keeps it trustworthy.
Session context: the right note, before you ask
big-brain context prints what an agent should know about the directory it starts in, so a session-start hook can hand it over without anyone remembering to look:
- The repository's own note. The directory's git remote is matched against
repos:in note frontmatter, by its full path (owner/repo, orgroup/sub/repo); write an entry as a URL (https://gitlab.example.com/group/repo) to pin its host when the same path exists on two hosts. Exactly one owning note is loaded: its## Summarysection (or the text before its first section), status, and open tasks. Notes that list the repo underrelated_repos:are named, not loaded. If two notes claim the same repo, none is loaded anddoctorreports it, so one client's notes never leak into another's session. - A path rule. Otherwise the longest matching rule in
brain.config.jsondecides: which notes to summarize and which folder's active projects to list. - The active projects, when nothing else matches.
---
type: project
repos: [acme/widget] # this note owns these repositories
related_repos: [acme/infra] # mentioned, never loaded
---
"context": {
"maxChars": 4000,
"paths": [
{ "path": "~/work", "notes": ["Estate"], "projects": "work/projects" },
{ "path": "~", "projects": "" }
]
}
Output is capped at maxChars (default 4000) and ends with a pointer to the vault, so the agent reads more only when it needs to. --format claude|codex|agy wraps the text in that agent's session-start hook output; in those formats the command reads the hook's JSON from stdin for the working directory, and on any problem it prints nothing and exits 0, so a hook can never break a session. Register it as a session-start command hook:
- Claude Code: a
SessionStarthook inagents/claude/settings.json, whichbig-brain agents installmerges into~/.claude/settings.json:"hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "big-brain context --format claude" } ] } ] } - Codex: a
SessionStartcommand hook in~/.codex/hooks.jsonrunningbig-brain context --format codex. Codex asks you to trust a new hook once per machine. - Antigravity: a
SessionStartcommand hook in~/.gemini/config/hooks.json(anagents/agy/files/hooks.jsonin the vault links there) runningbig-brain context --format agy.
Set BIG_BRAIN_VAULT for the hook, or add --vault <dir> to the command.
Skills
Three skills wrap the tools into commands, for Claude Code and Antigravity (/brain) and Codex ($brain):
brain: load the overview and switch into brain-aware mode for the sessioncapture: zero-friction capture to the inboxweekly: a guided weekly review
big-brain agents install claude codex agy installs them for each agent (see below). They are copied, not linked, since the package path changes between versions, and kept current: a copy you haven't edited is updated when big-brain ships a newer one, and an edited copy is kept and reported (--replace backs it up and copies big-brain's). A skill of the same name in agents/<agent>/skills/ replaces the bundled one, and then follows the vault instead of big-brain. big-brain install-skills still copies the Claude versions into ~/.claude/skills (--force overwrites). Each is written once in skills/source/ and rendered for each agent the same way as your own skills (below). They're path-agnostic: they call the big-brain CLI / MCP tools and resolve the vault from BIG_BRAIN_VAULT (or --vault), so the same skill works on every machine.
Agent profiles: your agent setup in the vault
Your coding agents' personal setup (skills, global instructions, hooks, the status line, a few settings) can live in the vault too, so every machine gets the same setup from one command and a change made on one machine reaches the others through git.
agents/claude/instructions.md -> ~/.claude/CLAUDE.md
agents/claude/skills/<name>/ -> ~/.claude/skills/<name> (one link per skill)
agents/claude/files/** -> ~/.claude/** (one link per file: statusline.sh, hooks/β¦)
agents/claude/settings.json -> merged into ~/.claude/settings.json
agents/codex/instructions.md -> ~/.codex/AGENTS.md
agents/codex/skills/<name>/ -> ~/.codex/skills/<name>
agents/codex/config.toml -> merged into ~/.codex/config.toml
agents/agy/instructions.md -> ~/.gemini/config/AGENTS.md
agents/agy/skills/<name>/ -> ~/.gemini/config/skills/<name>
agents/agy/files/** -> ~/.gemini/config/**
agents/agy/settings.json -> merged into ~/.gemini/antigravity-cli/settings.json
big-brain agents status # linked, missing, edited here, or only on this machine
big-brain agents install --dry-run # show the plan
big-brain agents install # link everything (agents with a profile; or name them)
big-brain agents save claude statusline.sh --setting statusLine # capture a local change
big-brain agents save codex skills/my-skill --setting tui.status_line
big-brain agents render # write each agent's copy of agents/skills/<name> (below)
How it stays safe:
- Links, not copies. Edit a skill or script in the vault (or through the link) and every machine has it after
git pull. Everything else in~/.claude/~/.codex(other skills, history, credentials) is never touched. - Nothing unmanaged is replaced unless you say so. A file in the way is reported;
--replacemoves it to a timestamped backup under~/.local/state/big-brain/backups(outside every agent folder, so a backed-up skill is never picked up) with a restore manifest, then links the vault's. - Settings merge three ways. big-brain remembers what it applied on each machine: a value you edited locally is reported, not overwritten (
--replacetakes the vault's); a value you never touched follows the vault; a key dropped from the vault is removed only if it wasn't edited. Claude hooks are matched by event, matcher, and command, so changing a timeout updates the hook instead of registering it twice. TOML is edited line by line (comments, trust entries and hook hashes stay put), and any edit that would change more than the managed keys is refused. - Plan first, then write, and roll back on failure. Every link and settings change is validated before the first write; a refusal leaves the machine untouched, and if a step still fails midway the steps already done are undone (if even that fails, nothing is deleted and the error says where the originals are). Nothing is written through a symlinked folder, and a settings file kept as a symlink (e.g. in a dotfiles repo) stays a symlink.
--pruneremoves links whose vault file was deleted. saverefuses known secret and state files. Whole settings files,.credentials.json,auth.json,.envfiles, history, sessions, caches and databases are refused; save individual settings with--setting. It doesn't inspect contents, so review the files and--settingvalues you save (anenv.API_KEYsetting would be copied as is).- Codex hooks stay local. Codex asks you to trust each hook on each machine, so hook registrations are not managed for Codex. Claude Code users: review new hooks with
/hooks. Status warns when Codex'sAGENTS.override.mdoverridesAGENTS.md. - Antigravity split layout. agy keeps its customizations in
~/.gemini/config/and its CLI settings next door in~/.gemini/antigravity-cli/settings.json, so big-brain links agy's instructions, skills, and files into~/.gemini/config/and mergesagents/agy/settings.jsoninto~/.gemini/antigravity-cli/settings.json;mcp_config.jsonandconfig.jsonare agy's own and never linked. ItsAGENTS.mdlives under~/.gemini/config/rather than~/.gemini/GEMINI.md, which the Gemini CLI also reads.
One skill for every agent
Claude Code, Codex and Antigravity read the same kind of SKILL.md, but each wants something slightly different: Codex runs a skill as $name and reads its picker metadata from agents/openai.yaml, Claude Code has its own frontmatter keys (argument-hint, disable-model-invocation), and Antigravity accepts only name and description. Instead of keeping three copies that drift apart, write the skill once in agents/skills/<name>/ and let big-brain agents render write each agent's copy into agents/<agent>/skills/<name>/, where install links it as usual.
---
name: test
description: >
Add or improve tests. Use when the user types {{/test}} or asks for tests.
agents: [claude, codex, agy] # optional; default: every agent with a profile
invocation: explicit # optional: only when the user asks by name
claude:
argument-hint: "[file or module]"
codex:
openai: # becomes agents/openai.yaml
interface:
display_name: "Test"
short_description: "Write behavior-focused tests for a change"
default_prompt: "Use {{/test}} to cover this change."
---
# test
...instructions, written once...
<!-- only: codex -->
A line only Codex needs.
<!-- /only -->
{{/name}}becomes/name, or$namefor Codex;{{agent}}is the agent's name (Claude, Codex, agy) and{{agent.name}}its id. Other{{...}}text is left alone.invocation: explicitsetsdisable-model-invocationfor Claude Code andpolicy.allow_implicit_invocation: falsefor Codex. Antigravity has no such setting, so its description gets a sentence saying to run the skill only when the user asks for it by name.- A map named after an agent holds frontmatter for that agent only, over the shared keys (a different
descriptiontoo). Every Markdown file in the folder is a template; scripts and other files are copied byte for byte. - Rendering is deterministic, so a copy can be checked against its source. Each generated
SKILL.mdstarts with a comment naming its source and a hash of what render wrote. A copy edited by hand (through the link in~/.claude/skills, say) is reported and never overwritten unless--replace, which backs it up first; a hand-written folder in the way is treated the same.--pruneremoves copies whose source is gone (an edited one only with--replacetoo). big-brain agents render --checkwrites nothing and exits 1 when any copy differs from its source, for CI.agents statusandinstalllist the same problems;installnever renders, and render never commits, so commit the source and its copies together.- Skills with no source in
agents/skills/stay hand-written per agent, for a skill that really has to work differently in each one.
CLAUDE_CONFIG_DIR and CODEX_HOME are honored. The folder name is folders.agents in brain.config.json (default agents), and it is never indexed as notes.
Use it on multiple machines
The vault is a git repo, so this is just git: clone it on each machine, and each machine runs its own big-brain-mcp against its own clone. Git keeps them in sync.
-
Write side: automatic. Set
git.autoCommit(andgit.autoPush) inbrain.config.jsonand every note write, from any tool on any machine, is committed and pushed (best-effort). See docs/vault-spec.md. -
Read side: pull before you start. Add a
SessionStarthook so a session always opens on the latest:// ~/.claude/settings.json "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "git -C \"$HOME/brain\" pull --ff-only --quiet 2>/dev/null || true" } ] } ] }--ff-onlymeans a pull never clobbers local work. (Or justgit -C ~/brain pullby hand.)
On a fresh machine: install big-brain (above), git clone your vault, big-brain agents install, register the MCP server. Four commands and your notes, skills, instructions, hooks, and status lines match your other machines.
Seed it from your existing AI history
An empty brain is useless; the fastest way to a useful one is extracting what your LLMs already know about you. Every assistant you've used heavily (ChatGPT, Claude, Gemini) has months of context about your projects, preferences, and goals sitting in its memory and chat history. Seeding pulls that out, once, into files you own.
1. Run the seed interview in each LLM you use. Copy the prompt from prompts/seed-interview.md into each assistant, ideally the account with the most history, with memory/personalization enabled. It's a structured export interview: profile, current projects, stack, how you like to work with AI, goals, people, routines, standing constraints, open loops, and blind spots. It instructs the model to be concrete, mark inferences (inferred), and write "No data" instead of inventing, so the output is honest enough to build on.
2. Save each output into the vault's inbox/ as one file per model (inbox/seed-chatgpt.md, inbox/seed-claude.md, β¦). Don't organize anything yet: capture first is the whole inbox philosophy.
3. Triage. Ask a vault-connected assistant to run the process-inbox MCP prompt (or just say "triage my inbox" / run /weekly in Claude Code). It merges duplicates across models (different LLMs know different slices of you, and they mostly complement rather than conflict), then turns the material into real structure: projects with tasks for everything in flight, people/ notes, a preferences note your agent instructions can point at, reference notes for your stack/setup, and open loops as tasks. You confirm per item; raw exports can be kept in archive/ for provenance.
4. Repeat occasionally. Models keep accumulating context about you; re-running the interview every few months and triaging the diff keeps the vault ahead of any one provider's memory.
Two more seeding paths worth knowing: if you already keep an Obsidian vault, big-brain can adopt it in place (add a brain.config.json, map your folder names via the folders config; see docs/vault-spec.md); and a work session with a vault-connected agent seeds as a side effect: the agent instructions tell it to create projects and capture facts as you work, so the brain fills in from real activity even if you skip the interview.
The vault
brain/
βββ BRAIN.md # index & ground rules
βββ CLAUDE.md # agent instructions (picked up by Claude Code)
βββ brain.config.json
βββ inbox/ # capture now, organize later
βββ daily/ # one note per day: focus, log, tasks
βββ projects/ # one file per project: goal, tasks, log
βββ areas/ # ongoing responsibilities
βββ notes/ # evergreen knowledge, densely [[linked]]
βββ people/ # one note per person
βββ reference/ # external facts, docs, how-tos
βββ archive/ # nothing is deleted, only archived
βββ templates/ # daily/project/note/person templates
Notes are markdown + YAML frontmatter (type, tags, status, dueβ¦). Tasks are - [ ] checkboxes with Obsidian Tasks-style metadata: π
2026-03-01 due, β« priority, β
done-date. Full details in docs/vault-spec.md.
MCP tools
| Tool | What it does |
|---|---|
brain_overview | Orient: active projects, due/overdue tasks, inbox, recent notes |
search_notes | Full-text search with type/tag/folder/status filters |
read_note / list_notes | Read by path, title, or alias; browse by folder/type/tag |
create_note / append_note / edit_note / replace_note_body | Write notes (append is the safe default; edit_note changes one exact passage, in a note of any size) |
update_frontmatter / archive_note | Metadata changes; non-destructive delete |
capture | Quick capture to inbox |
daily_note / daily_log | Daily notes and timestamped work journal |
list_projects / create_project / set_project_status | Project lifecycle |
list_tasks / add_task / complete_task / update_task | Checkbox tasks across the vault; update_task reschedules, reprioritizes, rewords, reopens, or cancels one in place |
note_links | Outgoing links + backlinks for a note |
related_notes | Related notes with reasons: links, co-citations, rare shared tags, title mentions, semantic similarity |
list_tags / vault_health | Tag census; broken links, frontmatter that doesn't parse, stale projects, Summaries behind their Log, bloated/duplicate notes, overdue tasks |
Plus three MCP prompts: orient, weekly-review, process-inbox.
CLI
big-brain setup [dir] one-step install + connect
big-brain init [dir] scaffold a vault big-brain tasks [-p X] [-t tag] [--due-by D]
big-brain status overview big-brain task add|done ...
big-brain search <query> search (hybrid if on) big-brain projects [--status active]
big-brain show <note> print a note big-brain project new|status ...
big-brain new <title> create a note big-brain links <note>
big-brain related <note> related notes + why big-brain tags
big-brain capture <text> quick capture big-brain doctor
big-brain daily [--log "..."] daily note / journal big-brain index [--status|--rebuild]
big-brain append <note> <text> append [--heading H] big-brain frontmatter <note> k=v ...
big-brain archive <note> archive (non-destructive delete)
big-brain edit <note> --old T --new T replace one exact passage (--all for every match)
big-brain agents status|install|save|render agent setup from the vault (see Agent profiles)
big-brain install-skills add Claude Code skills big-brain mcp run the MCP server
search, related, tasks, projects, and doctor take --json for scripting. task done and task update take a task id or its text: a task's whole text wins over longer tasks that contain it, and an ambiguous fragment lists the candidates. Put -- before append text that starts with - (a list item), or it is read as an option. frontmatter reads each value as YAML, like key: value in the file: 'tags=[work, llm]' is a list, due=2026-11-01 stays a date string, and key=null (or key=) removes the key. Quote any assignment that contains spaces, or the shell splits it into separate arguments.
Design principles
- Files over databases. Markdown you can read in 30 years beats any app.
- The human owns the vault; agents are guests. Agents append and capture freely, but rewriting and archiving are deliberate acts.
- Deterministic beats clever. Search + links + tags retrieves reliably and works offline; the semantic layer is opt-in, fully local, and fused with exact search, never a replacement for it.
- Model-agnostic by construction. Everything goes through MCP or the filesystem; nothing assumes a particular AI vendor.
Contributing and support
Bug reports and focused pull requests are welcome; read CONTRIBUTING.md first, since it explains what's in scope. Report security problems privately as described in SECURITY.md, not in a public issue.
npm install
npm run typecheck && npm run lint && npm test
npm run build
Follow along
big-brain is a side project, built in the open. If it's useful to you, a star helps other people find it. To hear about new releases and whatever I build next, use Watch β Custom β Releases on this repo, or follow @jzhao234 on GitHub.
MIT Β© Junhao Zhao