Pure reading of a Claude Code pane: the captured screen lines of one tmux pane in, the facts a supervisor needs out.
Stratum: Promote. Nothing here touches tmux, the filesystem or a clock; the
lines come from hive-tmux.claude.panes, which is the Boundary.
What the screen carries (Claude Code 2.1.x):
The context count is the bare NNN tokens that opens the status line. The
spinner line also says 29.8k tokens, which is the turn's output, so only a
first segment made of digits and tokens counts.
Matching is plain string work, no regex: every shape here is a fixed glyph or word at a fixed edge of a line.
Pure reading of a Claude Code pane: the captured screen lines of one tmux
pane in, the facts a supervisor needs out.
Stratum: Promote. Nothing here touches tmux, the filesystem or a clock; the
lines come from `hive-tmux.claude.panes`, which is the Boundary.
What the screen carries (Claude Code 2.1.x):
* Working… (26m 48s · ↓ 29.8k tokens) <- spinner line while a turn runs
260803 tokens · ◎ /goal active (26m) <- status line: context size, goal
──────────── caveman skill hydration ─ <- footer rule naming the session
❯ <- the prompt
-- INSERT -- ⏵⏵ auto mode on <- vim mode + permission mode
The context count is the bare `NNN tokens` that opens the status line. The
spinner line also says `29.8k tokens`, which is the turn's output, so only a
first segment made of digits and ` tokens` counts.
Matching is plain string work, no regex: every shape here is a fixed glyph
or word at a fixed edge of a line.(activity-of line)The running-turn text of a spinner LINE (✶ Percolating… (23m 49s · …)), or
nil. The line opens with one non-word glyph, then a word ending in ….
The running-turn text of a spinner LINE (`✶ Percolating… (23m 49s · …)`), or nil. The line opens with one non-word glyph, then a word ending in `…`.
(body lines n)The conversation part of LINES: everything above the prompt minus the
chrome Claude Code draws under it (spinner, finished-turn line, status line,
tip, footer rule), trailing blank lines dropped, at most N lines from the
bottom. A screen with no prompt is returned whole, last N lines. No-break
spaces, which Claude Code draws inside its chrome (⎿ + U+00A0 + Tip:),
read as plain spaces.
The conversation part of LINES: everything above the prompt minus the chrome Claude Code draws under it (spinner, finished-turn line, status line, tip, footer rule), trailing blank lines dropped, at most N lines from the bottom. A screen with no prompt is returned whole, last N lines. No-break spaces, which Claude Code draws inside its chrome (`⎿` + U+00A0 + `Tip:`), read as plain spaces.
(ctx-tokens-of line)The context size a status LINE opens with (260803 tokens · …), or nil.
The context size a status LINE opens with (`260803 tokens · …`), or nil.
(footer-name-of line)The session name on a footer rule LINE (──── name ─), or nil.
The session name on a footer rule LINE (`──── name ─`), or nil.
(goal-of line){:age str-or-nil} when LINE shows an active /goal, else nil.
{:age str-or-nil} when LINE shows an active /goal, else nil.
(read-screen lines)The facts of LINES, a pane capture top to bottom. A screen with no prompt
is :claude? false with every fact nil: not a Claude Code pane, or one
mid-redraw, and either way nothing on it can be trusted.
:input is whatever stands after ❯ on the prompt line. Text there was
typed by someone (or is a dimmed suggestion, which a plain capture cannot
tell apart); a sender must not type over it.
:goal-ended? is true when no goal is active and the screen still shows
Claude Code's Goal achieved line: the pane finished its goal and waits
for new work.
The facts of LINES, a pane capture top to bottom. A screen with no prompt is `:claude? false` with every fact nil: not a Claude Code pane, or one mid-redraw, and either way nothing on it can be trusted. :input is whatever stands after `❯` on the prompt line. Text there was typed by someone (or is a dimmed suggestion, which a plain capture cannot tell apart); a sender must not type over it. :goal-ended? is true when no goal is active and the screen still shows Claude Code's `Goal achieved` line: the pane finished its goal and waits for new work.
What one pane's screen says. A fact is nil when the screen does not say it, which is different from false: an unreadable pane is not an idle one.
What one pane's screen says. A fact is nil when the screen does not say it, which is different from false: an unreadable pane is not an idle one.
(title-name title)The session name in a tmux pane title such as "✳ caveman skill load": the title minus its leading status glyphs. Nil for a blank title.
The session name in a tmux pane title such as "✳ caveman skill load": the title minus its leading status glyphs. Nil for a blank title.
(utrim s)S without leading and trailing space of any kind. str/trim keeps U+00A0,
and Claude Code draws its empty prompt as ❯ + NO-BREAK SPACE, so a plain
trim reads every idle prompt as pending input.
S without leading and trailing space of any kind. `str/trim` keeps U+00A0, and Claude Code draws its empty prompt as `❯` + NO-BREAK SPACE, so a plain trim reads every idle prompt as pending input.
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 |