Problem
Claude Code's built-in auto memory runs alongside Data Machine's agent memory. The code handles this in runtime_install_hooks() — but there are gaps in the template instructions and setup path coverage.
What already works
runtimes/claude-code.sh:276 sets autoMemoryEnabled: false in .claude/settings.json
hooks/dm-agent-sync.sh auto-syncs DM agent files into CLAUDE.md via SessionStart
- README documents: "Claude Code's built-in auto-memory is disabled when Data Machine is installed"
Gap 1: runtime_install_hooks() may not run for all setup paths
On a Studio site, the result was:
.claude/settings.json — does not exist
.claude/hooks/ — empty, SessionStart hook never installed
Need to verify the code path for --local + Studio sites. The function may have been added after this site was set up, or the setup path may skip it.
Gap 2: CLAUDE.md.tmpl Memory Protocol is underspecified
Current:
## Memory Protocol
Update MEMORY.md when you learn something persistent — read it first, append.
Doesn't tell the agent:
- That Data Machine is the canonical memory system (not Claude Code auto memory)
- How to discover paths:
{{WP_CLI_CMD}} datamachine agent paths
- That even with
autoMemoryEnabled: false, Claude Code's system prompt still references auto memory — agent instructions must explicitly override
Gap 3: SOUL.md scaffold doesn't mention memory operations
lib/data-machine.sh scaffolds SOUL.md with capabilities and voice, but no memory instructions. The agent doesn't know how to use Data Machine for memory. The workspace/AGENTS.md template has wp datamachine agent paths but this is for OpenCode — the Claude Code path only gets the minimal CLAUDE.md.tmpl.
Proposed Changes
- Verify
runtime_install_hooks() runs for all setup paths (local, Studio, existing)
- Expand CLAUDE.md.tmpl Memory Protocol — reference Data Machine, include
{{WP_CLI_CMD}} datamachine agent paths, explicitly note auto memory is disabled
- Add memory instructions to SOUL.md scaffold in
lib/data-machine.sh so the agent knows how to use its memory regardless of runtime
Problem
Claude Code's built-in auto memory runs alongside Data Machine's agent memory. The code handles this in
runtime_install_hooks()— but there are gaps in the template instructions and setup path coverage.What already works
runtimes/claude-code.sh:276setsautoMemoryEnabled: falsein.claude/settings.jsonhooks/dm-agent-sync.shauto-syncs DM agent files into CLAUDE.md via SessionStartGap 1:
runtime_install_hooks()may not run for all setup pathsOn a Studio site, the result was:
.claude/settings.json— does not exist.claude/hooks/— empty, SessionStart hook never installedNeed to verify the code path for
--local+ Studio sites. The function may have been added after this site was set up, or the setup path may skip it.Gap 2: CLAUDE.md.tmpl Memory Protocol is underspecified
Current:
Doesn't tell the agent:
{{WP_CLI_CMD}} datamachine agent pathsautoMemoryEnabled: false, Claude Code's system prompt still references auto memory — agent instructions must explicitly overrideGap 3: SOUL.md scaffold doesn't mention memory operations
lib/data-machine.shscaffolds SOUL.md with capabilities and voice, but no memory instructions. The agent doesn't know how to use Data Machine for memory. Theworkspace/AGENTS.mdtemplate haswp datamachine agent pathsbut this is for OpenCode — the Claude Code path only gets the minimal CLAUDE.md.tmpl.Proposed Changes
runtime_install_hooks()runs for all setup paths (local, Studio, existing){{WP_CLI_CMD}} datamachine agent paths, explicitly note auto memory is disabledlib/data-machine.shso the agent knows how to use its memory regardless of runtime