Skip to main content

Troubleshooting Guide

Quick Diagnostic Tool

Describe any issues you’re experiencing to Claude, and the troubleshoot skill will automatically activate to provide diagnosis and fixes. The troubleshoot skill will:
  • ✅ Check worker status and health
  • ✅ Verify database existence and integrity
  • ✅ Test worker service connectivity
  • ✅ Validate dependencies installation
  • ✅ Check port configuration and availability
  • ✅ Provide automated fixes for common issues
The skill includes comprehensive diagnostics, automated repair sequences, and detailed troubleshooting workflows for all common issues. Simply describe the problem naturally to invoke it.

Common Issues

For worker API commands below, set PORT first:

Viewer UI Not Loading

Symptoms: Cannot reach the viewer URL, page doesn’t load, or browser shows a connection error. Solutions:
  1. Find the worker port. The default is 37700 + (uid % 100). The configured port is the value of CLAUDE_MEM_WORKER_PORT in ~/.claude-mem/settings.json; the running worker also reports it on /api/health:
  2. Verify worker is healthy:
  3. Check worker logs for errors:
  4. Restart worker service:
  5. Pin a fixed port if the auto-assigned one collides:

Theme Toggle Not Persisting

Symptoms: Theme preference (light/dark mode) resets after browser refresh. Solutions:
  1. Check browser localStorage is enabled:
  2. Verify settings endpoint is working:
  3. Clear localStorage and try again:
  4. Check for browser privacy mode (blocks localStorage)

SSE Connection Issues

Symptoms: Viewer shows “Disconnected” status, updates not appearing in real-time. Solutions:
  1. Check SSE endpoint is accessible:
  2. Check browser console for errors:
    • Open DevTools (F12)
    • Look for EventSource errors
    • Check Network tab for failed /stream requests
  3. Verify worker is running:
  4. Check for network/proxy issues blocking SSE
    • Corporate firewalls may block SSE
    • Try disabling VPN temporarily
  5. Restart worker and refresh browser:

Chroma/Python Dependency Issues (v5.0.0+)

Symptoms: Installation fails with chromadb or Python-related errors. Solutions:
  1. Verify Python 3.8+ is installed:
  2. Install chromadb manually:
  3. Check chromadb health:
  4. Windows-specific: Ensure Python is in PATH:
  5. If Chroma continues to fail, hybrid search will gracefully degrade to SQLite FTS5 only

Smart Install Caching Issues (v5.0.3+)

Symptoms: Dependencies not updating after plugin update, stale version marker. Solutions:
  1. Clear install cache:
  2. Force reinstall:
  3. Check version marker:
  4. Restart Claude Code after manual install

Worker Service Issues

Worker Service Not Starting

Symptoms: Worker doesn’t start, or worker status shows it’s not running. Solutions:
  1. Check worker status:
  2. Try starting manually:
  3. Check worker logs for errors:
  4. Full reset:
  5. Verify Bun is installed:

Port Allocation Failed

Symptoms: Worker fails to start with “port already in use” error. Solutions:
  1. Check if the configured port is in use:
  2. Kill process using the port:
  3. Or use a different port:
  4. Verify new port:

Worker Keeps Crashing

Symptoms: Worker restarts repeatedly or fails to stay running. Solutions:
  1. Check error logs:
  2. Check worker status:
  3. Check database for corruption:
  4. Verify Bun installation:

Worker Not Processing Observations

Symptoms: Observations saved but not processed, no summaries generated. Solutions:
  1. Check worker is running:
  2. Check worker logs:
  3. Verify database has observations:
  4. Restart worker:

Manual Recovery for Stuck Observations

Symptoms: Observations stuck in processing queue after worker crash or restart, no new summaries appearing despite worker running. Background: As of v5.x, automatic queue recovery on worker startup is disabled. Users must manually trigger recovery to maintain explicit control over reprocessing and prevent unexpected duplicate observations. Solutions: The interactive CLI tool provides the safest and most user-friendly recovery experience:
What it does:
  • ✅ Checks worker health before proceeding
  • ✅ Shows detailed queue summary (pending, processing, failed, stuck)
  • ✅ Groups messages by session with age and status breakdown
  • ✅ Prompts user to confirm processing (unless --process flag used)
  • ✅ Shows recently processed messages for feedback
Interactive Example:

Option 2: Use HTTP API Directly

For automation or scripting scenarios:
  1. Check queue status:
    Response shows:
    • queue.totalPending: Messages waiting to process
    • queue.totalProcessing: Messages currently processing
    • queue.stuckCount: Processing messages >5 minutes old
    • sessionsWithPendingWork: Session IDs needing recovery
  2. Trigger manual recovery:
    Response includes:
    • totalPendingSessions: Total sessions with pending messages
    • sessionsStarted: Number of sessions we started processing
    • sessionsSkipped: Sessions already processing (not restarted)
    • startedSessionIds: Database IDs of sessions started

Understanding Queue States

Messages progress through these states:
  1. pending - Queued, waiting to process
  2. processing - Currently being processed by SDK agent
  3. processed - Completed successfully
  4. failed - Failed after 3 retry attempts
Stuck Detection: Messages in processing state for >5 minutes are considered stuck and automatically reset to pending on worker startup (but not automatically reprocessed).

Recovery Strategy

When to use manual recovery:
  • After worker crashes or unexpected restarts
  • When observations appear saved but no summaries generated
  • When queue status shows stuck messages (processing >5 minutes)
  • After system crashes or forced shutdowns
Best practices:
  1. Always check queue status before triggering recovery
  2. Use the CLI tool for interactive sessions (provides feedback)
  3. Use the HTTP API for automation/scripting
  4. Start with a low session limit (5-10) to avoid overwhelming the worker
  5. Monitor worker logs during recovery: npm run worker:logs
  6. Check recently processed messages to confirm recovery worked

Troubleshooting Recovery Issues

If recovery fails or messages remain stuck:
  1. Verify worker is healthy:
  2. Check database for corruption:
  3. View stuck messages directly:
  4. Force reset stuck messages (nuclear option):
    Then trigger recovery:
  5. Check worker logs for SDK errors:

Understanding the Queue Table

The pending_messages table tracks all messages with these key fields:
Query examples:

Hook Issues

Hooks Not Firing

Symptoms: No context appears, observations not saved. Solutions:
  1. Verify hooks are configured:
  2. Test hooks manually:
  3. Check hook permissions:
  4. Verify hooks.json is valid JSON:

Context Not Appearing

Symptoms: No session context when Claude starts. Solutions:
  1. Check if summaries exist:
  2. View recent sessions:
  3. Check database integrity:
  4. Manually test context hook:

Hooks Timeout

Symptoms: Hook execution times out, errors in Claude Code. Solutions:
  1. Increase timeout in plugin/hooks/hooks.json:
  2. Check worker is running (prevents timeout waiting for worker):
  3. Check database size (large database = slow queries):
  4. Optimize database:

Dependencies Not Installing

Symptoms: SessionStart hook fails with “module not found” errors. Solutions:
  1. Manually install dependencies:
  2. Check npm is available:
  3. Check package.json exists:

Database Issues

Database Locked

Symptoms: “database is locked” errors in logs. Solutions:
  1. Close all connections:
  2. Check for stale locks:
  3. Kill processes holding locks:
  4. Restart worker:

Database Corruption

Symptoms: Integrity check fails, weird errors. Solutions:
  1. Check database integrity:
  2. Backup database:
  3. Try to repair:
  4. Nuclear option - recreate database:

FTS5 Search Not Working

Symptoms: Search returns no results, FTS5 errors. Solutions:
  1. Check FTS5 tables exist:
  2. Rebuild FTS5 tables:
  3. Check triggers exist:

Database Too Large

Symptoms: Slow performance, large database file. Solutions:
  1. Check database size:
  2. Vacuum database:
  3. Delete old sessions:
  4. Rebuild FTS5 after deletion:

MCP Search Issues

Search Tools Not Available

Symptoms: MCP search tools not visible in Claude Code. Solutions:
  1. Check MCP configuration:
  2. Verify search server is built:
  3. Rebuild if needed:
  4. Restart Claude Code

Search Returns No Results

Symptoms: Valid queries return empty results. Solutions:
  1. Check database has data:
  2. Verify FTS5 tables populated:
  3. Test simple query:
  4. Check query syntax:

Token Limit Errors

Symptoms: “exceeded token limit” errors from MCP. Solutions:
  1. Follow 3-layer workflow (don’t skip to get_observations):
  2. Reduce limit in search:
  3. Use filters to narrow results:
  4. Paginate results:
  5. Batch IDs in get_observations:

Performance Issues

Slow Context Injection

Symptoms: SessionStart hook takes too long. Solutions:
  1. Reduce context sessions:
  2. Optimize database:
  3. Add indexes (if missing):

Slow Search Queries

Symptoms: MCP search tools take too long. Solutions:
  1. Use more specific queries
  2. Add date range filters
  3. Add type/concept filters
  4. Reduce result limit
  5. Use index format instead of full format

High Memory Usage

Symptoms: Worker uses too much memory. Solutions:
  1. Check current usage:
  2. Restart worker:
  3. Clean up old data (see “Database Too Large” above)

Installation Issues

Plugin Not Found

Symptoms: /plugin install claude-mem fails. Solutions:
  1. Add marketplace first:
  2. Then install:
  3. Verify installation:

Build Failures

Symptoms: npm run build fails. Solutions:
  1. Clean and reinstall:
  2. Check Node.js version:
  3. Check for TypeScript errors:

Missing Dependencies

Symptoms: “Cannot find module” errors. Solutions:
  1. Install dependencies:
  2. Check package.json:
  3. Verify node_modules exists:

Debugging

Enable Verbose Logging

Check Correlation IDs

Trace observations through the pipeline:

Inspect Worker State

Database Inspection

Common Error Messages

”Worker service not responding”

Cause: Worker not running or port mismatch. Solution: Restart worker with npm run worker:restart.

”Database is locked”

Cause: Multiple processes accessing database. Solution: Stop worker, kill stale processes, restart.

”FTS5: syntax error”

Cause: Invalid search query syntax. Solution: Use simpler query, avoid special characters.

”SQLITE_CANTOPEN”

Cause: Database file permissions or missing directory. Solution: Check ~/.claude-mem/ exists and is writable.

”Module not found”

Cause: Missing dependencies. Solution: Run npm install.

Getting Help

If none of these solutions work:
  1. Check logs:
  2. Create issue: GitHub Issues
    • Include error messages
    • Include relevant logs
    • Include steps to reproduce
  3. Check existing issues: Someone may have already solved your problem

Next Steps