Skip to content

Wiring your agents

Administrator edited this page Jul 15, 2026 · 2 revisions

Wiring your agents

One command per agent. It installs the lifecycle hooks (persona on session start, relevant memory recalled each turn, a save nudge) and registers the dmem MCP server (the remember / recall / log_* tools), then migrates off any older daimon wiring.

dmem bootstrap --claude          # Claude Code
dmem bootstrap --devin           # Devin CLI
dmem bootstrap --codex           # Codex
dmem bootstrap --hermes          # Hermes
dmem bootstrap --opencode        # OpenCode
dmem bootstrap --grok            # Grok CLI (MCP only, no hooks)
dmem bootstrap --claude-desktop  # Claude Desktop (MCP only, no hooks)
dmem bootstrap --all             # every agent detected
dmem bootstrap --remove --claude   # undo (per agent, or --all)

Per-harness notes

Each harness injects differently, so a few one-time things:

  • Claude, Devin: hooks live in the agent config (~/.claude/settings.json, ~/.config/devin/config.json); the MCP server is added through claude mcp add / devin mcp add. Injection is silent.
  • Codex: MCP lives in ~/.codex/config.toml; the hooks ship as a small plugin that bootstrap installs with codex plugin add (the codex CLI must be on PATH, else run codex plugin add dmem@dmem yourself). On the next session Codex asks once to TRUST the hooks, and it echoes the injected context to the terminal (expected, not a bug).
  • Hermes: MCP lives in ~/.hermes/config.yaml; recall rides a pre_llm_call hook; persona and protocols are projected into ~/.hermes/SOUL.md (Hermes's always-on identity), a snapshot you refresh by re-running dmem bootstrap --hermes after changing them. Restart Hermes once after wiring.
  • OpenCode: bootstrap writes a small TypeScript plugin under ~/.config/opencode (persona on session start, relevant memory recalled each prompt, an idle save nudge) and adds an mcp.dmem entry to your OpenCode config (opencode.jsonc, opencode.json, or config.json, whichever exists). Plugins load at startup, so restart OpenCode once after wiring.
  • Grok CLI (needs a build newer than 0.1.1): MCP only. Grok's hooks are observe/block only and cannot inject context into a session, so there is no hook plugin; bootstrap adds the dmem MCP entry (grok mcp add dmem -- dmem mcp). The persona and protocols ride the MCP initialize instructions where Grok surfaces them, and recall is tool driven: fire the bootstrap and recall prompts, or just ask it to recall.
  • Claude Desktop: MCP only, no hooks, so it gets one mcpServers.dmem entry in claude_desktop_config.json. Without a hook to inject persona each turn, it instead reads the persona and protocols from the MCP server's initialize instructions, and you can pull the current persona plus open reminders on demand with the bootstrap prompt (and recall with the recall prompt). Quit and relaunch Claude Desktop once after wiring; it reads the config only at launch.

Any other client

dm-lite speaks MCP over stdio directly:

dmem mcp

A hook-less MCP client still gets governance, not just tools: the server carries the persona and protocols in its initialize instructions, and exposes a bootstrap prompt (persona, protocols, and open reminders) plus a recall prompt. The save and recall tools include remember, recall, log_*, invalidate, and forget. What it cannot get without a hook is the automatic per-turn recall and the save nudge; fire the bootstrap and recall prompts to pull memory on demand.

One source of governance

dm-lite is where your agents' persona and protocols live; they are projected into each agent at wiring time. A global AGENTS.md (or a stray global CLAUDE.md copy) competes with this and becomes noise: a second, drifting identity. Some tools auto-create one (e.g. Codex desktop writes ~/AGENTS.md on import). If you wire dm-lite, remove or empty any global AGENTS.md you did not deliberately author; keep only the repo-scoped ones you maintain. See "Persona and governance".

Clone this wiki locally