Watch Claude Code panes server-side and shout each change, so the agent
that supervises them hears it through sixth-sense (swarm ss wait)
instead of polling tmux.
Strata: Promote step pure: previous pane states + new rows -> states + events Boundary start! / stop! one watcher thread per process, shouts through the host
Events (see hive-tmux.claude.sense for the sense classes):
:pane-idle a pane seen working is idle on two ticks in a row
:goal-ended goal-active? went true -> false, or Goal achieved appeared
:context-high ctx-tokens went from under the threshold to at or over it
:pane-waiting the session status went to :waiting (a permission or other
human prompt); once per waiting spell
:tmux-job a compact | say | goal job ended (via job-ended!)
The first tick only seeds: a pane already idle when the watch starts is not
news. Every shout is addressed to :parent, the supervisor's agent id, which
is who ss wait hears by default.
Watch Claude Code panes server-side and shout each change, so the agent
that supervises them hears it through sixth-sense (`swarm ss wait`)
instead of polling tmux.
Strata:
Promote step pure: previous pane states + new rows -> states + events
Boundary start! / stop! one watcher thread per process, shouts through the host
Events (see hive-tmux.claude.sense for the sense classes):
:pane-idle a pane seen working is idle on two ticks in a row
:goal-ended goal-active? went true -> false, or `Goal achieved` appeared
:context-high ctx-tokens went from under the threshold to at or over it
:pane-waiting the session status went to :waiting (a permission or other
human prompt); once per waiting spell
:tmux-job a compact | say | goal job ended (via `job-ended!`)
The first tick only seeds: a pane already idle when the watch starts is not
news. Every shout is addressed to :parent, the supervisor's agent id, which
is who `ss wait` hears by default.(job-ended! job)Shout a finished compact | say | goal JOB to the running watcher's parent. A no-op when no watcher runs: nobody asked to hear it.
Shout a finished compact | say | goal JOB to the running watcher's parent. A no-op when no watcher runs: nobody asked to hear it.
(row-data row)The shout data of an event about ROW.
The shout data of an event about ROW.
(start! {:keys [parent] :as opts})Start (or restart) the watcher. OPTS: :parent (agent id the shouts are addressed to; required), :threshold, :interval-ms, :exclude (refs), :host and :shout-fn (tests).
Start (or restart) the watcher. OPTS: :parent (agent id the shouts are addressed to; required), :threshold, :interval-ms, :exclude (refs), :host and :shout-fn (tests).
(step states rows {:keys [exclude] :as opts})All panes: STATES (pane id -> state) and ROWS now -> {:states :events}. EXCLUDE (a set of refs) drops panes before they are tracked. A pane that vanished is forgotten.
All panes: STATES (pane id -> state) and ROWS now -> {:states :events}.
EXCLUDE (a set of refs) drops panes before they are tracked. A pane that
vanished is forgotten.(stop!)Stop the watcher. Returns its last status, or nil when none ran.
Stop the watcher. Returns its last status, or nil when none ran.
(tick! w)One pass: read the panes, step, shout every event. Returns the events.
One pass: read the panes, step, shout every event. Returns the events.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |