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 brain CLI.

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 codex

Reverse 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-dir and brain 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 brain is not on PATH (node <brain-page-skill-dir>/bin/brain.mjs …).

Install notes

  • Prefer a global install if you want bare brain on PATH; npx alone does not leave brain on PATH.
  • Existing installs: bump to @mindmux/[email protected], then run brain setup -y.
  • Already-wired projects: run brain wire in the project root to refresh the companion block.

Related links

Share to