Skip to content

Tmux Socket Sweep, 2026-05-04

URL: https://mkdocs.justinsforge.com/memory/investigations/tmux-socket-sweep-2026-05-04/

Sweep result

Ran /home/justinwieb/forge/scripts/forge_tmux_socket_sweep.sh at 16:09 CDT.

summary: 9 alive, 0 swept (homebase always preserved)

Nothing cleaned. Every socket in /tmp/tmux-1000/ had a live tmux server behind it.

/tmp/tmux-1000/ before and after (identical)

homebase
spawn-coord-stall-be_Opus47
spawn-coord-stall-debug_Opus47
spawn-extension-host-leak_Opus47
spawn-gcal-reauth_Opus47
spawn-help-with-574e_Opus47
spawn-remind-me-79bd_Opus47
spawn-tmux-socket-sweep_Opus47
spawn-what-all-4e76_Opus47
spawn-what-all-aa3b_Opus47

10 sockets total (1 homebase + 9 spawn-*_Opus47). All passed tmux -S <sock> list-sessions within the 2s timeout, so all are backed by a live server. Zero orphans today.

Dead-socket detection logic

The sweep treats a socket as dead iff:

  1. It is a unix socket (-S).
  2. Its name is not homebase (always preserved).
  3. timeout 2 tmux -S <sock> list-sessions returns non-zero (server gone, or hung past 2s).

Dead sockets are rm -f'd. Live ones are left alone. The orphan-claude reaper (forge-reap-orphan-claudes.timer, 15min) handles the inverse case (claude binary still running but tmux session archived).

Standard operating practice

  • Sweep runs automatically before every /spawn and on a 10-min systemd timer (per script header). No manual invocation needed in normal flow.
  • Manual run: /home/justinwieb/forge/scripts/forge_tmux_socket_sweep.sh. Idempotent, safe to call any time.
  • homebase socket is sacrosanct: never swept, even if the server behind it is dead. If homebase is broken, use /rebridge home-base to republish, do not delete the socket.
  • If the sweep reports swept dead socket: <name> for a socket you expected alive, the tmux server died (OOM, manual kill, host reboot remnant). Cross-check with /sessions list and forge-reap-orphan-claudes logs.
  • Healthy steady state on Console: homebase plus N spawn-*_Opus47 matching the active /spawn count. If N drifts (sockets persist past their session's archive), that's a reaper miss, not a sweep miss; investigate the reaper.

[Claude Code]