Agent skill

Brain Setup

by mindmuxai in mindmuxai/brain.md

Bootstrap the Open Project Brain Standard into the current project — prefer brain init (ensure BRAIN.md, scaffold empty brain brainRoot-aware, default-wire CLAUDE.md + AGENTS.md).

Apache-2.0Auto-check passedAgent Workflows

Install Brain Setup

skills CLI
$ npx skills add mindmuxai/brain.md --skill brain-setup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mindmuxai/brain.md brain-setup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mindmuxai/brain.md.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/brain-setup .claude/skills/brain-setup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
brain-setup
GitHub stars
564
Token cost
~2.7k tokens
SKILL.md length
1,382 words
Files
12 (incl. assets)
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

Bootstrap the Open Project Brain Standard into the current project — prefer brain init (ensure BRAIN.md, scaffold empty brain brainRoot-aware, default-wire CLAUDE.md + AGENTS.md).

  • Works in 5 steps: Ensure BRAIN.md (the protocol document)… → Resolve the brain data location, then… → Wire the agent-config files via brain… → …
  • Tasks that involve Agent instruction files
  • SKILL.md covers Steps and After setup
  • Calls node and git

What it does

Brain Setup is an agent skill from mindmuxai/brain.md. Bootstrap the Open Project Brain Standard into the current project — prefer brain init (ensure BRAIN.md, scaffold empty brain brainRoot-aware, default-wire CLAUDE.md + AGENTS.md). Optionally install a pre-commit hook and a Claude Code or Codex SessionStart hook.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files, including assets (for example `assets/BRAIN.md`, `assets/brain/architecture.md` and `assets/brain/background.md`).

It sits in Agent Workflows, covering Agent instruction files. The repository describes itself as: A persistent, file-based memory layer for coding agents — give Claude Code, Codex & others a project brain (durable decisions, requirements, constraints) via a zero-dependency CLI. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Agent instruction files

Example prompts

  • “/brain-setup”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Ensure BRAIN.md (the protocol document) is in the project root
  2. Resolve the brain data location, then scaffold there only if empty
  3. Wire the agent-config files via brain wire (default both files)
  4. Optionally install a pre-commit hook
  5. Optionally install a SessionStart hook

What it can do on your machine

Read from SKILL.md and the folder at commit 8064f33. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.chatgpt.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Brain Setup loads about 2.7k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 1,382 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mindmuxai/brain.md at commit 8064f33, republished under its Apache-2.0 licence (© mindmuxai). 1,382 words, ~2,654 tokens.

Download SKILL.mdSave it as .claude/skills/brain-setup/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
brain-setup
description
Bootstrap the Open Project Brain Standard into the current project — prefer `brain init` (ensure BRAIN.md, scaffold empty brain brainRoot-aware, default-wire CLAUDE.md + AGENTS.md). Optionally install a pre-commit hook and a Claude Code or Codex SessionStart hook.

brain-setup

This skill bootstraps a project into the Open Project Brain Standard: it drops in the protocol entry point and the brain/ skeleton so the brain-page and brain-ingest skills (and the brain CLI) have something to work with. It is idempotent — safe to run again on an already-initialized project.

Preferred one-shot path: from the project root run:

node <brain-page-bundle>/bin/brain.mjs init

That command ensures BRAIN.md, scaffolds empty brain data (brainRoot-aware), and default-wires CLAUDE.md + AGENTS.md (create if missing; if present, only update/append the marked brain block — never whole-file overwrite). Use the steps below when you need the optional pre-commit hook, the optional Claude Code or Codex SessionStart hook, or are explaining the flow.

NEVER hand-edit any file under the brain directory. All reads and writes MUST go through the brain CLI. Manual edits are unsupported and illegitimate. This scaffold creates the brain once; from then on every read and write is a brain subcommand. There is no validator and nothing at the file layer can catch a bad manual edit, so a hand edit silently breaks the brain's invariants.

Run this from the target project's root. The skill bundle ships the templates under assets/ and the hook under hooks/; resolve <this-skill-bundle> to the directory this SKILL.md lives in.

Core invariant: there is exactly one brain, at the resolved location. The brain's data directory is location-independent — it lives at ./brain by default, but a MindMux-managed project redirects it via brainRoot in ./.mindmux/preferences.json (often an absolute path to an external sidecar directory). This skill MUST resolve that location before scaffolding, and MUST NOT create a second, local ./brain when a brainRoot is set — doing so produces a split brain (an empty local skeleton shadowing the real external brain). The BRAIN.md protocol document is separate: it always lives in the project root regardless of where the brain data lives.

Steps

1. Ensure BRAIN.md (the protocol document) is in the project root

BRAIN.md is the read/write contract that the agent reads to learn how to use the brain. It always belongs in the project root, independent of where the brain data lives.

  • Present → leave it untouched (never overwrite project content).
  • Absent → copy assets/BRAIN.md → ./BRAIN.md.

Do not stop here just because BRAIN.md exists — its presence says nothing about whether the brain data is set up. Always continue to step 2 to resolve and check the data location.

2. Resolve the brain data location, then scaffold there only if empty

First, resolve where the brain data actually lives — never assume ./brain. Ask the CLI:

node <brain-page-bundle>/bin/brain.mjs brain-dir

(The brain-page skill carries the CLI; in the brain.md source repo it is skills/brain-page/bin/brain.mjs, globally it is e.g. ~/.claude/skills/brain-page/bin/brain.mjs.)

brain brain-dir reads brainRoot from ./.mindmux/preferences.json when present (otherwise falls back to ./brain) and prints, on separate lines: the resolved directory, a human-readable origin, source: (brainRoot or default), exists: (true/false), and populated: (true/false — whether the location already holds a root page or any page under pages/). Read those lines instead of guessing or stat-ing by hand.

Branch on the resolved state:

  • populated: true → the brain already exists. Do NOT scaffold. Tell the user the brain lives at <resolved dir>. If source: brainRoot, make it explicit: "this project's brain is redirected to an external directory (<resolved dir>) and is managed there — leaving it untouched." Then continue to step 3 (wire) and the optional hooks (steps 4–5). Never lay down a local ./brain in this case.

  • populated: false → scaffold the skeleton into the resolved directory (the brainRoot target when redirected, otherwise ./brain). Copy assets/brain/ → <resolved dir>/ — this brings the six root page templates (background / architecture / flow / mindmap / stack / roadmap), a generated index.md, and an empty pages/ directory. Copy each destination file only if it does not already exist (never overwrite). Never create a second local ./brain when source: brainRoot — always scaffold at the resolved path. After copying, run reindex so the index reflects the present pages:

    node <brain-page-bundle>/bin/brain.mjs reindex

    (reindex resolves the same location, so it writes the index in the right place automatically.)

No example pages are scaffolded; the page format is documented in BRAIN.md and the brain-page skill.

3. Wire the agent-config files via brain wire (default both files)

The project's agent-config files must point at BRAIN.md so agents pick up the contract. Wiring is deterministic — done by the CLI, not by hand. Do not hand-write @import lines or template paragraphs. Do not ask which agents to wire — default to both config files unless the user explicitly requests a subset.

Run (default — no --agent required):

node <brain-page-bundle>/bin/brain.mjs wire

Equivalent: wire --agent all. Optional subset: --agent claude-code or comma-separated list. Supported ids: claude-code, codex, opencode, cursor, pi, all.

What the command does (so you can explain it):

  • Default maps to both ./CLAUDE.md (claude-code block with @import) and ./AGENTS.md (shared block for codex / opencode / cursor / pi).
  • Writes one unified, neutral, self-contained brain block — wrapped in <!-- BEGIN brain.md --> … <!-- END brain.md --> — that tells the agent to read ./BRAIN.md, states the session-companion rules (load brain at task start; capture decisions/constraints when they settle during coding; skip pure implementation; reverse/update when overturning; all via the brain CLI; never hand-edit), and notes the four brain skills are installed globally.
  • Claude additionally gets @import ./BRAIN.md; Codex additionally gets native notes/history guidance with current-page reads after context rollover.
  • Idempotent via the markers: absent file → created; existing file without markers → block appended (preserve user content); existing marked block → replaced in place (upgrades, never duplicates). Never whole-file overwrite outside the markers.
Show full SKILL.md (500 more words)Show less
4. Optionally install a pre-commit hook

Offer to install the local index + link backstop (no CI required). Only if the project is a git repository (.git/ exists) and the user agrees:

  • Copy hooks/pre-commit → .git/hooks/pre-commit and make it executable (chmod +x).
  • If a .git/hooks/pre-commit already exists, do not overwrite it — tell the user and show them the hook contents so they can merge it manually.

The hook runs reindex → lint-links on every commit and folds any index changes back in. (There is deliberately no validator — correctness is guaranteed by the CLI being the only way to write.)

5. Optionally install a SessionStart hook

Offer a project-local snapshot of brain list-pages for Claude Code or Codex. When requested, use the CLI merge; never hand-edit hook configuration or install global hooks.

sh
node <brain-page-bundle>/bin/brain.mjs install-hooks                    # Claude Code default
node <brain-page-bundle>/bin/brain.mjs install-hooks --agent codex     # Codex opt-in

Reverse with uninstall-hooks and the same agent flag. Both operations are idempotent and preserve unrelated entries. Claude uses .claude/settings.json; Codex uses .codex/hooks.json. Each gets .claude/hooks/brain-session-start or .codex/hooks/brain-session-start respectively. Foreign scripts and malformed configuration must be repaired by the user before retrying.

Codex requires CLI 0.153.4+ as the supported baseline, Node 18+, POSIX sh/awk, project trust, and review/trust through /hooks. Hooks must be enabled. Leave config.toml, global settings, and trust records untouched. Uninstall before moving the project and reinstall afterwards because the Codex command is absolute.

The script only invokes brain brain-dir and brain list-pages, respecting brainRoot. Missing/unpopulated brains and failures exit 0 silently. Codex gets a five-second timeout and an 8 KiB snapshot with whole UTF-8 rows and a full-index command when truncated; no page bodies are injected. Supported SessionStart sources are startup, resume, clear, and compact. Do not install UserPromptSubmit or Stop hooks.

Astra experimental context management is a separate opt-in via features.context_management.experimental_mode = true, followed by a new task. Check current client/plan eligibility. When native notes/history are available, retain brain page IDs and task state in notes, recover task evidence from history, and re-read current brain facts through the CLI. No hook writes notes or brain data. Experimental rollover delivery and desktop behavior require separate validation; use wired instructions and explicit CLI reads if the client does not expose a supported restoration event.

After setup

The scaffold leaves the brain empty — six root page templates plus an empty pages/. The valuable next step is to seed it with real project knowledge, and that is exactly what the brain-bootstrap skill does:

Recommend the user run the brain-bootstrap skill next. On an existing (brownfield) project it reads the code, docs, and git log to draft the six root pages and capture the key historical decisions; on a near-empty (greenfield) project it interviews the user to seed background and friends. brain-setup does not run it automatically — initialization and knowledge-seeding are separate steps, so the user stays in control of what gets written.

Also point them at: read BRAIN.md, then use the brain-page skill to author or modify pages directly and the brain-ingest skill to digest scattered input into the brain. Every read and write goes through the brain CLI — never hand-edit a brain file.

© mindmuxai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (assets) in skills/brain-setup of mindmuxai/brain.md.

  • SKILL.md
  • assets/BRAIN.md
  • assets/brain/architecture.md
  • assets/brain/background.md
  • assets/brain/flow.md
  • assets/brain/index.md
  • assets/brain/mindmap.md
  • assets/brain/pages/.gitkeep
  • assets/brain/roadmap.md
  • assets/brain/stack.md
  • hooks/pre-commit
  • hooks/session-start

Open the folder on GitHubat commit 8064f33

Compare with similar skills

Brain Setup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Brain Setup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Brain Setup this skillmindmuxai/brain.md564—~2.7kAutomated safety check: PassApache-2.0
Using Agent Skillsaddyosmani/agent-skills103k4 repos~2.4kAutomated safety check: PassMIT
Claude ReflectBayramAnnakov/claude-reflect1.7k2 repos~627Automated safety check: PassMIT
Writing For Agentsbestofjs/bestofjs3.1k19 repos~2.7kAutomated safety check: PassMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
Task Observerrebelytics/one-skill-to-rule-them-all3.2k1 repos~12kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Using Agent Skills

    addyosmani/agent-skills

    Meta-skill for choosing which workflow skill fits the task at hand, plus always-on habits: surface assumptions, stop on confusion, push back, keep it simple and stay in scope.

    103k GitHub starsUsed in 4 repos~2.4k tokens
    Agent WorkflowsAuto-check passed
  • Claude Reflect

    BayramAnnakov/claude-reflect

    Self-learning system that captures corrections during sessions and reminds users to run /reflect to update CLAUDE.md.

    1.7k GitHub starsUsed in 2 repos~627 tokens
    Agent WorkflowsAuto-check passed
  • Writing For Agents

    bestofjs/bestofjs

    Writing documents for agents. An agent skill from bestofjs/bestofjs.

    3.1k GitHub starsUsed in 19 repos~2.7k tokens
    Agent WorkflowsAuto-check passed
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 7 days ago
    Agent WorkflowsAuto-check passed
  • Task Observer

    rebelytics/one-skill-to-rule-them-all

    Monitors task execution for skill improvement opportunities.

    3.2k GitHub starsUsed in 1 repo~12k tokens
    Agent WorkflowsAuto-check passed
  • SkillOpt Sleep Cycle

    microsoft/SkillOpt

    Official

    Runs an on-demand or nightly sleep cycle that reviews past Claude Code sessions and proposes validated updates to CLAUDE.md and skills.

    18k GitHub stars~2.3k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from mindmuxai/brain.md

  • Brain Bootstrap

    mindmuxai/brain.md

    Seed a freshly-scaffolded brain with real project knowledge — on an existing (brownfield) project read the code, docs, and git log to draft the six root pages and capture key historical decisions…

    564 GitHub stars~1.8k tokensUpdated 27 days ago
    Auto-check passed
  • Brain Ingest

    mindmuxai/brain.md

    The process for digesting a conversation, document, or research result, classifying it, and writing it down as brain content (a root-page update or a new/updated page) through the brain CLI.

    564 GitHub stars~1k tokensUpdated 27 days ago
    Auto-check passed
  • Brain Page

    mindmuxai/brain.md

    Operating manual for reading and writing a project's brain — every read and write goes through the bundled zero-dependency brain CLI; never hand-edit brain files.

    564 GitHub stars~2.5k tokensUpdated 27 days ago
    Auto-check passed

Categories

Questions about Brain Setup

What does Brain Setup do?

Bootstrap the Open Project Brain Standard into the current project — prefer brain init (ensure BRAIN.md, scaffold empty brain brainRoot-aware, default-wire CLAUDE.md + AGENTS.md). md.md).

When should I use Brain Setup?

Brain Setup fits situations like: tasks that involve Agent instruction files.

How do I install Brain Setup in Claude Code?

Run `npx skills add mindmuxai/brain.md --skill brain-setup -a claude-code`. Or copy the skill folder (skills/brain-setup in mindmuxai/brain.md) into .claude/skills/brain-setup in your project. Claude Code loads it when a task matches its description.

How do I install Brain Setup in Codex?

Run `npx skills add mindmuxai/brain.md --skill brain-setup -a codex`. Or copy the skill folder (skills/brain-setup in mindmuxai/brain.md) into .agents/skills/brain-setup in your project. Codex loads it when a task matches its description.

Can I use Brain Setup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mindmuxai/brain.md --skill brain-setup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/brain-setup, .gemini/skills/brain-setup, .github/skills/brain-setup and .opencode/skills/brain-setup in your project.

What does Brain Setup need to run?

Going by SKILL.md and its folder, Brain Setup needs the command-line tools its instructions call (node and git).

Does Brain Setup access the network?

SKILL.md names 1 domain. As links in the text: learn.chatgpt.com. This is read from the text; nothing was executed.

Is Brain Setup safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Brain Setup use?

Brain Setup is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Brain Setup use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Brain Setup?

Skills that share tags, products or a category with Brain Setup: Using Agent Skills (addyosmani/agent-skills, 103k stars), Claude Reflect (BayramAnnakov/claude-reflect, 1.7k stars), Writing For Agents (bestofjs/bestofjs, 3.1k stars) and Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Brain Setup?

mindmuxai (a GitHub organization) maintains it in mindmuxai/brain.md, which has 564 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 11, 2026.

Source: mindmuxai/brain.md on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.