Skip to content

feat(mods): add the read-only Claude Code Fleet mod behind FM_FLEET_ENABLED - #27

Merged
max-metaplanet merged 7 commits into
mainfrom
fm/fleet-mod
Oct 6, 2026
Merged

max-metaplanet merged 7 commits into
mainfrom
fm/fleet-mod

Conversation

@max-metaplanet

@max-metaplanet max-metaplanet commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Intent

Build a Claude Code mod in the firstmate repo: firstmate-fleet.
It provides a /fleet pane, an above-prompt band that appears only when something waits on the captain (a decision, a merge ask, or a blocker), and done/blocked toasts.
It refreshes in the background every 60s via fm-fleet-snapshot.sh --json with an in-flight guard (the snapshot takes about 18-22s, and must never run inside a render hook).
It has a text fallback via the /fleet command for sessions that cannot draw, and it preserves other mods' band content.
Steer (the report's C6) is NOT in scope.
Deploy it under .claude/mods/ the way Calm is, with tests, and with its own activation consistent with the Calm flag fix already in progress.
Ship via the no-mistakes PR path.

The source is a scout report on Claude Code mods, readable at ~/firstmate/data/claude-mods-research/report.md; sections 2 (platform limits), 5 (supervision-session ideas), 8 (build sketches), 9 (gotchas) and 10a (a working firstmate-fleet prototype that printed the real fleet) are the basis.
Calm, the one firstmate mod already shipped, lives at .claude/mods/firstmate-calm/ with a symlink from .agents/skills/, and a trusted project auto-loads it as a skills-dir plugin with no install step.
The report measured two overlapping snapshot runs taking 72s where one takes 18s, which is why the in-flight guard matters, and found that $.ui.open's isPlaced answers placed in a -p run where nothing can draw, so it must not be used to detect a non-drawing session (use the session.start isInteractive value instead).

The substance of the referenced report sections, since the report itself is a private file outside this repository:

Section 2, the platform and its binding limits. A mod is a plugin whose hooks/hooks.json carries a "modules" key, and its handlers run inside Claude Code as middleware that can observe, rewrite, or answer an event. One hook event has a 10 second budget, which the 17.7-21.6 second fleet snapshot exceeds twice over. $.process.run takes an argv array, uses no shell, defaults to a 30 second timeout so the snapshot needs an explicit timeoutMs, caps stdout at 4 MiB, and rejects both when the program cannot start and when it times out. A pane a mod opens unasked needs 144 terminal columns, 110 once the person has opened one by hand. Toasts are transient, 4 seconds by default. Nothing a mod draws is ever seen in a claude -p run, the Agent SDK, a Desktop WSL session, or the VS Code extension's chat panel, so every drawing needs a text fallback. Module-level variables reset on hot reload; $.state survives a reload but is reset by /clear, /resume and /branch; $.store survives everything and is shared by every session on the machine.

Section 5, the three supervision-session ideas this mod is (C1, C2 and C3 of that list). C1 is the decision band: one line above the prompt naming every task with an open decision or a blocked or failed state, and nothing at all when that set is empty, with noise from ever drawing on an empty set named as the main risk. C2 is the fleet pane: one row per task with its state, the source that state was resolved from, its age and its last event, "r" to refresh, read from fm-fleet-snapshot.sh on a timer, with the 18-22 second read kept off the render path and overlapping runs named as the contention risk. C3 is the worker-done or needs-decision toast the moment a task's state word changes, at most one refresh period late, deduplicated on the last announced word so a flapping task cannot toast repeatedly.

Section 8, the build sketch. session.start reads the home, records e.isInteractive as whether anything can be drawn, registers the /fleet command inside try/catch, starts a 60 second clock, and fires one un-awaited refresh so the session starts instantly. refresh runs the snapshot with an explicit timeout behind an in-flight promise, parses it, caches it, diffs the state words against the announced set to toast transitions, then invalidates the drawing. The pane hook, filtered on the fleet request id, draws only the cache. The band hook returns next(e) and draws nothing when nothing is waiting, and awaits next(e) and nests that result above its own line when something is, so other mods' band content survives.

Section 9, the gotchas that bite. The status log is an event history and not a state, and its last line goes stale exactly when a resolved decision lets a crew resume, so only current_state from the snapshot may be printed as a state word. fm-crew-state.sh mints "unreadable" as distinct from "unknown", the reader's claim about itself, and a surface that collapses the two loses a distinction its author built deliberately. Registering the same event twice without a matcher fails the whole module to load. A thrown $.command.register skips the rest of the session.start hook, so commands are registered last or guarded. An invalid element tree silently draws Claude Code's own version instead. focus, closeOnEscape and holdToasts accept only true and throw on false. Returning a tree in the band replaces what later mods draw there. Mods are not sandboxed, so claude plugin validate's reported calls line is the review surface. claude plugin validate --strict and claude plugin test are the lint and test tools and need no session, sign-in or network.

Section 10a, the prototype. A working firstmate-fleet skeleton that printed the real 14-task fleet, validated with claude plugin validate and tested with claude plugin test on Claude Code 2.1.291. It is to be hardened rather than rewritten.

The Calm flag fix the activation must be consistent with has since merged to main as "feat(mods): gate the Claude Code Calm mod on its own FM_CALM_ENABLED flag". It moves Calm's gate off the dead CLAUDE_CODE_ENABLE_FUNCTION_HOOKS early-access flag onto a firstmate-owned FM_CALM_ENABLED that must equal "1" exactly, keeping "a complete no-op unless explicitly enabled", and reads the old name only as a deprecated alias because Calm already had one.

What Changed

  • Adds the firstmate-fleet mod under .claude/mods/firstmate-fleet. Like Calm, it auto-loads through a symlink in .agents/skills. It does nothing unless FM_FLEET_ENABLED is exactly "1", and it has no deprecated alias. Once enabled, it provides:
    • a /fleet pane with one row per task showing current_state, the evidence that state came from, its age and the last event; r refreshes it
    • a band above the prompt that draws only when something waits on the captain (an open decision, a merge they owe, or a blocked or failed task) and keeps other mods' band content by nesting it above its own line
    • done, blocked and failed toasts, deduplicated on the last word announced for each task and skipped on the first reading of a session
    • a text answer from /fleet in sessions that cannot draw, decided from session.start's isInteractive
  • Runs bin/fm-fleet-snapshot.sh --json only from a 60s timer, one un-awaited start-up reading, or the text path of /fleet. All three share one in-flight promise with an explicit timeout, so drawing hooks only ever draw the cache. A failed or aged reading is marked unavailable or stale with its reason, never shown as an empty fleet. One toast fires on the second failure in a row. The /fleet text wait counts its own sleeps and stops 2s short of the hook budget.
  • Adds Node unit tests and the shell suites tests/fm-fleet-mod.test.sh and tests/fm-fleet-mod-plugin.test.sh, the latter a strict-validation guard that pins the env names and capabilities the mod reads. Also wires these into bin/fm-test-run.sh, adds docs/fleet-mod.md, updates the AGENTS.md layout line, and gitignores the types and tsconfig Claude Code generates during hot-reload.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The last fix round correctly replaces the single racing sleep with a bounded polling loop. The loop joins the in-flight reading without starting a second snapshot, re-reads the budget on each pass, stops after 90s, and falls back to the reading-in-progress marker. The outage-notice behavior and the rest of the mod were verified in earlier rounds and are unchanged.

Testing

I drove the changed /fleet text-wait path live on Claude Code 2.1.291, using a stub fm-fleet-snapshot.sh that writes a run log. In non-drawing stream-json sessions, asking /fleet during a 25s clock reading gave the reading-in-progress marker at 8.1s. Readings that landed about 5s and 7.5s after the ask came back with the full rows, at 5.6s and 7.5s. Every case had exactly one reader run. A plain -p /fleet printed the rows. With the flag unset or set to "true" the mod stayed inert and ran no reader. In a throwaway fm-lab Herdr session, an interactive session drew the waiting band above the prompt and opened the /fleet pane. Pressing r twice ran the reader once. The mod's portable test and plugin test suites passed. The lab was torn down and the scratch dirs removed. The TUI evidence is plain-text and ANSI terminal captures only. No PNG was made because no ANSI-to-image converter is installed, and earlier PNGs in the same evidence directory came from older commits.

  • Live validation: ✅ go - 8 of 8 scenarios driven live against the product
Scenario Result Live Evidence
Non-drawing session asks /fleet 1s into a 25s clock reading: answers with the reading-in-progress marker within the hook budget, not an engine error or an empty fleet ✅ pass live r4-s3a-text-join-bound-marker.txt: answered 8.09s after ask, is_error=False, 'firstmate-fleet: fleet: reading the fleet…', one reader run
Non-drawing session asks /fleet ~5s before the in-flight reading lands: the wait succeeds and the rows come back ✅ pass live r4-s3b-text-join-wait-wins.txt: rows returned 5.60s after ask, single reader run
Non-drawing session asks /fleet ~7.5s before landing (near the 8s bound): rows still returned inside budget ✅ pass live r4-s3c-text-join-near-bound.txt: rows returned 7.49s after ask, single reader run
claude -p /fleet with FM_FLEET_ENABLED=1 prints every row as text (non-drawing fallback) ✅ pass live r4-s2-p-text-fallback.txt
With FM_FLEET_ENABLED unset or 'true', the mod is inert: no /fleet command and no reader run ✅ pass live r4-s1-flag-off.txt
Interactive session with a blocked task that has an open decision shows the one-line band above the prompt ✅ pass live r4-s4-band-waiting.txt/.ansi: '1 waiting on you: alpha (decision/blocker)'
Interactive /fleet opens the pane with state, source, age, and the last event for each task ✅ pass live r4-s5-pane.txt/.ansi
Pressing r twice in the pane while a reading is running starts only one reader (in-flight guard) ✅ pass live r4-s6-refresh-inflight.log: one start/end pair for two presses
Evidence: Text-join bound: marker answer at 8.1s, one reader run

Source: Text-join bound: marker answer at 8.1s, one reader run

\### R4-S3a: non-drawing stream-json session @ fc12da2, reader delay 25s, /fleet asked ~1s into the clock's reading (lands ~24s after ask)
clock reading started at +63.1s after launch
asked /fleet 1.1s into the reading (reader delay 25s)
answered 8.09s after ask; duration_ms=8060; is_error=False
answer text:
firstmate-fleet: fleet: reading the fleet…
--- reader runs:
1791283136.571720000 start
1791283161 end rc=0
Evidence: Text-join wait wins: rows at 5.6s

Source: Text-join wait wins: rows at 5.6s

\### R4-S3b: same session shape, reader delay 20s, /fleet asked 15s into the reading (lands ~5s after ask)
clock reading started at +62.9s after launch
asked /fleet 15.1s into the reading (reader delay 20s)
answered 5.60s after ask; duration_ms=5573; is_error=False
answer text:
firstmate-fleet: fleet (2):
1 waiting on you: alpha (decision/blocker)
? alpha ship · blocked (status-log) · 2m
    event: blocked: needs a credential
> beta ship · working (liveness) · 30s
    event: working: beta under way
--- reader runs:
1791283231.734778000 start
1791283252 end rc=0
Evidence: Text-join near bound: rows at 7.5s

Source: Text-join near bound: rows at 7.5s

\### R4-S3c: reader delay 20s, /fleet asked 12.5s into the reading (lands ~7.5s after ask, near the 8s bound)
clock reading started at +64.3s after launch
asked /fleet 12.7s into the reading (reader delay 20s)
answered 7.49s after ask; duration_ms=7221; is_error=False
answer text:
firstmate-fleet: fleet (2):
1 waiting on you: alpha (decision/blocker)
? alpha ship · blocked (status-log) · 2m
    event: blocked: needs a credential
> beta ship · working (liveness) · 30s
    event: working: beta under way
--- reader runs:
1791283318.533935000 start
1791283338 end rc=0
Evidence: -p text fallback prints rows

Source: -p text fallback prints rows

\### R4-S2: FM_FLEET_ENABLED=1 claude -p /fleet (non-drawing, no reading yet; reader takes 3s) @ fc12da2
firstmate-fleet: fleet (2):
1 waiting on you: alpha (decision/blocker)
? alpha ship · blocked (status-log) · 2m
    event: blocked: needs a credential
> beta ship · working (liveness) · 30s
    event: working: beta under way
real 9.72
user 4.15
sys 1.37
--- reader runs:
1791283030.651491000 start
1791283033 end rc=0
Evidence: Flag off: inert, no reader runs

Source: Flag off: inert, no reader runs

\### R4-S1: flag unset / =true -> inert
FM_FLEET_ENABLED=''
Error: Reached max turns (1)
FM_FLEET_ENABLED='true'
Error: Reached max turns (1)
--- reader runs (expect none):
Evidence: Interactive band with waiting task (text)

Source: Interactive band with waiting task (text)


 ▐▛███▛█   Claude Code v2.1.291
▝▜██████▀  Opus 5.5 · Claude Max
 ▝▝   ▝▝   ~/.no-mistakes/worktrees/61c6dd39b831/01M487VG849J0JBB67CYNRYEEM




























1 waiting on you: alpha (decision/blocker)                                                                         [-]

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ Try "refactor usage-warner"
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⚠ Transcript saving is off — inherited CLAUDE_CODE_CHILD_SESSION marker · restart with CLAUDE_CODE_FORCE_SESSION_P…
  Opus 5.5 | ~/./w/6/01M487VG849J0JBB67CYNRYEEM [HEAD ✓] | ⚙️28 | ⚡100% | P03=E06=U10=J19:45:12
  -- INSERT -- ⏵⏵ auto mode on (shift+tab to cycle)
Evidence: Interactive band (ANSI)

Source: Interactive band (ANSI)


�[0m�[38;2;215;119;87m ▐�[0m�[38;2;215;119;87m�[48;2;0;0;0m▛███▛█   �[0m�[1mClaude Code �[0m�[38;2;153;153;153mv2.1.291�[0m
�[0m�[38;2;215;119;87m▝▜�[0m�[38;2;215;119;87m�[48;2;0;0;0m█████�[0m�[38;2;215;119;87m█▀  �[0m�[38;2;153;153;153mOpus 5.5 · Claude Max�[0m
�[0m�[38;2;215;119;87m ▝▝   ▝▝   �[0m�[38;2;153;153;153m~/.no-mistakes/worktrees/61c6dd39b831/01M487VG849J0JBB67CYNRYEEM�[0m




























�[0m�[38;2;229;72;77m1 waiting on you: alpha (decision/blocker)                                                                         �[0m�[38;2;153;153;153m[-]�[0m

�[0m�[38;2;136;136;136m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────�[0m
❯ �[0m�[2mTry "refactor usage-warner"�[0m
�[0m�[38;2;136;136;136m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────�[0m
  �[0m�[38;2;255;193;7m⚠ Transcript saving is off — inherited CLAUDE_CODE_CHILD_SESSION marker�[0m�[38;2;153;153;153m · restart with CLAUDE_CODE_FORCE_SESSION_P…�[0m
  �[0m�[38;2;153;153;153mOpus 5.5 | ~/./w/6/01M487VG849J0JBB67CYNRYEEM [HEAD ✓] | ⚙️28 | ⚡100% | P03=E06=U10=J19:45:12�[0m
  �[0m�[38;2;153;153;153m-- INSERT -- �[0m�[38;2;255;193;7m⏵⏵ auto mode on�[0m�[38;2;153;153;153m (shift+tab to cycle)�[0m
Evidence: Interactive /fleet pane (text)

Source: Interactive /fleet pane (text)

                                                                      │                                              ✕
 ▐▛███▛█   Claude Code v2.1.291                                       │1 waiting on you: alpha (decision/blocker)
▝▜██████▀  Opus 5.5 · Claude Max                                      │? alpha ship blocked (status-log) 2m
 ▝▝   ▝▝   ~/…/worktrees/61c6dd39b831/01M487VG849J0JBB67CYNRYEEM      │    event: blocked: needs a credential
                                                                      │> beta ship working (liveness) 30s
                                                                      │    event: working: beta under way
                                                                      │r: Refresh
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
                                                                      │
1 waiting on you: alpha (decision/blocker)                        [-] │
                                                                      │
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⚠ Transcript saving is off — inherited CLAUDE_CODE_CHILD_SESSION marker · restart with CLAUDE_CODE_FORCE_SESSION_P…
  Opus 5.5 | ~/./w/6/01M487VG849J0JBB67CYNRYEEM [HEAD ✓] | ⚙️28 | ⚡100% | P03=E06=U10=J19:45:12
  -- INSERT -- ⏵⏵ auto mode on (shift+tab to cycle)
Evidence: Interactive /fleet pane (ANSI)

Source: Interactive /fleet pane (ANSI)

                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                              �[0m�[38;2;153;153;153m�[48;2;38;38;38m✕�[0m�[48;2;38;38;38m �[0m
�[0m�[38;2;215;119;87m ▐�[0m�[38;2;215;119;87m�[48;2;0;0;0m▛███▛█   �[0m�[1mClaude Code �[0m�[38;2;153;153;153mv2.1.291                                       �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[38;2;229;72;77m�[48;2;38;38;38m1 waiting on you: alpha (decision/blocker)�[0m�[48;2;38;38;38m      �[0m
�[0m�[38;2;215;119;87m▝▜�[0m�[38;2;215;119;87m�[48;2;0;0;0m█████�[0m�[38;2;215;119;87m█▀  �[0m�[38;2;153;153;153mOpus 5.5 · Claude Max                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[38;2;229;72;77m�[48;2;38;38;38m?�[0m�[48;2;38;38;38m �[0m�[1m�[48;2;38;38;38malpha�[0m�[48;2;38;38;38m �[0m�[38;2;153;153;153m�[48;2;38;38;38mship�[0m�[48;2;38;38;38m �[0m�[38;2;229;72;77m�[48;2;38;38;38mblocked�[0m�[48;2;38;38;38m �[0m�[38;2;153;153;153m�[48;2;38;38;38m(status-log)�[0m�[48;2;38;38;38m �[0m�[38;2;153;153;153m�[48;2;38;38;38m2m�[0m�[48;2;38;38;38m            �[0m
�[0m�[38;2;215;119;87m ▝▝   ▝▝   �[0m�[38;2;153;153;153m~/…/worktrees/61c6dd39b831/01M487VG849J0JBB67CYNRYEEM�[0m      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[38;2;153;153;153m�[48;2;38;38;38m    event: blocked: needs a credential�[0m�[48;2;38;38;38m          �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m> �[0m�[1m�[48;2;38;38;38mbeta�[0m�[48;2;38;38;38m �[0m�[38;2;153;153;153m�[48;2;38;38;38mship�[0m�[48;2;38;38;38m working �[0m�[38;2;153;153;153m�[48;2;38;38;38m(liveness)�[0m�[48;2;38;38;38m �[0m�[38;2;153;153;153m�[48;2;38;38;38m30s�[0m�[48;2;38;38;38m              �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[38;2;153;153;153m�[48;2;38;38;38m    event: working: beta under way�[0m�[48;2;38;38;38m              �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│r�[0m�[48;2;38;38;38m: Refresh                                      �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
�[0m�[38;2;229;72;77m1 waiting on you: alpha (decision/blocker)                        �[0m�[38;2;153;153;153m[-] �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
                                                                      �[0m�[38;2;177;185;249m�[48;2;38;38;38m│�[0m�[48;2;38;38;38m                                                �[0m
�[0m�[38;2;136;136;136m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────�[0m
❯ 
�[0m�[38;2;136;136;136m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────�[0m
  �[0m�[38;2;255;193;7m⚠ Transcript saving is off — inherited CLAUDE_CODE_CHILD_SESSION marker�[0m�[38;2;153;153;153m · restart with CLAUDE_CODE_FORCE_SESSION_P…�[0m
  �[0m�[38;2;153;153;153mOpus 5.5 | ~/./w/6/01M487VG849J0JBB67CYNRYEEM [HEAD ✓] | ⚙️28 | ⚡100% | P03=E06=U10=J19:45:12�[0m
  �[0m�[38;2;153;153;153m-- INSERT -- �[0m�[38;2;255;193;7m⏵⏵ auto mode on�[0m�[38;2;153;153;153m (shift+tab to cycle)�[0m
Evidence: Pane r pressed twice -> one reader run

Source: Pane r pressed twice -> one reader run

\### R4-S6: in the open pane, 'r' pressed twice 0.5s apart with a 4s reader -> runs:
1791283550.508382000 start
1791283554 end rc=0
Evidence: Portable mod test

Source: Portable mod test

ok - the Fleet mod is one hooks module, linked into the project's auto-load path, with no command, skill, agent, or classic hook path that bypasses its activation flag
ok - the Fleet mod activates on the exact value 1 alone, and on no other value, empty, or unset name, and resolves its reader from the tracked code root rather than from the home FM_HOME selects
ok - the Fleet mod's reader parses bin/fm-fleet-snapshot.sh --json as the producer actually writes it: task state, the last event as an event, the open-decision set, and the producer's own live-versus-dated captain-hold classification
ok - the Fleet mod's reading policy holds: a reading that is not this snapshot refuses, only decisions, merge asks and blockers wait on the captain, a failed or aged reading is named rather than drawn as an empty healthy fleet, the text answer carries every row the pane draws, and a notice fires once per real transition
Evidence: Plugin validate/test

Source: Plugin validate/test

ok - Claude Code 2.1.291 (Claude Code) validates the Fleet mod strictly at its folder and its auto-load path, hooking exactly the session start, /fleet, the pane and the band, reaching the fleet reading only through its guarded refresh, and reading only its activation flag and the code-root override
ok - Claude Code 2.1.291 (Claude Code) runs the Fleet mod's plugin test suites clean: the inert activation flag, one reading in flight behind the clock, the pane, the band's etiquette, the transition notices, and the text answer for a session that cannot draw
- Outcome: 🔧 1 issue found → auto-fixed (2) ✅ across 4 runs (59m35s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed (4) ✅
  • ⚠️ .claude/mods/firstmate-fleet/lib/fm-fleet-toasts.ts:41 - Notices are deduplicated on the last word seen, not the last word announced, which goes against the intent's C3 requirement ("deduplicated on the last announced word so a flapping task cannot toast repeatedly"). fleetToasts puts every row's current state into the carried map (states.set(row.id, row.state)) and register.ts overwrites announced = round.states on every reading. Example: a task reads blocked → working → blocked → working → blocked on consecutive 60s refreshes. Each return to blocked compares against the stored "working", so it toasts every other refresh, which is the repeated toasting the intent rules out. The file's header comment says "the recorded word is the one last announced", which the code does not do, and no test covers the blocked→working→blocked sequence. Suggested fix: carry the last announced word per task and only update it when a toast actually fires (or when the task moves into a non-announced state, if re-announcing after a real resolution is wanted). Which of those two behaviors to keep is the author's call.
  • ⚠️ .claude/mods/firstmate-fleet/hooks/register.ts:223 - All of the session setup (snapshotCommand, canDraw, the 60s ticker, the first refresh) happens only in session.start and is kept in module variables. Module variables reset on hot reload, and session.start does not run again after one. A reload happens when the firstmate checkout is updated under a running supervision session, for example by pulling a merged change to this mod. After that: no timer, so no refreshes and no toasts. Snapshot is undefined and the error is empty, so the band is 'unread' and draws nothing, which silently says nothing is waiting. canDraw is false, so /fleet in an interactive session returns text "fleet unavailable: the fleet reader has not been resolved yet" instead of opening the pane, and the band then stays yellow. Calm guards against exactly this with a lazy, cached ensureLoaded that every hook awaits (firstmate-calm/hooks/register.ts:30-33, 147-150). Suggested fix: resolve the command and start the ticker lazily from every activated hook, and keep isInteractive in $.state, which survives a reload.

🔧 Fix applied.
1 info still open:

  • ℹ️ .claude/mods/firstmate-fleet/hooks/register.ts:95 - After a hot reload, the lazy load starts the 60s clock but never takes a first reading. Until the first tick fires, the snapshot is undefined. In that window the band draws nothing and a /fleet pane opened in an interactive session shows no rows; pressing 'r' fixes it. This is a short gap after a reload, not a lasting failure, and it keeps reads away from render hooks. If you want to close it, load could start an un-awaited refresh($) when no reading is cached, since the call is never awaited inside the render. Optional.

  • ⚠️ .claude/mods/firstmate-fleet/hooks/register.ts:276 - The text fallback for /fleet can wait out the whole snapshot read inside one hook. In a non-drawing session, if no reading has landed yet (snapshot === undefined && readError === ""), command.run awaits refresh($), which joins or starts the 17.7-21.6s fm-fleet-snapshot.sh run. The intent's platform limits give one hook event a 10s budget. The most common text-fallback case hits this: claude -p "/fleet" (or an SDK call) runs the command right after session.start, while the un-awaited first read is still in flight. The handler then runs about 2x over budget, so the command is likely cut off and returns no fleet text at all. The unit tests use an instant fake process, so they never reach this. Fix: race the in-flight read against a deadline under the budget (for example about 8s), then return fleetTextReport(await view($)), which already says "reading the fleet…" or shows the rows. The docs line "joins the reading already under way" should change to match.

  • ⚠️ .claude/mods/firstmate-fleet/lib/fm-fleet-toasts.ts:17 - No notice fires when a worker raises a decision. The intent's C3 asks for "the worker-done or needs-decision toast the moment a task's state word changes", but ANNOUNCED_STATES is only done/blocked/failed. bin/fm-crew-state.sh map_log_state turns a needs-decision status line into the state word parked, which is not in the set. So a worker that stops to ask the captain a decision raises no notice; only the band shows it. The intent's summary line says "done/blocked toasts", so the two parts of the intent disagree. Adding parked is not a simple fix either: parked also covers parked no-mistakes runs, so a narrower trigger may be needed, such as pendingDecision/openDecisions turning on. The author needs to decide whether needs-decision notices are in scope and what should trigger them.

  • ⚠️ .claude/mods/firstmate-fleet/lib/fm-fleet-view.ts:304 - The band also draws when nothing is waiting, which goes against the intent's C1 wording. The intent says the band "appears only when something waits on the captain (a decision, a merge ask, or a blocker)" and C1 says "nothing at all when that set is empty". fleetBand also returns a yellow line when the reading is stale or unavailable and nothing waits (if (freshness.kind === "stale" || freshness.kind === "unavailable") return { tone: "yellow", ... }). Example: the snapshot script keeps failing (bad FM_HOME, a reader error, or a timeout). Then a permanent yellow "fleet unavailable: …" line sits above the prompt even though nothing waits on the captain. That is the always-drawn noise C1 names as the main risk. docs/fleet-mod.md also says both "nothing whatsoever when nothing does" and "The band draws in all three cases". The design reason (silence would imply nothing waits) is reasonable, but it is an added behavior beyond the stated intent. Remove the yellow branch, or confirm it as wanted and fix the doc contradiction.

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ⚠️ .claude/mods/firstmate-fleet/hooks/register.ts:177 - The one-shot outage notice fires on any failed reading, but the user asked for it only "on the transition into unavailable". In fleetFreshness, a failure that follows a good reading is stale (the rows stay), not unavailable. Here is the sequence: good readings land, then one reading times out at 90s. readFleet takes the error branch, outageAnnounced is false, and it toasts "fleet unavailable: …timed out…" while the pane still shows every row marked stale. The new test asserts exactly this (good reading, then reject, then a second "fleet unavailable" toast). The result is a misleading word, plus a notice for every transient blip after recovery. A narrower fix would toast only when snapshot === undefined (the unavailable kind), or would word the notice for the stale case. Asking because the user's wording and the fixer's reading of it differ.
  • ℹ️ .claude/mods/firstmate-fleet/hooks/register.ts:232 - readForText races the in-flight reading against one $.clock.sleep(remainingMs - 2s) and then answers "reading the fleet…". The user's stated budget rule is that time inside a $.* call is not counted. Time spent in that sleep therefore does not use the budget, and the user suggested a bounded polling loop of sleeps that keeps waiting for the rows. With the current code, a non-drawing SDK session that asks /fleet while the clock's 18-22s reading is under way gives up after about 8s and returns no rows, even though it could have waited for them. In a plain -p run this path is almost never reached, because the first clock tick comes at 60s. No test exercises the branch where the sleep wins.

🔧 Fix applied.
1 warning still open:

  • ⚠️ .claude/mods/firstmate-fleet/hooks/register.ts:226 - The fix the user chose in round 4 (text-join-bound-shorter-than-needed) was not applied. The fix commit d557f55 changed only the outage notice. readForText still races the in-flight reading against one $.clock.sleep(remainingMs - 2s). Example: a non-drawing session asks /fleet while the clock's 18-22s reading is under way. The answer gives up after about 8s and returns "reading the fleet…" with no rows, even though time inside $.clock.sleep does not count against the hook budget and the rows land a few seconds later. The user asked for these: (1) replace the single race with a bounded loop of repeated $.clock.sleep calls that polls the cache, or inFlight settling, until the reading lands; (2) keep the single in-flight guard so a second snapshot never starts; (3) keep an overall bound, and if it elapses, answer with the reading-in-progress marker, never an empty fleet; (4) add the missing test for the branch where the wait wins and the rows come back. The docstring at lines 220-224 and docs/fleet-mod.md:54 ("waits only as long as the hook budget allows") also need updating to describe the loop.

🔧 Fix applied.
✅ Re-checked - no issues remain.

🔧 **Test** - 1 issue found → auto-fixed (2) ✅
  • 🚨 tests/fm-fleet-mod.test.sh:62 - The review-fix commit broke tests/fm-fleet-mod.test.sh in two ways. (1) It added .claude/mods/firstmate-fleet/types/index.d.ts, but the shape check allowed only hooks, lib and tests, so it failed with 'the mod folder holds hooks, lib, tests, types'. (2) It renamed fleetToasts' return field from states to announced, but the policy check still read first.states, so it threw TypeError: Cannot read properties of undefined. Fixed in the test only: types/ is now allowed and must hold exactly index.d.ts, and the checks read .announced. I also added the blocked→working→blocked→working→blocked sequence (asserting exactly one notice) and a check that a task leaving the fleet drops its record. All four portable checks now pass.
  • Live validation: ✅ go - 9 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Flag unset or not exactly 1: /fleet is not served and the fleet reader never runs ✅ pass live p-flag-unset.txt, p-flag-true.txt: /fleet went to the model (401) and runs.log stayed empty
Non-drawing session (claude -p) with FM_FLEET_ENABLED=1: /fleet answers with text rows, the waiting line and event lines, after one shared reading ✅ pass live p-flag-1-text-fallback.txt
Interactive session: /fleet opens a pane with state, source, age and event rows plus r: Refresh, and the band lists what waits on the captain ✅ pass live interactive-fleet-pane.png / .txt
Session starts instantly while the slow reading runs in the background ✅ pass live interactive-toasts-and-inflight.txt: prompt usable at +8s while the 20s-delayed reader was still running
Adversarial: refresh pressed repeatedly during an in-flight reading never starts an overlapping run ✅ pass live interactive-toasts-and-inflight.txt runs.log: start/end pairs never overlap despite 8 r presses during reads
Adversarial: a task flapping blocked→working→blocked→working→blocked notifies once, and a later done notifies again ✅ pass live interactive-toasts-and-inflight.txt: notice frames only at 1791279386 (beta: blocked) and 1791279683 (beta: done)
Nothing waiting: the band draws nothing at all ✅ pass live interactive-band-empty.png / .txt (0 'waiting on you' lines; pane shows the landed reading)
Another mod's band content is kept, nested above the fleet line ✅ pass live interactive-band-coexist.png
After a hot reload: /fleet still opens the pane (canDraw from $.state), the 60s timer resumes at a single cadence, and the band returns ✅ pass live interactive-hot-reload.txt
Auto-load through the project's .claude/skills symlink with no install step ⏸️ untested no The earlier payload did not show a live result for this scenario. The only evidence was the static check claude plugin validate --strict on .claude/skills/firstmate-fleet. The live sessions loaded t…
  • bash tests/fm-fleet-mod.test.sh (failed on the shape check and the renamed states field, fixed, re-run: 4/4 ok)
  • bash tests/fm-fleet-mod-plugin.test.sh (claude plugin validate --strict on the folder and the .claude/skills auto-load path, plus claude plugin test suites: ok)
  • claude -p "/fleet" --plugin-dir .claude/mods/firstmate-fleet with FM_FLEET_ENABLED unset and with FM_FLEET_ENABLED=true: /fleet not served (falls through to the model and gets a 401), and the reader is never run
  • FM_FLEET_ENABLED=1 claude -p "/fleet" with the reader delayed 3s: the text report prints every row plus the waiting line, and runs.log shows exactly one reader run (/fleet joined the session-start read)
  • Interactive claude --plugin-dir ... in a private tmux -L fmfleetlab 160x45 session, reader delayed 20s: the session was usable before the first read landed; /fleet opened the pane; pressing r 3x, then 5x during the timer's in-flight read, never started an overlapping run (runs.log start/end pairs)
  • 60s timer readings with lab current_state overrides of blocked, working, blocked, working, blocked, done: on-screen notices captured every 0.5s
  • Switched the reader to a home with nothing waiting and pressed r: no band line drawn; reopened /fleet to confirm the new reading had landed
  • Second interactive session with a lab mod whose AbovePrompt hook returns its own line without calling next: both lines are drawn, the other mod's above the fleet's
  • Hot reload: appended a comment to a lab copy of hooks/register.ts (the engine printed 'firstmate-fleet: reloaded'); /fleet then opened the pane, not the text fallback; readings continued at a single 60s cadence; the band was restored

🔧 Fix applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 10 of 10 scenarios driven live against the product
Scenario Result Live Evidence
Captain runs claude -p "/fleet" with FM_FLEET_ENABLED=1: gets the fleet as text rows (state word from current_state, event labelled as event, waiting summary), not a pane ✅ pass live fleet-text-fallback-enabled.txt
With FM_FLEET_ENABLED unset, 0, or true, /fleet is not served (-p falls through to the model) and an interactive session has no /fleet command, no band, and zero snapshot runs ✅ pass live fleet-flag-off-inert.txt, inert-flag-unset.txt
Interactive session: /fleet opens the Fleet pane with one row per task and an r: Refresh button ✅ pass live pane-nothing-waiting.html
Band above the prompt is absent when nothing waits and shows 'N waiting on you: …' when a blocker or decision exists ✅ pass live pane-nothing-waiting.html, toast-step-5.html, band-with-other-mod.html
Adversarial: pressing r three times during a 25s in-flight reading never starts an overlapping snapshot run ✅ pass live inflight-and-cadence-runs.log
Adversarial: a task flapping blocked→working→blocked→working→blocked gets exactly one notice; beta reaching done still notifies ✅ pass live toast-step-3.html (alpha: blocked), toast-step-5.html (no notice), toast-step-6.html (beta: done only)
First reading of a session with tasks already blocked/done fires no notices ✅ pass live session-start-first-reading.txt
Adversarial: a non-JSON reading is never drawn as a healthy empty fleet; last rows stay, marked stale with the reason, band still drawn ✅ pass live pane-failed-reading.html
After a live hot reload, /fleet still opens the pane (drawability kept in $.state), the band still draws, and exactly one 60s ticker resumes ✅ pass live pane-after-hot-reload.html, inflight-and-cadence-runs.log
Another mod's band content is preserved: nested above the fleet line when the fleet draws, and passed through untouched when it does not ✅ pass live band-with-other-mod.html, band-other-mod-fleet-silent.txt
  • bash tests/fm-fleet-mod.test.sh (baseline portable checks: shape, activation, real-producer parse, toast policy including the blocked→working→blocked flap)

  • bash tests/fm-fleet-mod-plugin.test.sh (real claude plugin validate --strict scan + claude plugin test suites)

  • FM_FLEET_ENABLED=1 FM_HOME=<throwaway home> claude -p "/fleet" against the real bin/fm-fleet-snapshot.sh

  • claude -p "/fleet" with FM_FLEET_ENABLED unset / 0 / true

  • Interactive claude in a private tmux socket (tmux -L fmfleetlab) with FM_FLEET_ENABLED=1, FM_HOME=<throwaway home>, FM_ROOT_OVERRIDE=<throwaway stub root whose fm-fleet-snapshot.sh logs runs, sleeps, and emits controlled real-schema JSON>

  • Typed /fleet, pressed r 3x during a 25s in-flight read, inspected stub run log for overlap

  • Drove alpha through blocked→working→blocked→working→blocked then beta→done via pane refresh, captured pane/toasts after each step

  • Made the stub emit non-JSON and captured the pane and band stale marking

  • Forced a live hot reload (transient one-line edit to register.ts + /reload-plugins, edit reverted with git checkout), then reopened /fleet and watched the 60s ticker for 2+ minutes

  • Fresh session starting with alpha blocked and beta done: checked no notices on the first reading

  • Loaded a throwaway terminal AbovePrompt mod (transient .agents/skills symlink, removed afterwards) and checked both band lines render, and that the other mod's line survives when the fleet has nothing waiting

  • Interactive session with FM_FLEET_ENABLED unset: no /fleet completion, no band, zero snapshot runs

  • 🚨 .claude/mods/firstmate-fleet/hooks/register.ts:236 - Driven live on Claude Code 2.1.291 in a non-drawing stream-json session, with the lab reader slowed to 25s. /fleet was asked about 1s after the 60s clock reading started. The answer came at 10.04s and was Claude Code's own error, "firstmate-fleet registered /fleet but no command.run hook answered it…", not the rows and not the reading-in-progress marker. A reading that landed exactly 10s after the ask failed the same way (10.05s). Asked 5s before landing, the rows came back in 6.1s with only one reader run. So the loop works only inside 10s, and the single in-flight guard holds. Root cause: the premise that time inside a $.* call does not count is wrong for $.clock.sleep. The engine's own types (HookBudget, clock.sleep) say "a $.clock wait excepted" and "its budget runs on through it". An instrumented scratch copy also logged next.budget.remainingMs = 9999 on every pass, so if (spareMs &lt;= 0) return never fires and the engine drops the hook (one caveat: that copy's added logging was itself a $ call). The previous single race (stop at remainingMs − 2s) at least answered with the marker. This needs a decision because the requested design (keep waiting past the budget with repeated $.clock.sleep) is not possible on this engine. Options: (a) bound the loop by its own elapsed wall time (measured with $.clock.now() or summed sleeps) to about 8s, then answer with the reading-in-progress marker; (b) wait through a $ call the budget really does not count, which would change the capabilities strict validation pins. A test that fakes remainingMs does not show this; only the live engine does.

  • 🚨 live validation verdict: no-go (10 of 10 scenarios were driven live against the product); failed: Non-drawing session asks /fleet while the clock's 25s reading is in flight: answers with the rows or the reading-in-progress marker, never an error or an empty fleet

  • Live validation: ❌ no-go - 10 of 10 scenarios driven live against the product

Scenario Result Live Evidence
Flag off (0 / true): /fleet is not answered by the mod and no fleet reading runs ✅ pass live s1-flag-off.txt (prompt went to the model; reader run log empty)
Non-drawing claude -p /fleet with FM_FLEET_ENABLED=1 prints every row plus the waiting line, one reader run ✅ pass live s2-p-text-fallback.txt
Non-drawing session asks /fleet while the clock's 25s reading is in flight: answers with the rows or the reading-in-progress marker, never an error or an empty fleet ❌ fail live s3-text-join-past-budget.txt: Claude Code's 'no command.run hook answered it' error at 10.04s / 10.05s; remainingMs stuck at 9999 while the engine still counted sleep time
Non-drawing session asks /fleet 5s before the joined reading lands: rows come back with no second overlapping read ✅ pass live s3-text-join-past-budget.txt control D: 6.1s, one reader run
Interactive session: band shows one line above the prompt while a task has an open decision ✅ pass live fleet-mod-live-lab.html (S4)
Interactive /fleet opens the pane with rows, waiting header and r: Refresh ✅ pass live fleet-mod-live-lab.html (S5)
Pressing r three times during a slow reading starts only one snapshot run ✅ pass live s6-inflight-guard-runs.log
Nothing waits: the band draws nothing at all ✅ pass live fleet-mod-live-lab.html (S7)
Failing reader after good rows: 1st failure quiet, 2nd fires exactly one 'fleet reading failing; rows shown are Ns old' notice, further failures silent, good reading re-arms the next episode, band sta… ✅ pass live s8-outage-notice-transcript.txt, fleet-mod-live-lab.html (S8)
Reader failing from session start: band silent, pane shows unavailable with reason, second failure notifies 'fleet cannot be read' ✅ pass live s9-unavailable-transcript.txt, fleet-mod-live-lab.html (S9)
  • bash tests/fm-fleet-mod.test.sh (4 portable checks pass)
  • bash tests/fm-fleet-mod-plugin.test.sh (strict validate + claude plugin test suites pass)
  • FM_FLEET_ENABLED=0|true claude -p /fleet --max-turns 1 with lab FM_HOME/FM_ROOT_OVERRIDE: the mod does not answer, no reader run
  • FM_FLEET_ENABLED=1 claude -p /fleet: text rows + waiting line, exactly one reader run
  • claude -p --input-format stream-json session, 25s-delayed lab reader, /fleet asked during the clock's in-flight reading: Claude Code error at 10.04s (3 runs, incl. an instrumented scratch copy logging next.budget.remainingMs)
  • Same session shape, /fleet asked 5s before the reading lands: rows returned in 6.1s, one reader run
  • Interactive claude in isolated tmux -L fm-lab-fleet 170x50: band line while a decision is open; /fleet pane rows + r: Refresh; 3 rapid r presses with a 15s reader → one reader run
  • Interactive: alpha unblocked → band draws nothing
  • Interactive: forced reader failures → 1st quiet, 2nd one 'fleet reading failing; rows shown are 20s old' notice, 3rd/4th silent, good reading re-arms, new two-failure episode notifies again
  • Interactive fresh session with failing reader: band silent, pane 'fleet unavailable: <reason>', second failure → 'fleet cannot be read' notice

🔧 Fix applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 8 of 8 scenarios driven live against the product
Scenario Result Live Evidence
Non-drawing session asks /fleet 1s into a 25s clock reading: answers with the reading-in-progress marker within the hook budget, not an engine error or an empty fleet ✅ pass live r4-s3a-text-join-bound-marker.txt: answered 8.09s after ask, is_error=False, 'firstmate-fleet: fleet: reading the fleet…', one reader run
Non-drawing session asks /fleet ~5s before the in-flight reading lands: the wait succeeds and the rows come back ✅ pass live r4-s3b-text-join-wait-wins.txt: rows returned 5.60s after ask, single reader run
Non-drawing session asks /fleet ~7.5s before landing (near the 8s bound): rows still returned inside budget ✅ pass live r4-s3c-text-join-near-bound.txt: rows returned 7.49s after ask, single reader run
claude -p /fleet with FM_FLEET_ENABLED=1 prints every row as text (non-drawing fallback) ✅ pass live r4-s2-p-text-fallback.txt
With FM_FLEET_ENABLED unset or 'true', the mod is inert: no /fleet command and no reader run ✅ pass live r4-s1-flag-off.txt
Interactive session with a blocked task that has an open decision shows the one-line band above the prompt ✅ pass live r4-s4-band-waiting.txt/.ansi: '1 waiting on you: alpha (decision/blocker)'
Interactive /fleet opens the pane with state, source, age, and the last event for each task ✅ pass live r4-s5-pane.txt/.ansi
Pressing r twice in the pane while a reading is running starts only one reader (in-flight guard) ✅ pass live r4-s6-refresh-inflight.log: one start/end pair for two presses
  • FM_FLEET_ENABLED=1 FM_ROOT_OVERRIDE=&lt;lab root&gt; claude -p /fleet with a 3s stub reader (non-drawing text fallback)
  • claude -p /fleet --max-turns 1 with FM_FLEET_ENABLED unset and =true (inert flag, no reader runs)
  • stream-json claude -p --input-format stream-json driver: /fleet asked 1.1s into a 25s clock reading (bound path)
  • stream-json driver: /fleet asked 15s into a 20s reading (lands ~5s after ask, the wait succeeds)
  • stream-json driver: /fleet asked 12.7s into a 20s reading (lands ~7.5s after ask, near the 8s bound)
  • Herdr lab via bin/fm-herdr-lab.sh provision/run/teardown (fm-lab-fleetr4b-*): interactive claude, band captured, /fleet pane opened, r pressed twice with a 4s reader
  • bash tests/fm-fleet-mod.test.sh
  • bash tests/fm-fleet-mod-plugin.test.sh (claude plugin validate --strict + claude plugin test on 2.1.291)
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

…, and notices

A Claude Code mod that gives a supervision session a fleet view: /fleet lists
every task with its state, the evidence that state came from, its age, and its
last wake event; one line above the prompt names what waits on the captain and
draws nothing at all when nothing does; and a transient notice fires the first
time a task reaches done, blocked, or failed.

The one data source is bin/fm-fleet-snapshot.sh --json, measured at 17.7-21.6s
against a 10s budget for one hook, with two overlapping runs measured at 72s
where one takes 18s. So it runs only from a 60s timer and one un-awaited reading
at session start, both behind a single in-flight promise; a drawing hook never
starts it and only ever draws the cache. A failed, timed-out, or wrong-schema
reading is reported as unavailable or stale with its age, never as a healthy
empty fleet, and every reading redraws so a drawing cannot go on claiming more
than the mod still knows.

Only current_state is printed as a state word and the status log's last line
stays labeled as an event, because that line goes stale exactly when a resolved
decision lets a worker resume; unreadable and unknown are kept apart. Whether
the session can draw comes from session start's own isInteractive, since a pane
reports itself placed even in a -p run where nothing can draw; those sessions
get the same rows as text from /fleet instead. Other mods keep their band
content.

Activation follows Calm's firstmate-owned gate: FM_FLEET_ENABLED must equal 1
exactly, and anything else leaves the mod a complete no-op even once Claude Code
has loaded the module. It is new, so it carries no deprecated alias. Nothing in
it writes, and the capabilities the module reaches for are pinned by the
strict-validation guard rather than left to review.

Policy lives in plain libs testable under Node and the engine glue in one hooks
module. tests/fm-fleet-mod.test.sh pins the plugin's shape, the activation rule,
the reading policy, and the parser against the real producer's own bytes;
tests/fm-fleet-mod-plugin.test.sh runs claude plugin validate --strict and the
mod's engine suites against the installed Claude Code. Verified on 2.1.291.

Also gitignores the tsconfig and type declarations claude --plugin-dir writes
into a mod while hot-reloading, which is the documented way to develop one.
@max-metaplanet
max-metaplanet merged commit f8c8cf0 into main Oct 6, 2026
21 checks passed
max-metaplanet added a commit that referenced this pull request Oct 6, 2026
…NABLED (#27)

* feat(firstmate-fleet): add the read-only Claude Code fleet pane, band, and notices

A Claude Code mod that gives a supervision session a fleet view: /fleet lists
every task with its state, the evidence that state came from, its age, and its
last wake event; one line above the prompt names what waits on the captain and
draws nothing at all when nothing does; and a transient notice fires the first
time a task reaches done, blocked, or failed.

The one data source is bin/fm-fleet-snapshot.sh --json, measured at 17.7-21.6s
against a 10s budget for one hook, with two overlapping runs measured at 72s
where one takes 18s. So it runs only from a 60s timer and one un-awaited reading
at session start, both behind a single in-flight promise; a drawing hook never
starts it and only ever draws the cache. A failed, timed-out, or wrong-schema
reading is reported as unavailable or stale with its age, never as a healthy
empty fleet, and every reading redraws so a drawing cannot go on claiming more
than the mod still knows.

Only current_state is printed as a state word and the status log's last line
stays labeled as an event, because that line goes stale exactly when a resolved
decision lets a worker resume; unreadable and unknown are kept apart. Whether
the session can draw comes from session start's own isInteractive, since a pane
reports itself placed even in a -p run where nothing can draw; those sessions
get the same rows as text from /fleet instead. Other mods keep their band
content.

Activation follows Calm's firstmate-owned gate: FM_FLEET_ENABLED must equal 1
exactly, and anything else leaves the mod a complete no-op even once Claude Code
has loaded the module. It is new, so it carries no deprecated alias. Nothing in
it writes, and the capabilities the module reaches for are pinned by the
strict-validation guard rather than left to review.

Policy lives in plain libs testable under Node and the engine glue in one hooks
module. tests/fm-fleet-mod.test.sh pins the plugin's shape, the activation rule,
the reading policy, and the parser against the real producer's own bytes;
tests/fm-fleet-mod-plugin.test.sh runs claude plugin validate --strict and the
mod's engine suites against the installed Claude Code. Verified on 2.1.291.

Also gitignores the tsconfig and type declarations claude --plugin-dir writes
into a mod while hot-reloading, which is the documented way to develop one.

* no-mistakes(review): Dedup fleet notices on announced word; load lazily across reloads

* no-mistakes(test): Update fleet mod test for types dir and announced field

* no-mistakes(review): Silence idle fleet band, keep /fleet text within hook budget

* no-mistakes(review): Notify fleet outages once per two-failure episode, worded by kind

* no-mistakes(review): Poll the joined fleet reading in bounded /fleet text loop

* no-mistakes(test): Bound /fleet text wait by summed sleeps under hook budget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant