5-agent Claude Code team with closed-loop self-improvement, Obsidian-synced external memory, multi-repo project constellations.
claude plugins add github:braininahat/brains-in-a-hat# 1. Install the plugin
claude plugins add github:braininahat/brains-in-a-hat
# 2. Bootstrap your vault (one-time, per device)
bash brains-in-a-hat/scripts/vault-init.sh auto
# 3. Set the env var (add to your shell rc to persist)
export BRAINS_VAULT_DIR=~/.hatbrains
# 4. (Optional) Group a multi-repo project — drop this in each repo:
cat > .brains_in_a_hat/project.json <<EOF
{
"projectGroup": "pulse",
"repoKey": "pulse-model"
}
EOF
# 5. Open Claude Code in the repo. The new-roster-bootstrap hook auto-spawns
# Librarian on your first prompt. That's it.| Component | Count | Description |
|---|---|---|
| Agents | 5 | Dewey (Librarian), Ebert (Critic), Marco (Scout), Wright (Architect — read-only), Ada/Grace/Shannon (Builders — on-demand). Plus Neal in the main thread. |
| Commands | 1 | /assemble — the only command the user types. Neal handles all other intents (review, ship, research, implement, design, recall) by routing internally. |
| Hooks | 6 | session bootstrap + per-turn context injection + idle-tick + allowlist enforcement |
| Scripts | 2 | vault-init.sh (detect/init/clone vault repo); file-plugin-issue.sh (file issues on the plugin repo from any project) |
- Neal lives in the main thread and orchestrates. The user talks to Neal; Neal routes by intent (no CODEOWNERS, no file-pattern routing).
- Librarian is an always-on teammate that curates a flat-vault knowledge graph in your private vault repo. It pulls/commits/pushes on every TeammateIdle tick — multi-device sync via git, no Obsidian sync required.
- Critic / Builder / Scout spawn on demand. Critic switches review lenses by prompt parameter (
lens=architecture|security|performance|ux|correctness); Builder reads project CLAUDE.md for domain context; Scout routes between context7, web, and own knowledge. - A
SubagentStarthook injects the last N main-thread turns + active learnings into every teammate spawn, so you never have to manually push context. - A
TeammateIdlehook re-engages Librarian to classify new transcript turns, update the vault with curation logic (update/supersede/delete — not just append), and push.
- Not 21 role-specialists with file-path routing — 5 generalist teammates with intent-based dispatch.
- Not a write-only retro archive — a curated vault that updates, supersedes, and deletes as you work.
- Not single-repo state — project constellations that share context across all your repos.
- Not Obsidian-sync-dependent — the vault is a git repo (e.g., a private GitHub repo); git is the sync primitive.
- Not a graph database server — a flat-vault knowledge graph: markdown + YAML frontmatter + wikilinks + Dataview queries at read time. Zero infrastructure.
The vault ($BRAINS_VAULT_DIR, default ~/.hatbrains) is a private git repo. On a new device:
gh repo clone <you>/hatbrains-vault ~/.hatbrains
export BRAINS_VAULT_DIR=~/.hatbrainsvault-init.sh detect (or auto) figures out which case you're in (fresh init vs clone existing).
Worktrees of the same repo share the same vault entries (logical project keying via .brains_in_a_hat/project.json → git remote → basename, in that order).
For multi-repo projects (e.g., PULSE = model + UI + paper), declare a shared projectGroup in each repo's project.json. Cross-repo learnings land in <projectGroup>--shared--learnings.md.
Open Obsidian to the vault root and you see one index.md with Dataview-driven sections: Active now, This week, Open threads, Recent decisions, Wiki entries, Group rollup. No subdirectories — the whole knowledge graph is a flat directory of markdown files. Cross-references are [[wikilinks]]; structure is frontmatter (type, projectGroup, repoKey, tags, status).
brains-in-a-hat/CLAUDE.md— architecture and hook lifecycle (source of truth for behavior)brains-in-a-hat/agents/— the five teammate persona files (librarian, critic, scout, architect, builder)brains-in-a-hat/hooks/neal-persona.md— Neal's full prompt (orchestrator + meta-analyst)brains-in-a-hat/scripts/vault-init.sh— vault bootstrap helperbrains-in-a-hat/scripts/file-plugin-issue.sh— file issues on the plugin repo from any project (used by Builders viaUPSTREAM-ISSUE-REQUEST:sentinel)
If you fork this, set these topics for discoverability:
claude-code, claude-code-plugin, claude-code-agents, agent-team, multi-agent, obsidian, obsidian-sync, ai-agents, agentic-ai, anthropic, self-improvement, external-memory, prompt-engineering, developer-tools, closed-loop-agents.
MIT.