Claude Code panes as data: which tmux pane runs which Claude session, how full its context is, and whether it is working.
Strata: Collect list-raw / capture tmux reads through the host port Promote parse-panes / join-session / goal-text / pane-row pure Boundary panes / pane one call that does all of it
Three sources are joined, because no single one is enough: tmux list-panes pane id, target, cwd, title sessions/<pid>.json session id, name, busy|idle (Claude Code's own word) the pane's screen context tokens, /goal active, spinner
A bg session's process is not a child of the pane that shows it, so the join is by name: the footer rule (or the pane title) names the session, the same name ListAgents prints. cwd breaks a tie between equal names.
Claude Code panes as data: which tmux pane runs which Claude session, how full its context is, and whether it is working. Strata: Collect list-raw / capture tmux reads through the host port Promote parse-panes / join-session / goal-text / pane-row pure Boundary panes / pane one call that does all of it Three sources are joined, because no single one is enough: tmux list-panes pane id, target, cwd, title sessions/<pid>.json session id, name, busy|idle (Claude Code's own word) the pane's screen context tokens, /goal active, spinner A bg session's process is not a child of the pane that shows it, so the join is by name: the footer rule (or the pane title) names the session, the same name ListAgents prints. cwd breaks a tie between equal names.
(capture {:keys [tmux!]} pane-id lines)The last LINES screen lines of PANE-ID, trailing blanks trimmed.
The last LINES screen lines of PANE-ID, trailing blanks trimmed.
(claude-pane? {:keys [command]})Is tmux PANE running Claude Code? Its foreground command names it, or its
process title is the Claude Code version (2.1.319).
Is tmux PANE running Claude Code? Its foreground command names it, or its process title is the Claude Code version (`2.1.319`).
(goal-text lines)The text of the latest /goal LINES (a transcript, oldest first) set, or nil
when the latest /goal cleared it or none was ever set. A raw line is only a
candidate; the marker is checked again on the decoded content, because a
JSON writer may spell / as \/.
The text of the latest /goal LINES (a transcript, oldest first) set, or nil when the latest /goal cleared it or none was ever set. A raw line is only a candidate; the marker is checked again on the decoded content, because a JSON writer may spell `/` as `\/`.
(join-session sessions name cwd)The session of SESSIONS that NAME names, preferring one whose cwd is CWD. {:session map :ambiguous? bool}, or nil when NAME matches none.
The session of SESSIONS that NAME names, preferring one whose cwd is CWD.
{:session map :ambiguous? bool}, or nil when NAME matches none.(last-assistant-text lines)The text of the newest assistant message in LINES (a transcript, oldest first) that says something: thinking and tool calls are skipped. Nil when there is none.
The text of the newest assistant message in LINES (a transcript, oldest first) that says something: thinking and tool calls are skipped. Nil when there is none.
(list-raw {:keys [tmux!]})Every pane on the server, as parse-panes rows.
Every pane on the server, as `parse-panes` rows.
(pane ref)(pane h ref)(pane h ref opts)The row of the pane REF names: a pane id (%3), a target (1:3.1), a session name or a session id. Nil when none matches.
The row of the pane REF names: a pane id (%3), a target (1:3.1), a session name or a session id. Nil when none matches.
(pane-row pane facts sessions)One pane's row from its tmux PANE map, its SCREEN facts and SESSIONS.
One pane's row from its tmux PANE map, its SCREEN facts and SESSIONS.
(panes)(panes h)(panes h {:keys [include-goal? lines] :or {lines 40}})Every Claude Code pane as a row. OPTS: :include-goal? also read each goal-active pane's transcript for :goal :lines screen lines to read (default 40)
Every Claude Code pane as a row. OPTS: :include-goal? also read each goal-active pane's transcript for :goal :lines screen lines to read (default 40)
(parse-panes out)Rows of tmux list-panes -a -F list-format OUT, one map per pane.
Rows of `tmux list-panes -a -F list-format` OUT, one map per pane.
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 |