Codex session snapshots and MCP-first agent wiring
Codex can now opt into the same SessionStart snapshot Claude Code gets, and wired agent files prefer an authenticated brain MCP when one is connected.
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).
- The 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.
- The generated command contains an absolute project path: uninstall before moving a project, then reinstall.
Improvements
- Wired agent files now state how to invoke the bundled Node CLI when
brainis not onPATH(node <brain-page-skill-dir>/bin/brain.mjs …).
Install notes
- Prefer a global install if you want bare
brainonPATH;npxalone does not leavebrainonPATH. - Existing installs: bump to
@mindmux/[email protected], then runbrain setup -y. - Already-wired projects: run
brain wirein the project root to refresh the companion block.