-
-
Notifications
You must be signed in to change notification settings - Fork 397
Description
Problem Statement
Since v7.1.0, claude-mem migrated from PM2 to Bun for cross-platform support. However, all troubleshooting documentation still contains PM2-based instructions that no longer work with the current implementation.
Current State Analysis (v7.1.14)
✅ Code Implementation (Correct):
- All hook scripts use
#!/usr/bin/env bunshebang - Worker management uses
startWithBun()method - PID-based process management (
~/.claude-mem/worker.pid) - PM2 cleanup logic implemented (
.pm2-migratedmarker)
❌ Documentation (Outdated):
All troubleshooting operation files reference PM2 extensively:
-
skills/troubleshoot/operations/worker.md(308 lines)- 100% PM2-centric commands
- Examples:
pm2 list,pm2 logs,pm2 restart,pm2 start ecosystem.config.cjs
-
skills/troubleshoot/operations/diagnostics.md(219 lines)- PM2-based diagnostic procedures
- Example workflow uses
pm2 jlist,pm2 start ecosystem.config.cjs
-
skills/troubleshoot/operations/automated-fixes.md(152 lines)- All automated fix scripts use
pm2commands - Example:
pm2 delete claude-mem-worker && npm install && pm2 start ecosystem.config.cjs
- All automated fix scripts use
-
skills/troubleshoot/operations/common-issues.md(233 lines)- Common issue resolutions rely on PM2
- Example:
pm2 jlist | grep claude-mem-worker
User Impact
When users run /troubleshoot or consult troubleshooting docs:
- They receive PM2-based instructions
- Running
pm2commands fails (worker not managed by PM2) - Users attempt to install PM2 unnecessarily
- Confusion and ineffective problem-solving
Proposed Solution
Update all troubleshooting documentation to reflect Bun-based implementation:
Current (PM2 - doesn't work):
pm2 status | grep claude-mem-worker
pm2 restart claude-mem-worker
pm2 logs claude-mem-worker --lines 50 --nostreamShould be (Bun - actual implementation):
# Check worker status
curl -s http://127.0.0.1:37777/health
# Check worker process
cat ~/.claude-mem/worker.pid
# View logs
cat ~/.claude-mem/logs/worker-$(date +%Y-%m-%d).log | tail -50
# Restart worker
# Worker restarts automatically on Claude Code restart
# Or kill process: kill -TERM $(cat ~/.claude-mem/worker.pid | jq -r '.pid')Files Requiring Updates
skills/troubleshoot/operations/worker.mdskills/troubleshoot/operations/diagnostics.mdskills/troubleshoot/operations/automated-fixes.mdskills/troubleshoot/operations/common-issues.md
Additional Context
- Version analyzed: v7.1.14
- Database library correctly documented as
bun:sqliteindatabase.md:9 - Migration completed in code but not in user-facing documentation
- This affects the
/troubleshootskill which users rely on for problem resolution
Evidence
All hook scripts confirm Bun usage:
scripts/cleanup-hook.js:1→#!/usr/bin/env bunscripts/context-hook.js:1→#!/usr/bin/env bunscripts/new-hook.js:1→#!/usr/bin/env bunscripts/save-hook.js:1→#!/usr/bin/env bunscripts/summary-hook.js:1→#!/usr/bin/env bunscripts/user-message-hook.js:1→#!/usr/bin/env bun
Worker management uses Bun spawn:
spawn(bunPath, [workerScript], {
detached: true,
env: { ...process.env, CLAUDE_MEM_WORKER_PORT: String(port) },
// ...
})