a73x

4687e980

docs: CLAUDE.md names the no-read-starts-a-daemon invariant

a73x   2026-08-28 19:53

Commit message
docs: CLAUDE.md names the no-read-starts-a-daemon invariant

CLAUDE.md
Old New
@@ -139,6 +139,15 @@ real pty), `wsclient` (browser stand-in), `rawmode`, `delaypipe`, `render`.
139 per machine is the accepted cost. `muxd run` exits 0 on every shutdown — 139 per machine is the accepted cost. `muxd run` exits 0 on every shutdown —
140 a supervisor reads nonzero on a clean stop as a crash — and nonzero only 140 a supervisor reads nonzero on a clean stop as a crash — and nonzero only
141 for the boot failures `main.run` picks before anything binds. 141 for the boot failures `main.run` picks before anything binds.
142 - **A daemon starts only when someone asks; a read never starts one.**
143 `muxd start`, or the local client's own entry spawn, are the only
144 starters. `muxd endpoint` and `muxd proxy` answer what is on the box and
145 exit 1 when nothing is — the wall polls `endpoint` over ssh once a second
146 per host, and a poll that started daemons undid every remote `muxd stop`
147 within a second (found on a live box). The dial a user ASKED for — the
148 `mux HOST` entry dial, picker Enter — runs `ssh HOST 'muxd start'` once
149 and redials once (`HandoffTarget.asked`, spent after the first attempt);
150 the poll, `mux hosts` and every redial read `unreachable` instead.
142 - **The layout sidecar is derived convenience, not authored intent.** 151 - **The layout sidecar is derived convenience, not authored intent.**
143 `$XDG_STATE_HOME/mux/layout` stores the pane tree on last detach, from 152 `$XDG_STATE_HOME/mux/layout` stores the pane tree on last detach, from
144 every wall left on a TERMINAL (`shared.is_tty`) — a piped `mux` is a wall 153 every wall left on a TERMINAL (`shared.is_tty`) — a piped `mux` is a wall