Skip to content

Instantly share code, notes, and snippets.

@ogrotten
Created April 23, 2026 14:11
Show Gist options
  • Select an option

  • Save ogrotten/f2819045b52dc7a95171d3a39f262cdc to your computer and use it in GitHub Desktop.

Select an option

Save ogrotten/f2819045b52dc7a95171d3a39f262cdc to your computer and use it in GitHub Desktop.

Claude-Mem Install, Uninstall, and Reinstall: Comprehensive Report

Environment: Ubuntu 24.04.3 LTS, Claude Code VS Code extension, Bun runtime, Node v22

1. Initial Install: Broken Dashboard

What happened

I think the original install fail may have been because I left all 3 IDEs checked for installation. The npx install wasn't clear that it was a checklist, so I just made sure "Claude Code" was highlighted and pressed enter... which installed all 3.

  • Install via plugin marketplace: Claude-mem dashboard stuck on "loading more" with 503 on /stream
  • Install via npx (overwriting): also resulted in dashboard "loading more" with 503

Diagnosis

Log analysis

Examined /home/username/.claude-mem/logs/claude-mem-2026-04-22.log. Key errors:

[ERROR] [SYSTEM] Background initialization failed no such table: observations
[ERROR] [SYSTEM] Fatal error Invalid argument
[ERROR] [WORKER] Request to GET /projects rejected — DB not initialized Database initialization timeout
[ERROR] [WORKER] Request to GET /settings rejected — DB not initialized Database initialization timeout
[ERROR] [WORKER] Request to GET /observations rejected — DB not initialized Database initialization timeout
[WARN ] [HOOK  ] session-init: worker request failed: Request timed out after 3000ms

Root cause

The SQLite database (~/.claude-mem/claude-mem.db) existed but its tables were never created. The observations table was missing, causing every request to fail with "Database initialization timeout". The worker would start but could never serve data, resulting in the 503 on /stream.

Worker restart attempt

Attempted manual restart per the troubleshooting docs:

cd ~/.claude/plugins/cache/thedotmack/claude-mem/9.0.4 && bun scripts/worker-service.cjs start

Result: process immediately returned "Killed" (SIGKILL). Readiness check returned nothing. Initially suspected OOM, but dmesg showed no OOM kills. The real issue was the corrupted/incomplete DB preventing initialization.

2. Uninstall: Death by a Thousand Directories

Decision

Since I had just installed it, reinstall was probably the best course. I was uninterested in keeping data/config. Uninstall took A WHILE. Multiple files in multiple places was a small surprise. The remaining and automatically restarting daemons likely caused initial reinstall failures.

Attempt 1: Basic cleanup

pkill -f "worker-service.cjs"
npm uninstall -g claude-mem
npx clear-npx-cache
rm -rf ~/.claude-mem

Result: npx claude-mem@latest install still prompted to overwrite existing installation. Files remained elsewhere.

Attempt 2: Settings cleanup

Found claude-mem@thedotmack in enabledPlugins and thedotmack marketplace entry in ~/.claude/settings.json. Removed both manually.

Attempt 3: Recurring ghost

After deleting ~/.claude-mem, it kept reappearing within seconds. The active Claude Code session's SessionStart hook (defined in ~/.claude/plugins/cache/thedotmack/claude-mem/12.3.8/hooks/hooks.json) was recreating the directory on every prompt submit. The hook runs smart-install.js and then starts worker-service.cjs --daemon, which recreates the data directory.

Restarting the VS Code window did not help because the session hooks were still loaded.

Attempt 4: Found the daemon processes

Running ps aux | grep claude-mem revealed detached background processes that survived IDE restarts:

/home/username/.bun/bin/bun /home/username/.claude/plugins/cache/thedotmack/claude-mem/12.3.8/scripts/worker-service.cjs --daemon
/home/username/.bun/bin/bun /home/username/.claude/plugins/cache/thedotmack/claude-mem/12.3.8/scripts/mcp-server.cjs
/home/username/.local/bin/uv tool uvx --python 3.13 chroma-mcp --client-type persistent --data-dir /home/username/.claude-mem/chroma

These were forked as detached daemons, not tied to the Claude Code session, so they survived every restart.

Final successful cleanup

Killed all processes, then removed every directory containing claude-mem artifacts:

Processes to kill:

  • worker-service.cjs (bun, detached --daemon)
  • mcp-server.cjs (bun)
  • chroma-mcp (Python subprocess via uv/uvx)

Directories to delete:

  • ~/.claude-mem/ (data, DB, logs, worker PID, settings, supervisor config)
  • ~/.claude/plugins/cache/thedotmack/ (plugin cache with worker scripts)
  • ~/.claude/plugins/marketplaces/thedotmack/ (full git repo clone, source of the daemon scripts)
  • ~/.claude/plugins/data/claude-mem-thedotmack/ (plugin data)
  • ~/.npm/_npx/*/node_modules/claude-mem (npx cache)
  • ~/.cache/claude-cli-nodejs/.../mcp-logs-plugin-claude-mem-* (MCP log cache)
  • ~/.claude/projects/-home-username--claude-mem-observer-sessions (project memory)
  • ~/.config/opencode/plugins/claude-mem.js (opencode plugin)

Settings to clean:

  • ~/.claude/settings.json: remove claude-mem@thedotmack from enabledPlugins and thedotmack from extraKnownMarketplaces

After killing processes and removing all directories, a broad find across ~ confirmed zero remaining traces.

3. Successful Reinstall

Install

Once all remaining traces were removed (many files across 6 different directories), npx claude-mem@latest install ran without asking to overwrite. Taking care to check only the Claude Code IDE option, the install completed as expected.

npx claude-mem@latest install

Post-install observations

  • DB initialized properly: logs showed Creating FTS5 tables, FTS5 tables created successfully, Database initialized
  • Worker healthy: logs confirmed Worker is now healthy, MCP loopback self-check connected
  • Port mismatch: post-install message printed http://localhost:37777 but the actual worker started on port 37700. The install script hardcodes 37777 in its output, but ~/.claude-mem/settings.json configures CLAUDE_MEM_WORKER_PORT: "37700". The port is calculated as 37700 + (uid % 100).
  • Dashboard loaded: http://localhost:37700 showed "no items to display", confirming a working but empty database
  • SessionStart hook errors on first launch: two non-blocking errors ("Failed with non-blocking status code: No stderr output") from the smart-install.js hook. These were cosmetic and resolved after bouncing the Claude Code session.

Hook architecture

The plugin registers 3 SessionStart hooks (in hooks/hooks.json):

  1. smart-install.js: dependency/install check (source of the non-blocking errors)
  2. worker-service.cjs start + health poll loop: starts the daemon, waits up to 20s for /health
  3. Context injection: waits for worker health, then calls worker-service.cjs hook claude-code context

Key Takeaways

  1. The npx installer IDE checklist is unclear: it looks like a selection list but is actually a multi-select checklist. Pressing enter without unchecking installs for all IDEs.
  2. There is no uninstall command: no npx claude-mem uninstall or /plugin uninstall path exists for npx installs. Manual cleanup required.
  3. Daemon processes are detached: worker-service.cjs --daemon forks and survives IDE restarts. Must be killed manually via pkill -f worker-service.cjs.
  4. Session hooks recreate deleted files: active Claude Code sessions will recreate ~/.claude-mem/ on every prompt submit until the session is fully terminated.
  5. Artifacts spread across 6+ directories: a single install touches ~/.claude-mem, ~/.claude/plugins/cache, ~/.claude/plugins/marketplaces, ~/.claude/plugins/data, ~/.npm/_npx, and ~/.cache/claude-cli-nodejs.
  6. Post-install URL is wrong: the displayed port doesn't match the configured port.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment