brain-setup

Creates your Obsidian vault from the developer-os template, or connects an existing vault by adding only what is missing, then points Claude Code at it once you approve the diff.

Group
Memory
Kind
Action
Writes
New vault files; .gitignore lines (git vaults only); the Brain vault: line in ~/.claude/CLAUDE.md; permissions.additionalDirectories in ~/.claude/settings.json
Asks before
Connecting a non-empty folder; both config edits, shown as a diff; the types.json merge

When it runs

When you set up developer-os, when no Brain vault: line exists yet, or when you ask for it:

What it does

  1. Asks for the path and picks the mode. It asks for the vault's absolute path. If your config already has a Brain vault: line with another path, it shows it and asks which to keep. A missing or empty folder means a new vault; a non-empty one means it asks whether to connect it, and stops if you say no.
  2. New vault. It copies the plugin's vault template into the path: topic folders, inbox, archive, views, the note template and example notes.
  3. Connect an existing vault. It adds only what is missing and never overwrites, moves or deletes a file: the folders DEV, INFRA, PROJECTS, QA, TOOLS, _archive, _inbox, _views and templates, the missing .base views and templates/note.md. .gitignore lines are added only to a vault that is a git repository or already has a .gitignore. Example notes are not copied. In .obsidian/types.json it adds only absent keys, after showing the change and asking you to close Obsidian; without jq it tells you to set the property types in Obsidian instead.
  4. Points Claude Code at the vault. It shows a diff of two edits in your Claude config directory ($CLAUDE_CONFIG_DIR, default ~/.claude): a Brain vault: <path> line in CLAUDE.md and the path in permissions.additionalDirectories in settings.json. It applies them in place only after you approve; if jq is missing or settings.json is not valid JSON, it changes nothing and shows you the key to add by hand. For Codex it prints the line for ~/.codex/AGENTS.md for you to add.
  5. Runs a smoke test. It runs brain-search on the new path: in a new vault a search for "webhooks" must find the example note _inbox/process-webhooks-once-per-event-id.md; in a connected vault it searches for the topic of one existing note. Then it tells you to enable the Bases and Templates core plugins in Obsidian, with templates as the Templates folder.

Boundaries

Stops when

The smoke test is done. The report gives the mode, the vault path, what was created or appended, which config edits were applied or declined, an old vault path still in permissions.additionalDirectories if the path changed (you remove it by hand), the Codex line if printed, and the smoke-test result.

Never

  • Copy into a non-empty folder in new-vault mode, or overwrite any existing file in the vault (.obsidian/, notes, .gitignore, .base views).
  • Edit CLAUDE.md or settings.json before you approve the diff, rewrite settings.json by hand, or replace either file with mv.
  • Edit ~/.codex/AGENTS.md.
  • Search the disk for vaults or read notes beyond the smoke test.