Companion block prefers an authenticated brain MCP when one is connected; Codex can opt into the same SessionStart snapshot Claude Code already had.
Highlights
Wire: MCP first, CLI fallback
brain wire / brain init now writes this access rule into AGENTS.md / CLAUDE.md:
Never hand-edit brain files. If a brain MCP server is connected and authenticated, prefer it; otherwise use the
brainCLI.
The standard stays CLI-based. This is one sentence so agents that already have a brain MCP (for example MindMux Cloud Brain) use it; everyone else is unchanged. Existing projects pick it up with brain wire — only the marked companion block is replaced.
brain install-hooks --agent codex
Project-local Codex SessionStart snapshot (startup, resume, clear, compaction). Does not change the Claude Code default.
npx @mindmux/brain-md setup -y
npx @mindmux/brain-md init
npx @mindmux/brain-md install-hooks --agent codexReverse with brain uninstall-hooks --agent codex. Both commands are idempotent.
- Requires Codex CLI 0.153.4+ (older releases were not validated).
- Hook only shells out to
brain brain-dirandbrain list-pages. It never reads or writes brain markdown files. - No-ops when the brain is not populated; any failure exits 0. Codex caps execution at five seconds.
- Injects the compact page list (id / title / category / status), truncated to 8 KiB of complete UTF-8 rows — not page bodies.
- Generated command contains an absolute project path: uninstall before moving a project, then reinstall.
Explicit CLI invocation in the wire block
Wired agent files now state how to invoke the bundled Node CLI when brain is not on PATH (node <brain-page-skill-dir>/bin/brain.mjs …). Fixes #20.
Install notes
- Prefer a global install if you want bare
brainon PATH.npxalone does not leavebrainon PATH. - Existing installs: bump to
@mindmux/brain-md@0.3.0then runbrain setup -y. - Already-wired projects: run
brain wirein the project root to refresh the companion block.
Docs
- README: Codex lifecycle hooks
- Wire block /
brain wire: MCP-prefer sentence - Skill: brain-setup hooks
Links
- Repo: https://github.com/mindmuxai/brain.md
- Homepage: https://projectbrain.md
- Package: https://www.npmjs.com/package/@mindmux/brain-md
License
Apache-2.0 · Incubated by MindMux
What's Changed
- fix: make wired brain CLI invocation explicit by @robinv8 in #21
- feat(hooks): add Codex lifecycle snapshots and bounded context by @robinv8 in #23
- chore: release 0.3.0 by @robinv8 in #24
Full Changelog: v0.2.0...v0.3.0