brain.md

作者 mindmuxai已验证

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.

495
Stars
47
Forks
JavaScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/mindmuxai/brain.md

快速入门

使用 brain.md 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

This repository is the toolkit, not a brain itself. Install it once, then in any project run brain init: it scaffolds a BRAIN.md protocol file, a brain/ directory, and default-wires agent config files into your repo. From then on, any coding agent — Claude Code, Codex, anything that reads files — learns to use that brain just by reading the project's BRAIN.md. The brain is plain Markdown, lives in the repo, and outlives every session.

Why a brain

A coding agent's knowledge lives nowhere durable. The reasons behind a decision, the constraints you agreed on, the path not taken — they sit in chat logs and in your head, and they vanish the moment the session ends. The next agent starts from zero.

A brain fixes that. It is the project's persistent memory: the durable decisions, requirements, and constraints, written down as plain Markdown next to the code.

  • Repo-native — Markdown that lives in your project and travels in git, with or without a runtime on top.

  • Agent-agnostic — the contract is a file (BRAIN.md). Any agent that can read it can use the brain.

  • Correct by construction — every write goes through the brain CLI, so the brain's invariants can't be broken by a malformed edit. There is no validator because none is needed.

The test for what belongs in it: will this still matter in six months, and is it hard to reconstruct from the code itself? If yes, it goes in the brain. Pure implementation details and anything readable straight from the code and git history stay where they are.

Quick start

1. Install the tools once (global) — no clone required. This puts brain on your PATH and copies skills into every detected agent (~/.claude/skills, …):

npm install -g @mindmux/brain-md
brain setup -y
# reverse: brain uninstall   # never touches any project's brain data

Prefer not to install globally? Use npx for both steps (npx does not leave brain on your PATH):

npx @mindmux/brain-md setup -y
npx @mindmux/brain-md init          # same as step 2 — not bare `brain init`
# reverse: npx @mindmux/brain-md uninstall

From a git checkout of this repo you can still run ./setup (same installer; use --symlink while developing the toolkit).

2. Initialize a project (from the project root; requires the global install from step 1, or use npx @mindmux/brain-md init above):

brain init
# or, after setup only (no global bin): node ~/.claude/skills/brain-page/bin/brain.mjs init

This ensures BRAIN.md, scaffolds empty brain data (brainRoot-aware), and default-wires CLAUDE.md + AGENTS.md (creates them if missing; if they already exist, only updates the marked brain block — never whole-file overwrite). Optionally use the brain-setup skill for the same flow plus a pre-commit hook, or brain install-hooks for a project-local Claude Code SessionStart snapshot.

3. Seed real knowledge — run the brain-bootstrap skill. On an existing project it reads the code, docs, and git log to draft the root pages and capture key decisions; on a near-empty one it interviews you. (Init leaves content seeding as a deliberate next step.)

4. Work as usual. Maintain the brain while coding: load relevant pages at task start; capture decisions/constraints when they settle; skip pure implementation noise; reverse when overturning. All reads/writes go through the brain CLI following BRAIN.md — never hand-edit brain files.

See it work

The point of a brain is what happens across sessions — a decision made today is still there, with its rationale, weeks later:

You    Let's store config as Markdown, not SQLite — easier to diff and migrate.

Agent  Capturing that as a decision so it outlives this session.
       $ brain create-page --id config-as-markdown --category decision \
             --title "Store config as Markdown, not SQLite"
       ✓ page created · indexed

— three weeks and a fresh session later —

You    Why aren't we using a database for config?

Agent  $ brain read-page config-as-markdown
       We chose Markdown for diff-ability and zero migrations. Here's the original call
       and the trade-offs we weighed …

The brain CLI

Reading and writing the brain both go through one zero-dependency Node CLI (run with node):

brain() { node skills/brain-page/bin/brain.mjs "$@"; }   # or use the global `brain` bin after npm install -g

brain init                                   # BRAIN.md + skeleton + default wire CLAUDE.md / AGENTS.md
brain wire                                   # same default wire (no --agent needed)
brain install-hooks                          # opt-in Claude Code SessionStart snapshot (project-local)
brain uninstall-hooks                        # remove that SessionStart hook
brain brain-dir                              # where is the brain?
brain list-pages                             # list pages
brain read-page my-decision                  # read a page
brain create-page --id my-decision --category decision --title "Use X over Y"
echo "the new understanding" | brain update-truth --id my-decision --summary "why it changed"
brain append-timeline --id my-decision --kind evidence --summary "benchmark confirmed it"
echo "## Overview …" | brain update-root architecture
brain reindex && brain lint-links

A page carries a rewritable compiled_truth (the current best understanding) plus an append-only timeline (the chain of evidence). update-truth rewrites the truth and appends its timeline entry in one atomic write — so the understanding can never change without a trace.

How it works

Three design choices keep the brain durable and tamper-evident:

  • Correct by construction, no validator. The CLI is the only writer. Frontmatter is always generated, and update-truth rewrites understanding + records why in a single atomic write. The two things a validator used to guard are now structurally impossible.

  • Exactly one brain, location-independent. It defaults to ./brain, but a project can redirect it via brainRoot in .mindmux/preferences.json (e.g. an external sidecar). Every command resolves the location itself — tools never create a second, shadow brain.

  • Pure files, portable. The brain is Markdown plus one Node script — it lives in your repo and travels in git, and runtimes (MindMux over MCP, more to come) layer on top of the same files.

The skills that drive it all:

skill what it does

brain-setup same scaffold/wire as brain init, plus optional pre-commit and Claude Code SessionStart hooks — prefer brain init for day-to-day

brain-bootstrap seed the brain from code / docs / git log — or interview you on a greenfield project

brain-page the operating manual for reading and writing pages + root pages (carries the brain CLI)

brain-ingest digest a conversation, document, or research result into the brain

brain.md is led and incubated by MindMux — the standalone open-source landing of MindMux's Brain Spec + coding-agent adapter. The specification layer uses neutral naming so it can be adopted widely; stewardship and maintenance belong to MindMux. Licensed under Apache-2.0.

常见问题

What is brain.md?

brain.md is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by mindmuxai. 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. It has 495 GitHub stars.

Is brain.md safe to use?

Yes. brain.md passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install brain.md?

Clone the repository with "git clone https://github.com/mindmuxai/brain.md" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is brain.md written in?

brain.md is primarily written in JavaScript. It is open-source under mindmuxai on GitHub, so you can review or fork the full source.

Are there alternatives to brain.md?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh brain.md against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情
brain.md — Claude Code AI Skill | SkillTip