Quick fix
# One-liner: clear the occupier on this version's actual port (default 37700; old docs say 37777 - confirm from install output first)
kill -9 $(lsof -t -i:37700) 2>/dev/null; pkill -f claude-mem 2>/dev/null; claude-mem status
After running, the worker restarts. On Windows without lsof, use the step-by-step method below (PowerShell).
What you will run into
After a Windows reboot (or installing several agent tools), claude-mem's worker fails to start with Is port 37777 in use? or Address already in use, and the memory UI won't open. You think the software is broken and reinstall it - same result.
In fact the port is taken by a leftover process; nothing to do with the software itself.
Why this happens
claude-mem's worker is a local resident process that listens on a fixed port for UI/plugin communication. Port occupation has three main causes:
| Cause | Notes |
|---|---|
| Leftover process | After a Windows reboot the old worker didn't fully exit and still holds the port |
| Another program | Another tool happens to use the same port |
| TIME_WAIT | The port was just released; the system is waiting for the socket timeout, and an immediate restart is refused |
- Note the port changes with the version: old docs say 37777; the measured version here (plugin 13.16.1) prints
Worker port: 37700at install - check the actual output before troubleshooting, don't hunt the wrong port from old docs. - The fix isn't "reinstall": first see the port -> kill the occupier -> change the port if needed.
A resident worker communicates with the UI/plugin over a fixed-port contract: at startup the worker binds a port, and the UI/plugin connect to that port by convention — the port is their "communication address".
Ports are exclusive resources: only one socket can bind a given address at a time; the second binder gets Address already in use immediately.
The three occupation sources map to three lifecycle problems: leftover process (after a Windows reboot the old worker didn't exit cleanly; the process is still alive and still holds the port), another program (coincidental port collision), TIME_WAIT (the port was just released;
per the TCP spec the kernel must wait before allowing a rebind — protocol requirement, not a fault).
Once "port equals contract" is understood, two conclusions follow naturally: first, the port changes with the version (the contract is decided by the version — 37700 here, 37777 in old docs; trust the install output); second, changing the port is legitimate (the port is claude-mem's own contract;
switching it affects nothing else, just restart the worker after).
Step by step
1. Confirm the actual port — Required
Look at the Worker port: in the install output or claude-mem status - don't assume 37777:
lsof -i :37700 # replace with the actual port; no output = port free
Windows PowerShell:
netstat -ano | findstr 37700
2. Kill the occupying process — Required
macOS/Linux:
kill -9 $(lsof -t -i:37700)
Windows (use the PID from netstat above):
taskkill /F /PID <PID>
3. Still stuck? Change the port — Required
Set an env var, or change it in config:
export CLAUDE_MEM_WORKER_PORT=37701 # or write it to ~/.claude-mem/settings.json
How to confirm it works
claude-mem status prints the version and worker state, and the memory UI opens (measured output shape):
Worker port: 37700
worker runningOther environments
| Environment | Notes | |
|---|---|---|
| Windows / PowerShell | No lsof; use `netstat -ano | findstr 37700 for the PID, taskkill /F /PID` to kill |
| macOS / Linux | lsof -i :37700 + kill -9; same as above | |
| Recurs after reboot | Old worker didn't exit; pkill -f claude-mem first, then start | |
| Unsure of the port | Trust the install output Worker port:; don't copy 37777 from old docs |
Symptom
The worker fails to start, reporting a port in use (common after Windows reboot); the memory UI won't open.
Cause
The old/partial versions' worker uses fixed port 37777, occupied by a leftover process or another program; zombie sockets (TIME_WAIT) not released.
Solution
- Confirm the actual port first (trust the install output /
claude-mem status):lsof -i :37700(this version) orlsof -i :37777(old docs). - Clear the occupier:
kill -9 $(lsof -t -i:37700)(replace with the actual port). - Change the port:
CLAUDE_MEM_WORKER_PORTenv var, or configure it in~/.claude-mem/settings.json.
Verification Evidence
- Upstream Issues #415/#380 (2025-12, port occupation after Windows reboot).
- Measured in this marketplace: this version (plugin 13.16.1) prints
Worker port: 37700at install - the port changes with the version; check the actual output before troubleshooting to avoid hunting the wrong port from old docs.
Applicable tools (1)
This problem is linked from the tool pages below — reachable from either side.
claude-memSource & evidence
← Sessions & Memory domain | Problem Catalog Experience | Facing another issue? Go to the Helpdesk