Skip to content

BEARLY-HODLING/mirrorclaude-mem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mirrorclaude-mem

Patches and documentation for running dual claude-mem instances alongside a dual Claude Code installation.

Background

This repository provides fixes for running two independent claude-mem instances when using a mirror Claude Code setup (claude + mclaude).

Related Projects

The Problem

The claude-mem plugin uses bundled JavaScript (esbuild output) with hardcoded paths like ".claude-mem". When running a second Claude Code instance (mclaude) with a separate config directory, the plugin:

  1. Reads settings from the wrong location (~/.claude-mem instead of ~/.claude-mem-mclaude)
  2. Connects to the wrong worker port (37777 instead of 37778)
  3. Fails to generate observations for the mclaude instance

The CLAUDE_MEM_DATA_DIR environment variable is set in hooks.json but not read by the bundled scripts.

Solution

Patch all bundled scripts to use .claude-mem-mclaude instead of .claude-mem.

Quick Fix

./scripts/apply-mclaude-patches.sh

Manual Fix

cd ~/.cc-mirror/mclaude/config/plugins/cache/thedotmack/claude-mem/*/scripts
sed -i '' 's/".claude-mem"/".claude-mem-mclaude"/g' *.js *.cjs

Architecture

Main Claude Instance          Mirror Claude Instance (mclaude)
─────────────────────         ───────────────────────────────
Config: ~/.claude/            Config: ~/.cc-mirror/mclaude/config/
Data:   ~/.claude-mem/        Data:   ~/.claude-mem-mclaude/
Port:   37777                 Port:   37778

Files

File Description
FIX-DOCUMENTATION.md Complete root cause analysis and solution
architecture.md System architecture overview
scripts/apply-mclaude-patches.sh Reusable patch script

Verification

# Check both workers running
lsof -i :37777 -i :37778 | grep LISTEN

# Check observation counts
sqlite3 ~/.claude-mem/claude-mem.db "SELECT COUNT(*) FROM observations;"
sqlite3 ~/.claude-mem-mclaude/claude-mem.db "SELECT COUNT(*) FROM observations;"

Notes

  • Patches must be re-applied after plugin updates
  • Consider contributing upstream fix to claude-mem to properly read CLAUDE_MEM_DATA_DIR

License

MIT

About

Patches for running dual claude-mem instances with mclaude

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages