Sessions & Memory · recorded 2026-08-29 · applies to 1 tool(s) ✓ Verified

Problem: Repeated SessionStart hook errors in the first session (worker race) —— Trove problem library

Verified 2026-08-29Repeated SessionStart hook errors in the first session are a worker warm-up race — run `claude-mem start && claude-mem status` before opening a session.

Quick fix

# One-liner: warm up the worker before opening a session
claude-mem start && claude-mem status

What you will run into

Right after installing claude-mem, every new session shows 2 SessionStart hook errors and memory sometimes isn't injected. You think the install is broken and reinstall - same result.

It's actually a worker startup race: when multiple hooks fire at once, the worker isn't ready yet (upstream Issue #1447) - a normal post-install phenomenon, not a fault.

Why this happens

claude-mem's worker is a resident process that SessionStart hooks ask for memory. Right after install or boot, the worker is still starting up, and hooks firing too early error out.

The worker not yet ready -- still starting up hint at install completion is exactly this case (seen in measurement) - confirm with claude-mem status instead of reinstalling.

claude-mem is a "main process + resident worker" architecture: the main process (Claude Code plugin) asks the worker for memory via hooks, and the worker is a separate process that takes time to start.

The SessionStart hook fires when the client event happens, not when the worker is ready — right after install or boot the worker is still starting, so the hook arrives first, the worker isn't ready, and you get errors.

This is a classic race (upstream Issue #1447): the two actions (hook firing, worker ready) are unsynchronized, and whichever happens first depends on timing, not on who's right.

The fix is therefore not repairing config but eliminating the race window: warm up with claude-mem start and confirm readiness with claude-mem status before opening sessions, moving "hook fires" after "worker ready".

That's also why "reinstalling didn't help" — reinstall resets the install state, but the race window still exists.

Step by step

1. Warm up the worker — Required

claude-mem start

(Old versions installed globally via npm use npx claude-mem start.)

2. Confirm it's ready — Required

claude-mem status

Open sessions only after the worker shows ready, and the SessionStart hooks won't race ahead.

3. Clean leftover processes if startup fails — Required

lsof -ti :37700 | xargs -r kill -9; pkill -f claude-mem; claude-mem start

Replace with the actual port (see the port-occupation entry: 37700 in this version, 37777 in old docs).

How to confirm it works

claude-mem status

The worker shows ready and new sessions no longer report SessionStart hook errors = success. Measured: the worker not yet ready -- still starting up hint at install completion is normal; status confirms it.

Other environments

EnvironmentNotes
First use right after installWarm up the worker before opening sessions
After rebootSame: claude-mem start + status first
Multiple hooks firing at onceUpstream #1447 race; warming up avoids it
Old versions (npm/pm2)npx claude-mem start; old versions use pm2

Symptom

Each new session starts with 2 SessionStart hook errors; memory sometimes isn't injected.

Cause

Worker startup race (upstream Issue #1447): multiple hooks fire before the worker is ready.

Solution

  1. Warm up: claude-mem start before opening sessions (or npx claude-mem start); confirm claude-mem status shows the worker ready.
  2. If startup fails, clean leftover worker processes first, then start (see the lsof/kill method in symptom 2).
Verification Evidence
  • Upstream Issue #1447; upstream project docs Troubleshooting (lsof/kill to clean leftover processes).
  • Measured in this marketplace: install completion prints worker not yet ready -- still starting up; check claude-mem status later - a normal hint; confirm via status.

Applicable tools (1)

This problem is linked from the tool pages below — reachable from either side.

claude-mem

Bundled solutions (combos)

This problem is part of the following verified bundles.

Source & evidence

Recorded Verified ✓ VerifiedApplies to 1 tool(s)
Entries contain locally measured or reviewable-source solutions; unmeasured items are explicitly labeled.

← Sessions & Memory domain | Problem Catalog Experience | Facing another issue? Go to the Helpdesk