Skip to content

Disable Claude Code auto memory during setup #27

@chubes4

Description

@chubes4

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

  1. Verify runtime_install_hooks() runs for all setup paths (local, Studio, existing)
  2. Expand CLAUDE.md.tmpl Memory Protocol — reference Data Machine, include {{WP_CLI_CMD}} datamachine agent paths, explicitly note auto memory is disabled
  3. Add memory instructions to SOUL.md scaffold in lib/data-machine.sh so the agent knows how to use its memory regardless of runtime

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions