docs/public/troubleshooting.mdx
Describe any issues you're experiencing to Claude, and the troubleshoot skill will automatically activate to provide diagnosis and fixes.
The troubleshoot skill will:
The skill includes comprehensive diagnostics, automated repair sequences, and detailed troubleshooting workflows for all common issues. Simply describe the problem naturally to invoke it.
Symptoms: Cannot reach the viewer URL, page doesn't load, or browser shows a connection error.
Solutions:
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:
PORT=$(jq -r .CLAUDE_MEM_WORKER_PORT ~/.claude-mem/settings.json)
lsof -i :$PORT
npm run worker:status
Verify worker is healthy:
curl http://127.0.0.1:$PORT/health
Check worker logs for errors:
npm run worker:logs
Restart worker service:
npm run worker:restart
Pin a fixed port if the auto-assigned one collides:
export CLAUDE_MEM_WORKER_PORT=38000
npm run worker:restart
Symptoms: Theme preference (light/dark mode) resets after browser refresh.
Solutions:
Check browser localStorage is enabled:
// In browser console
localStorage.getItem('claude-mem-settings')
Verify settings endpoint is working:
curl http://localhost:37777/api/settings
Clear localStorage and try again:
// In browser console
localStorage.removeItem('claude-mem-settings')
Check for browser privacy mode (blocks localStorage)
Symptoms: Viewer shows "Disconnected" status, updates not appearing in real-time.
Solutions:
Check SSE endpoint is accessible:
curl -N http://localhost:37777/stream
Check browser console for errors:
Verify worker is running:
npm run worker:status
Check for network/proxy issues blocking SSE
Restart worker and refresh browser:
npm run worker:restart
windowsHide fixesSymptoms: On Windows 11, Claude-Mem hooks or worker subprocesses still create short-lived terminal windows on every tool use, even when the spawned process uses windowsHide: true. The flashing windows may show up as Windows Terminal / Cascadia windows rather than classic conhost.exe windows.
Why it happens: windowsHide: true suppresses classic Console Host windows, but it does not hide windows created by Windows Terminal when Windows Terminal is configured as the system default terminal host.
Solution:
Switch Windows' default terminal application to Windows Console Host:
Keep the Claude-Mem windowsHide subprocess fixes in place. Both pieces matter:
windowsHide effective for short-lived subprocesses.windowsHide: true still needs to be present on hook, worker, git, Bun, and daemon spawns.For scripted/registry-managed environments, the same default-terminal setting maps to HKCU\Console\%Startup DelegationConsole and DelegationTerminal values for Windows Console Host. Prefer the UI path above unless you already manage this setting centrally.
If the flashing continues after switching to Windows Console Host, capture the process/window class that appears during a hook fire. A CASCADIA_HOSTING_WINDOW_CLASS window points back to Windows Terminal hosting; classic console flashes usually mean another spawn site is still missing windowsHide: true.
Symptoms: Installation fails with chromadb or Python-related errors.
Solutions:
Verify Python 3.8+ is installed:
python --version
# or
python3 --version
Install chromadb manually:
cd ~/.claude/plugins/marketplaces/thedotmack
npm install chromadb
Check chromadb health:
npm run chroma:health
Windows-specific: Ensure Python is in PATH:
where python
# Should show Python installation path
If Chroma continues to fail, hybrid search will gracefully degrade to SQLite FTS5 only
Symptoms: Dependencies not updating after plugin update, stale version marker.
Solutions:
Clear install cache:
rm ~/.claude/plugins/marketplaces/thedotmack/.install-version
Force reinstall:
cd ~/.claude/plugins/marketplaces/thedotmack
npm install --force
Check version marker:
cat ~/.claude/plugins/marketplaces/thedotmack/.install-version
cat ~/.claude/plugins/marketplaces/thedotmack/package.json | grep version
Restart Claude Code after manual install
Symptoms: Worker doesn't start, or worker status shows it's not running.
Solutions:
Check worker status:
npm run worker:status
Try starting manually:
npm run worker:start
Check worker logs for errors:
npm run worker:logs
Full reset:
npm run worker:stop
npm run worker:start
Verify Bun is installed:
which bun
bun --version
Symptoms: Worker fails to start with "port already in use" error.
Solutions:
Check if port 37777 is in use:
lsof -i :37777
Kill process using the port:
kill -9 $(lsof -t -i:37777)
Or use a different port:
export CLAUDE_MEM_WORKER_PORT=38000
npm run worker:restart
Verify new port:
curl -s http://127.0.0.1:$CLAUDE_MEM_WORKER_PORT/api/health | jq .port
Symptoms: Worker restarts repeatedly or fails to stay running.
Solutions:
Check error logs:
npm run worker:logs
Check worker status:
npm run worker:status
Check database for corruption:
sqlite3 ~/.claude-mem/claude-mem.db "PRAGMA integrity_check;"
Verify Bun installation:
bun --version
Symptoms: Observations saved but not processed, no summaries generated.
Solutions:
Check worker is running:
npm run worker:status
Check worker logs:
npm run worker:logs
Verify database has observations:
sqlite3 ~/.claude-mem/claude-mem.db "SELECT COUNT(*) FROM observations;"
Restart worker:
npm run worker:restart
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:
# Check queue status and prompt for recovery
bun scripts/check-pending-queue.ts
# Auto-process without prompting
bun scripts/check-pending-queue.ts --process
# Process up to 5 sessions
bun scripts/check-pending-queue.ts --process --limit 5
What it does:
--process flag used)Interactive Example:
Worker is healthy ✓
Queue Summary:
Pending: 12 messages
Processing: 2 messages (1 stuck)
Failed: 0 messages
Recently Processed: 5 messages in last 30 minutes
Sessions with pending work: 3
Session 44: 5 pending, 1 processing (age: 2m)
Session 45: 4 pending, 1 processing (age: 7m - STUCK)
Session 46: 2 pending
Would you like to process these pending queues? (y/n)
For automation or scripting scenarios:
Check queue status:
curl http://localhost:37777/api/pending-queue
Response shows:
queue.totalPending: Messages waiting to processqueue.totalProcessing: Messages currently processingqueue.stuckCount: Processing messages >5 minutes oldsessionsWithPendingWork: Session IDs needing recoveryTrigger manual recovery:
curl -X POST http://localhost:37777/api/pending-queue/process \
-H "Content-Type: application/json" \
-d '{"sessionLimit": 10}'
Response includes:
totalPendingSessions: Total sessions with pending messagessessionsStarted: Number of sessions we started processingsessionsSkipped: Sessions already processing (not restarted)startedSessionIds: Database IDs of sessions startedMessages progress through these states:
Stuck Detection: Messages in processing state for >5 minutes are considered stuck and automatically reset to pending on worker startup (but not automatically reprocessed).
When to use manual recovery:
Best practices:
npm run worker:logsIf recovery fails or messages remain stuck:
Verify worker is healthy:
curl http://localhost:37777/health
# Should return: {"status":"ok","uptime":12345,"port":37777}
Check database for corruption:
sqlite3 ~/.claude-mem/claude-mem.db "PRAGMA integrity_check;"
View stuck messages directly:
sqlite3 ~/.claude-mem/claude-mem.db "
SELECT id, session_db_id, status, retry_count,
(strftime('%s', 'now') * 1000 - started_processing_at_epoch) / 60000 as age_minutes
FROM pending_messages
WHERE status = 'processing'
ORDER BY started_processing_at_epoch;
"
Force reset stuck messages (nuclear option):
sqlite3 ~/.claude-mem/claude-mem.db "
UPDATE pending_messages
SET status = 'pending', started_processing_at_epoch = NULL
WHERE status = 'processing';
"
Then trigger recovery:
bun scripts/check-pending-queue.ts --process
Check worker logs for SDK errors:
npm run worker:logs | grep -i error
The pending_messages table tracks all messages with these key fields:
CREATE TABLE pending_messages (
id INTEGER PRIMARY KEY,
session_db_id INTEGER, -- Foreign key to sdk_sessions
claude_session_id TEXT, -- Claude session ID
message_type TEXT, -- 'observation' | 'summarize'
status TEXT, -- 'pending' | 'processing' | 'processed' | 'failed'
retry_count INTEGER, -- Current retry attempt (max: 3)
created_at_epoch INTEGER, -- When message was queued
started_processing_at_epoch INTEGER, -- When marked 'processing'
completed_at_epoch INTEGER -- When completed/failed
)
Query examples:
# Count messages by status
sqlite3 ~/.claude-mem/claude-mem.db "
SELECT status, COUNT(*)
FROM pending_messages
GROUP BY status;
"
# Find sessions with pending work
sqlite3 ~/.claude-mem/claude-mem.db "
SELECT session_db_id, COUNT(*) as pending_count
FROM pending_messages
WHERE status IN ('pending', 'processing')
GROUP BY session_db_id;
"
# View recent failures
sqlite3 ~/.claude-mem/claude-mem.db "
SELECT id, session_db_id, message_type, retry_count,
datetime(completed_at_epoch/1000, 'unixepoch') as failed_at
FROM pending_messages
WHERE status = 'failed'
ORDER BY completed_at_epoch DESC
LIMIT 10;
"
Symptoms: No context appears, observations not saved.
Solutions:
Verify hooks are configured:
cat plugin/hooks/hooks.json
Test hooks manually:
# Test context hook
echo '{"session_id":"test-123","cwd":"'$(pwd)'","source":"startup"}' | node plugin/scripts/context-hook.js
Check hook permissions:
ls -la plugin/scripts/*.js
Verify hooks.json is valid JSON:
cat plugin/hooks/hooks.json | jq .
Symptoms: No session context when Claude starts.
Solutions:
Check if summaries exist:
sqlite3 ~/.claude-mem/claude-mem.db "SELECT COUNT(*) FROM session_summaries;"
View recent sessions:
npm run test:context:verbose
Check database integrity:
sqlite3 ~/.claude-mem/claude-mem.db "PRAGMA integrity_check;"
Manually test context hook:
npm run test:context
Symptoms: Hook execution times out, errors in Claude Code.
Solutions:
Increase timeout in plugin/hooks/hooks.json:
{
"timeout": 180 // Increase from 120
}
Check worker is running (prevents timeout waiting for worker):
npm run worker:status
Check database size (large database = slow queries):
ls -lh ~/.claude-mem/claude-mem.db
Optimize database:
sqlite3 ~/.claude-mem/claude-mem.db "VACUUM;"
Symptoms: SessionStart hook fails with "module not found" errors.
Solutions:
Manually install dependencies:
cd ~/.claude/plugins/marketplaces/thedotmack
npm install
Check npm is available:
which npm
npm --version
Check package.json exists:
ls -la ~/.claude/plugins/marketplaces/thedotmack/package.json
Symptoms: "database is locked" errors in logs.
Solutions:
Close all connections:
npm run worker:stop
Check for stale locks:
lsof ~/.claude-mem/claude-mem.db
Kill processes holding locks:
kill -9 <PID>
Restart worker:
npm run worker:start
Symptoms: Integrity check fails, weird errors.
Solutions:
Check database integrity:
sqlite3 ~/.claude-mem/claude-mem.db "PRAGMA integrity_check;"
Backup database:
cp ~/.claude-mem/claude-mem.db ~/.claude-mem/claude-mem.db.backup
Try to repair:
sqlite3 ~/.claude-mem/claude-mem.db "VACUUM;"
Nuclear option - recreate database:
rm ~/.claude-mem/claude-mem.db
npm run worker:start # Will recreate schema
Symptoms: Search returns no results, FTS5 errors.
Solutions:
Check FTS5 tables exist:
sqlite3 ~/.claude-mem/claude-mem.db "SELECT name FROM sqlite_master WHERE type='table' AND name LIKE '%_fts';"
Rebuild FTS5 tables:
sqlite3 ~/.claude-mem/claude-mem.db "
INSERT INTO observations_fts(observations_fts) VALUES('rebuild');
INSERT INTO session_summaries_fts(session_summaries_fts) VALUES('rebuild');
INSERT INTO user_prompts_fts(user_prompts_fts) VALUES('rebuild');
"
Check triggers exist:
sqlite3 ~/.claude-mem/claude-mem.db "SELECT name FROM sqlite_master WHERE type='trigger';"
Symptoms: Slow performance, large database file.
Solutions:
Check database size:
ls -lh ~/.claude-mem/claude-mem.db
Vacuum database:
sqlite3 ~/.claude-mem/claude-mem.db "VACUUM;"
Delete old sessions:
sqlite3 ~/.claude-mem/claude-mem.db "
DELETE FROM observations WHERE created_at_epoch < $(date -v-30d +%s);
DELETE FROM session_summaries WHERE created_at_epoch < $(date -v-30d +%s);
DELETE FROM sdk_sessions WHERE created_at_epoch < $(date -v-30d +%s);
"
Rebuild FTS5 after deletion:
sqlite3 ~/.claude-mem/claude-mem.db "
INSERT INTO observations_fts(observations_fts) VALUES('rebuild');
INSERT INTO session_summaries_fts(session_summaries_fts) VALUES('rebuild');
"
Symptoms: MCP search tools not visible in Claude Code.
Solutions:
Check MCP configuration:
cat plugin/.mcp.json
Verify search server is built:
ls -l plugin/scripts/mcp-server.cjs
Rebuild if needed:
npm run build
Restart Claude Code
Symptoms: Valid queries return empty results.
Solutions:
Check database has data:
sqlite3 ~/.claude-mem/claude-mem.db "SELECT COUNT(*) FROM observations;"
Verify FTS5 tables populated:
sqlite3 ~/.claude-mem/claude-mem.db "SELECT COUNT(*) FROM observations_fts;"
Test simple query:
# Test MCP search tool
search(query="test", limit=5)
Check query syntax:
# Bad: Special characters may cause issues
search(query="[test]")
# Good: Simple words
search(query="test")
Symptoms: "exceeded token limit" errors from MCP.
Solutions:
Follow 3-layer workflow (don't skip to get_observations):
# Start with search to get index
search(query="...", limit=10)
# Review IDs, then fetch only relevant ones
get_observations(ids=[<2-3 relevant IDs>])
Reduce limit in search:
search(query="...", limit=3)
Use filters to narrow results:
search(query="...", type="decision", limit=5)
Paginate results:
# First page
search(query="...", limit=5, offset=0)
# Second page
search(query="...", limit=5, offset=5)
Batch IDs in get_observations:
# Always batch multiple IDs in one call
get_observations(ids=[123, 456, 789])
# Don't make separate calls per ID
Symptoms: SessionStart hook takes too long.
Solutions:
Reduce context sessions:
// In src/hooks/context.ts
const CONTEXT_SESSIONS = 5; // Reduce from 10
Optimize database:
sqlite3 ~/.claude-mem/claude-mem.db "
ANALYZE;
VACUUM;
"
Add indexes (if missing):
sqlite3 ~/.claude-mem/claude-mem.db "
CREATE INDEX IF NOT EXISTS idx_sessions_project_created ON sdk_sessions(project, created_at_epoch DESC);
"
Symptoms: MCP search tools take too long.
Solutions:
Symptoms: Worker uses too much memory.
Solutions:
Check current usage:
npm run worker:status
Restart worker:
npm run worker:restart
Clean up old data (see "Database Too Large" above)
Symptoms: /plugin install claude-mem fails.
Solutions:
Add marketplace first:
/plugin marketplace add thedotmack/claude-mem
Then install:
/plugin install claude-mem
Verify installation:
ls -la ~/.claude/plugins/marketplaces/thedotmack/
Symptoms: npm run build fails.
Solutions:
Clean and reinstall:
rm -rf node_modules package-lock.json
npm install
Check Node.js version:
node --version # Should be >= 20.0.0
Check for TypeScript errors:
npx tsc --noEmit
Symptoms: "Cannot find module" errors.
Solutions:
Install dependencies:
npm install
Check package.json:
cat package.json
Verify node_modules exists:
ls -la node_modules/
export DEBUG=claude-mem:*
npm run worker:restart
npm run worker:logs
Trace observations through the pipeline:
sqlite3 ~/.claude-mem/claude-mem.db "
SELECT correlation_id, tool_name, created_at
FROM observations
WHERE session_id = 'YOUR_SESSION_ID'
ORDER BY created_at;
"
# Check if worker is running
npm run worker:status
# View logs
npm run worker:logs
# Check configured port (per-user default = 37700 + uid % 100)
jq -r .CLAUDE_MEM_WORKER_PORT ~/.claude-mem/settings.json
# Test worker health (substitute PORT for the value above)
curl "http://127.0.0.1:$PORT/health"
sqlite3 ~/.claude-mem/claude-mem.db
# View schema
.schema
# Check table counts
SELECT 'sessions', COUNT(*) FROM sdk_sessions
UNION ALL
SELECT 'observations', COUNT(*) FROM observations
UNION ALL
SELECT 'summaries', COUNT(*) FROM session_summaries
UNION ALL
SELECT 'prompts', COUNT(*) FROM user_prompts;
# View recent activity
SELECT created_at, tool_name FROM observations ORDER BY created_at DESC LIMIT 10;
Cause: Worker not running or port mismatch.
Solution: Restart worker with npm run worker:restart.
Cause: Multiple processes accessing database.
Solution: Stop worker, kill stale processes, restart.
Cause: Invalid search query syntax.
Solution: Use simpler query, avoid special characters.
Cause: Database file permissions or missing directory.
Solution: Check ~/.claude-mem/ exists and is writable.
Cause: Missing dependencies.
Solution: Run npm install.
If none of these solutions work:
Check logs:
npm run worker:logs
Create issue: GitHub Issues
Check existing issues: Someone may have already solved your problem