Skip to content

Latest commit

 

History

History
322 lines (309 loc) · 232 KB

CLAUDE.md

File metadata and controls

322 lines (309 loc) · 232 KB

fleet

This file provides context for AI-assisted development with Claude Code.

TUI tool for managing multiple Claude Code, OpenAI Codex, OpenCode, GitHub Copilot CLI and Antigravity CLI sessions in parallel using tmux.

Tech Stack

  • Go 1.26+, Bubble Tea v2 + Lip Gloss v2 (charm.land/.../v2), charmbracelet/x/vt (drawer's live terminal), tmux, SQLite (WAL mode)

Build

make build    # build to build/fleet
make run      # go run
make test     # go test -race
make fmt      # go fmt
make lint     # golangci-lint
make coverage # test coverage report

Commit Convention

Use conventional commits. Version is auto-computed from commits:

  • fix: ... → patch (v0.1.0 → v0.1.1)
  • feat: ... → minor (v0.1.0 → v0.2.0)
  • feat!: ... or BREAKING CHANGE: ... → major (v0.1.0 → v1.0.0)
  • chore:, docs:, refactor:, test:, style: → patch
  • Scopes are optional: fix(hooks): ..., feat(ui): ...

Changelog

  • Each PR adds a fragment file: changelog/unreleased/<name>.md with type: frontmatter (added/improved/fixed/changed/removed)
  • Keep fragments concise: 1–2 sentences, lead with the user-facing change. No implementation detail, marketing tone, or exhaustive sub-points — a user skimming the release notes should grasp it at a glance. e.g. "Status updates now respond in ~150ms instead of up to 2s."
  • Voice — fun via honest specificity, not hype. Fragments render in-app (Ctrl+K → "Release Notes", which formats `code` + **bold**), so write for a reader: open each bullet with a bold 2–4 word headline so a release skims in one pass; write in second person ("You can now…", "Sessions now…"); name the annoyance you killed ("…instead of a cryptic 'Operation not permitted'"); numbers over adjectives ("~150ms instead of 2s"); code-format keys/commands/paths (Ctrl+K, ~/Documents); one idea per bullet; ban hype words (seamless, powerful, delightful, blazing). Full guide + examples: changelog/README.md.
  • Add highlight: true to a fragment's frontmatter to also surface it in the in-app What's New reel. The item still renders in its normal type section; the flag also copies it into a ### Highlights block that leads the release (emitted by prepare-release.yml). Reserve for changes a user would be glad to discover — most fragments are not highlights.
  • Never decide highlight on your own — always ask. When you write a fragment, ask the user (via the AskUserQuestion tool) whether it should be a highlight, and give a recommendation with your reasoning. A highlight leads the release in the What's New reel, so it's an editorial call about what deserves the user's attention — not a property of the diff, and not something you can infer from how big the change felt to implement. Default recommendation is no: most fragments are not highlights. Ask even when you're confident, and ask on the way in (when writing the fragment), not after the PR is up.
  • CI checks for fragment presence; comment /no-changelog to skip
  • At release time, fragments are merged into CHANGELOG.md and deleted

Release

  • Comment /ship on any issue or PR to prepare a release
  • /ship 2.0.0 to override the version
  • CI opens a release PR with changelog rolled — review and merge to release
  • Merging the release PR triggers GoReleaser (binaries, GitHub Release, Homebrew)
  • Install: brew install brizzai/tap/fleet or run bash install.sh (requires gh CLI)

Package Structure

cmd/fleet/main.go      # CLI entry point
cmd/fleet/add.go       # `fleet add [path]` — session in an existing directory
cmd/fleet/session_launch.go # Shared by add + worktree: agent/account resolution, hooks, launch
cmd/fleet/worktree.go  # `fleet worktree <branch>` — worktree + session from the shell
cmd/fleet/send.go      # `fleet send <session> <message>` — message a running session from the shell (-wait: then collect the reply)
cmd/fleet/status.go    # `fleet status` — live status of every session: prompt waiting on, unsent draft, branch, PR (--json)
cmd/fleet/read.go      # `fleet read <session>` — last transcript turns, or the cleaned screen (--lines)
cmd/fleet/wait.go      # `fleet wait <session...>` — block until done/idle/waiting/running; exit 0/2/3/4
cmd/fleet/control.go   # `fleet answer|interrupt|submit|clear|restart|suspend|resume` — guarded pane actions
cmd/fleet/inspect.go   # Shared by the agent-facing commands: state loading, rendering, JSON shape
cmd/fleet/skill.go     # `fleet skill <install|uninstall|status>` — install the agent skill
cmd/fleet/instance_lock.go # One TUI per config dir (FLEET_ALLOW_MULTIPLE overrides)
cmd/fleet/pprof.go     # FLEET_PPROF loopback-only profiling server
internal/ticket/       # Tracker-agnostic ticket layer: Provider interface, branch naming, seed prompt, image download, keychain store, ticket.md + meta.json, Materialize
internal/linear/       # Linear provider — GraphQL client, API-key + PKCE OAuth
internal/jira/         # Jira Cloud provider — REST v3 client, API-token Basic auth, ADF→markdown
internal/ticketing/    # The router the UI calls: registry, per-repo binding, key→provider resolution, fan-out
internal/git/exclude.go      # .git/info/exclude writer (resolved via `rev-parse --git-path`)
internal/ui/ticket.go        # TUI glue: materialize on create, infer from branch, status line
internal/ui/workspace_picker_ticket.go # ticket suggestions inside the `w` dialog's New branch field
internal/ui/connect_linear.go # Connect Linear dialog (browser sign-in or pasted API key)
internal/ui/connect_jira.go   # Connect Jira dialog (site + email + API token)
internal/skill/        # Embedded SKILL.md + per-agent install targets (skill.go, SKILL.md)
internal/tmux/tmux.go        # Tmux abstraction (create, kill, capture)
internal/tmux/pty.go         # PTY-based attach with Ctrl+Q detach
internal/session/session.go  # Session model, status detection, claude --resume
internal/session/copilot.go  # Copilot status branch, conversation ownership, relaunch wait (copilot_name.go: titles)
internal/session/antigravity.go # Antigravity status branch (pane-led), conversation ownership, pane detectors, titles
internal/session/agent_process.go # Agent-process helpers: ownership by pid, relaunch wait for Copilot/Antigravity
internal/session/paneview.go # Reader's view of a pane: the prompt it waits on (Menu), the input box (draft vs suggestion), cleaned lines
internal/session/turns.go    # Last N turns (prompt / closing reply / tool count) from a Claude transcript's tail
internal/control/            # Agent-facing observer: the TUI's status pipeline run one-shot over rows + hook files + one batched capture
internal/session/storage.go  # SQLite persistence (sessions, shells, slot_bindings, pinned_repos, …)
internal/instancelock/       # flock-based one-TUI-per-config-dir guard
internal/sqliteutil/         # DSN builder for state.db + stats.db (per-connection pragmas, URI-safe path)
internal/envflag/            # One truthy rule (1/true/yes/y/on) for FLEET_NO_* and other env switches
internal/shell/shell.go      # Shell model: non-agent drawer terminals + tmux-derived status (idle/running/exited)
internal/git/git.go          # Git operations (branch, dirty, worktree)
internal/git/head.go         # ReadHead: checkout root + branch from the HEAD file, no git fork (linked worktrees followed)
internal/git/repo_info.go    # RepoInfo cache + refresh logic
internal/github/pr.go        # GitHub PR info via gh CLI
internal/hooks/              # Hook-based status detection (claude_hooks, codex/opencode/copilot/antigravity hooks, hook_watcher, status_file)
internal/workspace/provider.go     # Provider interface + GitWorktreeProvider + ShellProvider
internal/workspace/repo_config.go  # Per-repo .fleet.json loading (legacy .bc.json supported) + ResolveProvider
internal/config/config.go    # JSON config (~/.config/fleet/config.json)
internal/claudeaccount/      # Multi-account Claude: per-account CLAUDE_CONFIG_DIR + login, auth-status identity, /api/oauth/usage quota, assignment strategies
internal/ui/accounts.go      # Accounts dialog (Ctrl+K → Manage Claude Accounts) + /login pane + quota poll
internal/ui/account_picker.go # Row-anchored "Move to Account…" picker (context menu → move_account)
internal/ui/accounts_header.go   # Top-right per-account weekly-quota readout
internal/naming/naming.go    # Auto-name sessions via smart heuristic (filler stripping, title-case)
internal/stats/              # Local personal analytics: stats.db recorder, transcript scan, Report/Recap (report.go is the UI contract)
internal/ui/stats_view.go    # Stats screen (`i`) — pure renderer of stats.Report
internal/ui/stats_recap.go   # Weekly "Your week" recap reel + header badge
internal/ui/stats_wiring.go  # Recorder tees, scan goroutine, Report/Recap round trips, badge state
internal/debuglog/           # slog-based debug logging to ~/.config/fleet/debug.log
internal/diagnostics/diagnostics.go  # System diagnostics collector for bug reports
internal/ui/                 # Bubble Tea TUI (app, sidebar, preview, dialogs, styles)
internal/ui/palette.go       # Theme palette definitions (5 built-in themes)
internal/ui/settings.go      # Settings dialog (S key) — master-detail: Appearance/Behavior categories + live preview
internal/ui/sidebar_preview.go   # Synthetic sidebar fixtures + RenderSidebarPreview (drives Appearance preview + onboarding)
internal/ui/onboarding.go    # First-run theme picker + annotated "how to read the sidebar" sample
internal/ui/bugreport.go     # Report dialog (! key): type picker → per-kind form, diagnostics, error history, action log
internal/ui/statusreport.go  # Wrong-status branch of the report dialog: expected-status form + allowlisted issue body
internal/ui/actionlog.go     # Ring buffer tracking user actions (steps to reproduce)
internal/ui/firstrun_trace.go # One-shot first-run action trace: vocabulary, recorder, debounced persist, send paths
internal/ui/errors.go        # Ring buffer keeping error history (errors that flash and vanish)
internal/ui/keybindings.go   # Centralized keybinding definitions
internal/ui/workspace_picker.go  # Worktree dialog (base branch + new branch + existing worktrees)
internal/ui/workspace_create.go  # Create workspace sub-dialog + PendingWorkspace phantom entries
internal/ui/command_palette.go   # Command palette dialog (Ctrl+K) — fuzzy search over commands + repos/worktrees, renders as overlay
internal/ui/drawer.go            # Terminal drawer (` key): render, slide animation, focus/key handling, shell lifecycle + live-stream wiring (syncShellStream → OutputReader + vterm)
internal/tmux/control_output.go  # Control-mode %output reader (live shell streaming) + octal decoder
internal/vterm/vterm.go          # Insulated charmbracelet/x/vt wrapper (drawer live rendering; strips ESC k titles)
internal/frost/                  # Frost mode: freeze a rendered frame into a styled cell grid (x/vt replay) and run cell effects over it
internal/ui/frost.go             # Frost mode trigger + tick loop
internal/chrome/protocol.go      # Command/Response types, action constants, socket path
internal/chrome/native_host.go   # Native messaging host with Unix socket bridge
internal/chrome/client.go        # TUI-side client (connects to socket, sends commands)
internal/chrome/install.go       # NMH manifest auto-install to Chrome's NativeMessagingHosts dir
chrome-extension/                # Chrome MV3 extension (service worker, manifest, icons)

Design System

Read docs/design-system.md before any UI work. It is prescriptive, not advisory.

The short version: focus > selection > mode, in that fixed order of visual weight, and a mode never fills. A background fill is the scarcest thing in the UI — spend it on the cursor and the caret. Roles live in internal/ui/design.go (SelectionPill/SelectionBand/SelectionMarker/ModeOn/ModeOff/FocusCaret/PrimaryAction/NewTextInput); build a style inline and you are inventing a fourth dialect. Background(ColorAccent) outside that file fails the build (TestAccentFillIsConstructedInOneFile), and so does a mode indicator that fills (TestModeNeverFills).

The doc also settles the three questions that kept getting answered ad hoc: pill vs band (sized by the filled region, ~40 columns), which presentation tier a new surface takes (full-screen / centered overlay with dimBackdrop / row-anchored dropdown with none), and whether a tab is a mode or a selection (does switching it move the keyboard?).

Styles in styles.go are declared bare and constructed only in ApplyPalette — an initializer alongside would be a second copy, and a style built in only one of the two silently keeps default-pink under every other theme.

Conventions

  • Tmux session prefix: fleet_ (agent sessions); drawer shells use a distinct fleetsh_ prefix — intentionally not a prefix of fleet_, so shells never leak into agent-session enumeration (tmux.ListSessions)
  • Session ID format: <8hex>-<unix_timestamp>
  • SQLite DB: ~/.config/fleet/state.db
  • state.db and stats.db pragmas ride the DSN, never db.Exec("PRAGMA …") (sqliteutil.DSN, called by stateDBDSN in storage.go and by stats.Open; it also percent-encodes %/?/# in the path, which SQLite's file: URI parser would otherwise misread): busy_timeout and foreign_keys are per-connection, and Exec configures only the pooled connection it happens to get — every other one ran with busy_timeout=0 (instant SQLITE_BUSY the moment another writer held the lock, measured 1359 of 1600 concurrent upserts) and with foreign keys off (the slot_bindings cascade unenforced). _txlock=immediate so a read-then-write transaction waits under the busy handler instead of hitting the lock-upgrade deadlock; pool capped at 4 like stats.db. TestEveryConnectionGetsThePragmas / TestConcurrentWritersNeverSeeBusy pin both. The PR cache row is written only when prCacheRowChanged (branch, origin, LastPRRefresh, PRRateLimitedAt) — it used to be rewritten for every repo every 2s — or when an earlier write failed (prCacheUnsaved, retried on the repo's next refresh, since the in-memory cache already holds the new value and prCacheRowChanged alone would never see it again).
  • One TUI per config dir (internal/instancelock, cmd/fleet/instance_lock.go): flock on ~/.config/fleet/tui.lock (holder pid written for the refusal message), taken in runTUI before the auto-update — whose re-exec closes the fd (close-on-exec) so the new binary takes it afresh. Two TUIs each run every worker against the same panes, repos and DB (measured: doubled idle CPU, 145 of 200 log lines database is locked). CLI commands never take it. FLEET_ALLOW_MULTIPLE=1 overrides; a filesystem without flock logs and continues rather than refusing to start over the guard itself.
  • FLEET_PPROF=127.0.0.1:6061 serves net/http/pprof from the TUI (cmd/fleet/pprof.go) on its own mux, loopback only — a profile exposes process memory. Three checks: the address asked for, the address actually bound (localhost resolves through /etc/hosts), and the request's Host header (loopbackHostOnly, against DNS rebinding from a browser page). Started after the instance lock, so a refused second TUI never binds the port. For profiling a real fleet: go tool pprof -top http://127.0.0.1:6061/debug/pprof/profile?seconds=60.
  • fleet worktree <branch> (alias wt, cmd/fleet/worktree.go): the TUI's w key as a CLI command — create the worktree, copy .claude/settings.local.json + copy_files entries, start a session. Flags: --base (defaults to git.GetDefaultBranch), --path (defaults to cwd), --agent (defaults to default_agent; validated explicitly — agent.Parse falls back to Claude for anything unrecognized, so a typo would silently launch the wrong agent), --account (Claude account email; defaults to whatever account_strategy picks. Validated explicitly against the configured accounts — an unknown name errors rather than falling back, since the cost of a typo here is billing the wrong subscription. Rejected alongside a non-Claude --agent, which would silently ignore it), --no-session (print only the worktree path, so cd "$(fleet worktree foo --no-session)" composes; conflicts with --agent, --account and --prompt), --prompt/-p (the agent's first message — -p - reads stdin, so gh issue view 242 | fleet wt fix-242 -p - works; conflicts with --no-session). An explicitly empty -p is rejected rather than ignored: -p "$(gh issue view 999)" on a missing issue expands to nothing, and silently starting a promptless session reads as a broken flag (fs.Visit is what separates -p '' from an absent -p). Flags parse on either side of the branch (a loop peeling one positional per fs.Parse — a single Parse stops at the first positional and would reject fleet worktree foo --no-session). It resolves to the main worktree (git.GetMainWorktreePath) before creating, so running it from inside repo-foo yields repo-bar, not repo-foo-bar — same as pressing w on an origin header. It calls debuglog.Init() first: debuglog.Logger's fallback writes to stderr, and the provider/Session.Start log at Info, so without it the command spews slog lines over the user's terminal (fleet add now does the same).
  • Initial prompt (Session.InitialPrompt, set by fleet worktree -p, fleet add -p, and by fleet send waking a suspended session): the agent opens already working on it, because every agent takes a first message on its own command line (claude "<p>", codex "<p>", opencode --prompt "<p>", copilot --interactive="<p>", each also valid alongside resume/fork). The text never enters that command string. tmux.Session.Start types the launch command into the pane's shell, so an embedded prompt would be parsed by that shell — $(...) and backticks would execute, and a newline would end the command early. Instead the prompt rides tmux new-session -e FLEET_INITIAL_PROMPT=<raw> (agent.PromptEnvVar, set in sessionEnv), which no shell parses, and the command carries only "$FLEET_INITIAL_PROMPT" — one argv element whatever it contains. Two tests pin this: TestBuildLaunchCmdNeverEmbedsPromptText and TestInitialPromptTravelsInEnvNotCommand. Quoting only settles the shell; the agent's own argv parser is a second parser, and it reads a leading - as an option and exits — leaving a live session at a shell prompt with the message gone. So the prompt sits behind a separator that ends option parsing: -- "$FLEET_INITIAL_PROMPT" for Claude/Codex, --prompt="$FLEET_INITIAL_PROMPT" for OpenCode, --interactive="$FLEET_INITIAL_PROMPT" for Copilot (with a space, yargs reads the value as a fresh option). fleet send explicitly promises a message may start with a dash, and the suspended-wake path routes that message through here. One-shot: every launch path clears it on success via consumeLaunchOverridesLocked (which also clears the launch model/effort — see the next bullet) — Start, Restart (the r key, and the idle-suspend wake) and RespawnClaude all build from buildAgentCmd + sessionEnv, so a path that forgets silently re-asks the original task. Never persisted, or it would replay on every app restart. Kept on a failed launch so a retry still carries it.
  • fleet add [path] (cmd/fleet/add.go): a session in a directory that already exists — no worktree, no branch. Takes the same session-shaping flags as fleet worktree (-p/--prompt including -p -, --agent, --account, --model, --effort), parsed with the same either-side peel loop, since a path is not free-form prose. The path is optional (defaults to cwd, like fleet worktree --path) but a bare fleet add with no arguments stays a usage error: it was one before, and a mistyped fleet add in the wrong tab would otherwise launch an agent wherever that tab happened to be. A -p prompt titles the session via naming.GenerateTitle, setting TitleGenerated exactly as the TUI's own fallback does — the agent's own title still overrides it later (that path checks only ManuallyRenamed), while the worker stops regenerating an identical title from FirstPrompt. It calls migration.Run() and debuglog.Init() before session.Open, both of which it previously skipped: session.Open creates state.db, after which migrateConfigDir permanently bails out ("both dirs have state.db") and still writes its marker, silently stranding a brizz-code user's sessions, pins and slot bindings if fleet add was their first fleet command.
  • cmd/fleet/session_launch.go owns what fleet add and fleet worktree do identically once they know where the session goes: resolveLaunchAgent (flag → default_agent, plus the PATH check), resolveLaunchAccount (the per-origin allowlist, explicit-account validation, claudeaccount.Select, the AllowedConfigured split, the all-logged-out note, GuardConflictingAuth), installAgentHooks, and launchSession (hooks → fields → Start → SaveSession → PinRepo). It exists because the two had drifted: fleet add carried a shorter copy of the account logic with no explicit-account branch, no note when the strategy couldn't rank, and GuardConflictingAuth called from inside the wrong branch — a second, weaker implementation of a policy whose whole point is that a mistake bills the wrong subscription. It also never installed hooks at all, so a CLI-created session had no status detection, and a failed SaveSession left an orphaned live tmux pane nothing pointed at. These helpers exit the process rather than returning errors — the shape of the code they were lifted from, kept so the move reads as a move; the cost is that the policy stays untestable and only review catches a change to it.
  • Launch overrides — --model and --effort (Session.Model/Session.Effort → agent.LaunchOpts), on both fleet add and fleet worktree. One-shot on exactly InitialPrompt's terms, cleared by the same call (consumeLaunchOverridesLocked, renamed from consumeInitialPromptLocked when it widened), and never persisted — that is a decision, not an omission: the agents treat these as session-scoped (Claude documents --effort as non-persistent; Codex's /model popup writes its own config) and all of them let the user change model mid-session, so a value fleet stored would be re-imposed on the next restart and silently undo that choice. Unlike the prompt they ride in the command string, which tmux send-keys types into the pane's shell, so a value carrying ;, a backtick or $(...) would be executed — agent.ValidateLaunchValue rejects anything outside ^[A-Za-z0-9][A-Za-z0-9._/-]*$ at parse time, before anything is created, and both commands call that one copy. The charset is sized against real values (opus, claude-opus-5, gpt-5.1-codex-max, anthropic/claude-sonnet-5, high, xhigh, ultracode); model ids change too fast for an allowlist, so shape is the check and the agent rejects an unknown name itself. --model is --model for every agent and is passed through untranslated (each takes its own spelling). Effort is two spellings and one agent that has none, which internal/agent absorbs: --effort for Claude, --reasoning-effort for Copilot (which, unlike Claude, exits on a value outside none|minimal|low|medium|high|xhigh|max, so guardEffortSupported refuses one at parse time via agent.ValidEffort), -c model_reasoning_effort=<v> for Codex (whose value needs no quoting — -c parses it as TOML and falls back to the raw string, so a bare high survives the shell), and nothing for OpenCode. OpenCode has the concept, spelled --variant, and fleet shipped that spelling for exactly as long as it took a reviewer to run the binary: the option is declared on the run subcommand, while fleet launches the default command ($0 [project]), whose builder declares only project, prompt and the network options — and OpenCode's root parser is yargs in .strict() mode, so an unknown option is not ignored, it prints the command list and exits. That would have produced a session fleet reports as created, with its row saved and its repo pinned, whose pane is a shell prompt with no agent — the failure promptArg describes, which nothing in fleet detects at launch. So agent.SupportsEffort is false for OpenCode and --effort is refused there rather than dropped, at parse time when --agent says so and again in guardEffortSupported once default_agent is resolved (the same two-place check --account needs, and for the same reason: the parse-time guard can't see default_agent). BuildLaunchCmd re-checks as well, so a caller that forgets drops the flag instead of launching a command the agent refuses. --model is unaffected — the default command's handler reads args.model. Both are appended ahead of the prompt argument, since -- ends option parsing and anything after it stops being read as a flag (TestModelAndEffortPrecedeThePrompt). Refused with --no-session, like -p/--agent/--account.
  • fleet send <session> <message> (cmd/fleet/send.go): messages a session from the shell — the half of a session's lifecycle the CLI couldn't reach. <message> is every argument after the selector, joined; a lone - reads stdin. Flags must come before the selector (unlike fleet worktree, whose flags parse on either side): a message is free-form prose that can start with a dash, and the flag parser silently eating words out of what the agent receives is worse than requiring flag-first. Delivery is load-buffer + paste-buffer -p + a separate send-keys Enter (tmux.PasteAndSubmit), not SendLiteralKeys: literal keys make every newline its own Enter, submitting a multi-line message a line at a time, and the Enter must land after the paste's closing bracket to read as "submit" rather than as pasted text. Selector tiers, most precise first: @0-@9 slot, exact id, exact title, workspace name, git branch (injected as branchOf so the resolver stays pure — it's the only tier that shells out, hence last of the exact ones), id prefix, title substring. A tier matching several sessions is an error listing them, never a fall-through to a vaguer tier that happens to match one.
  • fleet send guards, in order — each exists because the pane is a typing surface, not an API: suspended → wake it (Restart() with the message as InitialPrompt, then persist the new tmux_session, status and any conversation id adoptResolvedLaunchID just healed — the TUI's worker re-persists that a moment later, but a one-shot CLI process exits first and would recompute and discard the heal on every wake); no tmux / pane_dead → refuse; pane back at a shell prompt (shell.IsShellCommand over tmux.PaneCurrentCommand, after an explicit RefreshSessionCache since the TUI's tick isn't running) → refuse, because /exit or a crash drops the pane to a shell where the message runs as a command — deliberately not -force-able; waiting (session.PaneIndicatesWaiting) → refuse unless -force, since text typed into a numbered menu is discarded and its Enter confirms the highlighted option.
  • fleet send startup handling — a session is launched by typing the agent's command into a fresh pane, so "not ready" and "exited" look alike from outside and the naive one-shot read got both wrong. Two separate waits, because one signal can't cover it: waitForAgentInPane polls up to agentStartupGrace (10s) for the pane to stop reading as a shell (measured process-start ranged 0.6s–7.4s; under-waiting made fleet wt … -p - immediately followed by fleet send fail with a flatly false "has exited", and that branch isn't -force-able). That only proves the process started — the TUI then spends ~2.4s painting, and anything written to the pty in that window is discarded. No signal distinguishes it: the process name has already flipped, and waiting for the pane to settle fires ~2s early (measured: settles at 783ms, input box renders at 2972ms) because the screen sits static mid-startup. So readiness is never predicted — confirmDelivered checks the outcome, polling the pane for the message's whitespace-squashed first line (or Claude's [Pasted text placeholder, since a multi-line paste is collapsed and never appears verbatim) and reporting an honest failure if it never lands. No auto-retry — a re-paste on a false negative submits twice. Costs ~65ms on a live session; a message under 6 chars skips the check, since a short needle would match by coincidence. That last check reads the pane, not the hook: granting a permission fires no hook, so the stored hook status stays waiting long after the user answered — stale in exactly the direction that would block legitimate messages. It returns false for OpenCode (no structural detector for its UI). Waking a suspended session prints a note that an already-open TUI picks the new tmux session up within a few seconds (see the relaunch bullet under external-session adoption).
  • Agent-facing control plane (fleet status / read / wait / answer / interrupt / submit / clear / restart / suspend / resume): one-shot commands a supervising agent drives every session with, instead of tmux capture-pane and guessing. Observation reinvents nothing (internal/control.Observer): one RefreshSessionCache and one BatchCapturePanes for all sessions, then per session FromRow → the hook file into UpdateHookStatus → UpdateStatus — the TUI worker's own pipeline, read-only (nothing written to state.db; session.DisableCrashDumps, since every CLI invocation is a fresh "life" that would dump a dead session again). ~0.15s for 22 live sessions. Three gaps a one-shot observer has and the TUI doesn't, each closed with the TUI's own rules rather than a parallel one: (1) the stale-running-hook rule needs >10s of watched stable content, so on an observer's first look SeedStableContent primes that clock from tmux's window_activity — the fact the rule already defers to — for a running hook only (in the waiting path the same clock means "changed recently" and would flip a fresh prompt to running); (2) answering a prompt fires no hook, so a waiting status with no prompt structurally on screen is reported running — the pane-not-hook rule fleet send's guard already follows (not for OpenCode, which has no pane detector); (3) an Observer is kept across polls by fleet wait, so multi-frame state accumulates exactly as on the worker. Status words: a pane back at a shell reads exited; an acknowledged session reads idle where state.db may still say finished (the TUI's Acknowledge flips memory without persisting status — the CLI matches the screen, not the column). Suspended sessions are counted, not listed, without --all. Output is compact text by default, compact JSON (--json, no indentation — a third of the tokens) for structure.
  • session.PaneView (paneview.go) is what a reader needs, kept apart from the classifier. Menus are parsed only when the agent's own waiting detector agrees (PaneIndicatesWaiting), so a numbered list in prose is never a prompt; numbered rows first, then unnumbered ❯ rows (Copilot's boxed menus, Claude's folder-trust dialog) via parseBoxedMenu. Option rows read the left column only (the AskUserQuestion preview panel sits beside them), continuation lines go to Detail and stop at a side panel's indent or box edge. Subject is the dialog's first dashed (╌) frame — the exact Bash command or the diff — and Claude's Tip: banner is dropped from Context. Kind comes from the footer, with AskUserQuestion's "Esc to cancel"-only variant caught by its own rows (Type something., Chat about this, a ☐ tab). The input box separates a typed draft from Claude's prompt suggestion by ANSI alone: both are the same characters, the suggestion is rendered dim (SGR 2), so visibleRunesAllDim tracks the attribute — skipping reverse-video (the block cursor sits on the first character) and consuming extended colours whole (a 38;5;2 colour index is not dim). Claude only; the creature animation past a 20-space margin is cut.
  • session.ReadClaudeTurns reads a transcript's tail (256KB, doubling to 16MB until it holds one more prompt than asked) — transcripts run to hundreds of MB. A turn's Reply is the text after its last tool call (narration between tools is not the answer); Done from turn_duration, an interrupt, or the next prompt. Tool results are never decoded. The interrupt marker is matched structurally ("text":"[Request interrupted by user, unescaped quotes) and on a top-level user line: newer Claude Code writes api-request-blob lines replaying earlier messages, old interrupt markers included, which otherwise marked the running turn interrupted.
  • Control verbs observe first, refuse anything that would type into the wrong place, act, then check the pane for the outcome. answer moves with arrow keys and verifies the cursor landed on the asked option in the same prompt before pressing Enter (Enter confirms whatever is highlighted); --expect refuses if the question no longer mentions what the caller read; multi-select and tab-focused prompts are refused. interrupt refuses a non-running session (Esc Esc on an idle Claude opens the rewind menu) and a prompt on screen (Esc there is "deny"). clear is C-u then (BSpace, C-u) per extra line, re-read between rounds — never Esc (interrupts a working agent; rewind on an empty box) nor C-c (clears, but arms "press again to exit"). restart respawns in place when tmux is up (the TUI keeps its pointer), full Restart() otherwise, and refuses to resume a Claude conversation with no transcript — Claude writes none until the first prompt, so --resume on a never-prompted session fails with "No conversation found" and drops the pane to a shell — unless -fresh. The guard checks ResolveLaunchID's id, the one the relaunch actually resumes, not the transcript status reads (which falls back to the row's id). -fresh drops the id in memory only; persistRelaunch writes the empty id once the launch worked, so a failed one keeps the pointer to the old conversation. restart, resume and the fleet send wake refuse a session pinned to a removed Claude account (accountGoneErr): the launch would fall back to the ambient login and silently bill another subscription. The TUI's healAccountBeforeRelaunch re-picks instead, but where to move depends on quota and login state that live only in a running TUI, so the CLI names the fix rather than guessing; logged-out and spent pins fail visibly in the pane and aren't checked. suspend persists the conversation id the hooks reported before acting: with no TUI running nothing else has, and Suspend deletes the hook file it came from, so the next resume opened a new conversation (caught live). It also writes suspended to the row before the kill (restoring it if the kill fails), as Suspend marks memory first: an open TUI that sees the tmux session vanish reads the row, and one still naming a live state had it log a crash and persist error over the suspend. remove takes the shared selector minus the title-substring tier. Errors name the fix (fleet restart <id>), and fleet send's now do too.
  • fleet wait exit codes are interface: 0 reached (with -until done, finished cleanly), 2 timeout, 3 blocked on a prompt, 4 exited/errored; it returns early on 3/4 rather than sitting out the timeout, and prints the final reply. A state that already holds at the start counts only after waitSettle (3s), or once a hook in a strictly later second than the start lands (stamps are whole seconds, so a Stop from earlier in the send's own second would pass; UserPromptSubmit excluded), or once the session was seen not matching — so fleet send …; fleet wait … never returns before the agent picked the message up (waitCounts). A SessionStart latest hook counts only after settle: it maps to finished, and a launch or wake with a first prompt fires it just before that prompt's UserPromptSubmit, after the relaunch already showed running — otherwise send -wait on a suspended session returned the previous turn's reply. Rows are re-read every poll, so a session relaunched into a new tmux session mid-wait is followed rather than read as gone. fleet send -wait uses the send time as that boundary with a 20s fallback.
  • Pipeline fixes the control plane surfaced, all in the shared status code: Claude's folder-trust dialog now reads waiting (its "Quick safety check" wording matched none of approvalPatterns; Yes, I trust this folder added); after a denied permission the session settles to finished instead of reading running for the whole 120s conversationActiveWindow — the deny's tool_result and interrupt lines are stamped after the waiting hook and read as the lead advancing, so lastLeadTranscriptTimestamp now also reports turnEnded when a turn_duration/stop_hook_summary follows the lead's last entry in file order (the timestamp itself is unchanged: bookkeeping still never moves it); and StripANSI decodes runes before matching the 8-bit CSI, since 0x9B is also a UTF-8 continuation byte (▛ U+259B) and was eaten along with the text after it.
  • fleet skill <install|uninstall|status> (cmd/fleet/skill.go, internal/skill): installs the Agent Skills SKILL.md that teaches a coding agent to drive fleet's CLI. Opt-in, unlike hook injection — hooks are load-bearing (no status without them), a skill is a convenience, and it costs its description in the context of every session in every repo, so it stays the user's call. Discovery is fleet -h (worded at agents: "run fleet skill install yourself, it never prompts") plus a tipOnce in the TUI. Never prompts and never reads stdin, so an agent can install it for itself in one call. Writes two roots, not four, because the agents overlap: ~/.claude/skills (Claude Code; also read by OpenCode and Cursor) and ~/.agents/skills (Codex, Cursor, OpenCode, and Copilot — which reads ~/.copilot/skills or ~/.agents/skills and is detected by binary only, since the VS Code Copilot extension creates ~/.copilot without the CLI). Neither root alone suffices — Codex reads only .agents/skills, Claude Code only .claude/skills — and Cursor/OpenCode map to .agents/skills so either one installed without Claude Code still lands somewhere it reads. Agents sharing a root share one write (run dedupes by path), so three selected agents don't race three writes at one file. Selection is by name, the operation is by path, and the report must follow the path — run acts in a first pass and reports in a second, so an agent the user didn't select whose file was written or deleted anyway (because a selected agent shares its root) reports what really happened, tagged SharedWith and rendered (shared with codex). Reporting it as skipped told an OpenCode user their skill was untouched in the same breath as deleting it. Read-only Status deliberately does not disclose sharing: nothing changed, so there's no side effect to own up to, and disclosing it would make an explicit -agent filter look ignored. Frontmatter is restricted to name + description: that's the intersection every target accepts (Claude Code's packaging validator rejects unknown keys outright), and name must equal the install directory or the skill silently never loads — TestFrontmatterIsPortable pins both. Written via temp-file + rename because Claude Code watches skill dirs for live changes, so a partial SKILL.md can be read mid-write. Install defaults to detected agents; uninstall and status default to all (the copy worth removing or finding usually belongs to an agent the user has since uninstalled), and every verb honours -agent — status silently dropping a valid filter would be the same swallowing resolveAgents rejects for typos. Detection is binary-on-PATH, plus a config dir only where fleet never creates one: ~/.cursor counts (Cursor installs its cursor shim only on request), ~/.codex and ~/.config/opencode count (their injections are LookPath-gated for exactly this reason), and ~/.claude explicitly does not — NewHome calls InjectClaudeHooks ungated and it MkdirAlls the dir, so every fleet user has one whether or not Claude Code exists. Trusting it installed a Claude skill for Codex-only users. A skipped agent's printed reason re-checks detection rather than assuming: telling a Cursor user Cursor isn't installed, when they merely passed -agent claude, is a false claim about their machine. The TUI's tip samples skill.AnyInstalled() once in NewHome, not from the tip's active() — that runs on the ~2s Update tick, where filesystem calls don't belong.
  • External-session adoption: the TUI reads sessions from SQLite exactly once, at startup (loadSessions), so a session created by another fleet process would be invisible until restart. maybeSyncExternalSessions (heavy worker pass, self-throttled to adoptSweepInterval=5s) diffs the table against the cycle's snapshot via the pure unknownSessions and sends adoptSessionsMsg; handleAdoptSessions re-checks sessionByID (the snapshot is taken at cycle start, so the Update goroutine is the only authoritative dedupe point) then mirrors handleSessionCreateResult minus SaveSession/analytics. Removals ride the same sweep (externalRemovalsMsg, #304): a session is dropped from memory when its row is gone and its tmux is dead (goneSessions) — the liveness half is what spares a session this TUI just created, whose tmux is up before its SaveSession lands. Pinned checkouts whose directory no longer exists (missingDirs, a definite not-exist only) are hidden, never unpinned: moved from pinnedRepos to missingPins in memory and restored when the directory returns, so a remount doesn't cost the pin — but only while SQLite still holds it (externalRemovalsMsg.pinned), since dropping out of the missing set also happens when the header delete unpins it. The message goes out every sweep, not only when the missing set changes: memory can drift while the set stays the same (unpin, then u before the next sweep). fleet remove itself still leaves its pin behind, like d on a session row; the hide is what clears a worktree deleted afterwards. Unlike a session the user just created, an adopted row arrives on a timer, so the cursor must not move: it's captured with targetForCursor() and restored by identity via target.find after the rebuild. No resurrection risk — deferDelete deletes the SQLite row immediately, ahead of the 5s undo window.
  • External relaunch/suspend: another process (fleet restart/resume, a fleet send wake, fleet suspend) can give a known session a new tmux session or suspend it, and the TUI used to keep pointing at the dead one — reading it as an error, and pressing r there would start a second agent on the same conversation. relaunchedElsewhere (pure, beside goneSessions) finds them, and direction is decided by liveness, not by which side differs: this TUI's own relaunch also leaves memory and row disagreeing until the row is persisted, but then memory names the live tmux session, while another process's relaunch leaves memory on a dead one and the row on a live one. Two paths apply it: the 5s sweep (sendExternalRelaunches → externalRelaunchMsg), and compare-before-clobber in updateAndPersistStatus — a session whose tmux is gone on the way into error first has its one row read (LoadSessionLaunch) before UpdateStatus runs, because that reads a missing tmux session as a crash and acts at once (a crash dump, session_errored), and the worker's persist of error would erase a CLI suspend's suspended within one fast pass, long before the sweep reads it. A session suspended here and woken elsewhere (fleet resume, a fleet send wake) is a relaunch like any other — this TUI's own suspend never renames the tmux session. Every adoption path skips a session with a relaunch in flight (Session.Relaunching): mid-Restart memory already names a tmux session that isn't up yet, which is exactly what another process's work looks like. A change also carries the tmux name memory had when the worker diffed (fromTmux), and the handler drops it if memory has moved on since — this TUI relaunching the session between the sweep and the message would otherwise be overwritten with the CLI's tmux session, orphaning its own agent where no later sweep could see it (both tmux sessions are up). AdoptExternalRelaunch resets in-memory hook state without deleting the status file (by then it may be the new agent's), and restarts at starting rather than trusting the row's status, which the worker may already have overwritten. In-place relaunches (respawn-pane, tmux name unchanged) need neither: hook ownership follows the new agent process once the old pid is gone.
  • Sessions grouped by git repo root in sidebar with tree lines (├─/└─)
  • Status: Running, Waiting, Finished, Idle, Error, Starting, Suspended
  • Status icons: ● (running/finished), ◐ (waiting), ○ (idle/starting), ✕ (error), · dim (suspended — same dot as idle; dim style + "suspended" label distinguish it)
  • Agent glyph: each session row shows a dim, monochrome per-agent sigil between the status dot and the title — ✻ Claude, ◇ Codex, △ OpenCode, ⚇ Copilot, ✧ Antigravity (agentGlyph + AgentGlyphStyle in sidebar.go/styles.go); all are width-1 glyphs from well-covered Unicode blocks (Dingbats / Geometric Shapes — same block as the status dots; ⚇ is Misc Symbols, East-Asian-Neutral and present in Menlo; ✧ is Dingbats, Neutral, checked against Menlo's cmap) so they stay aligned in base mono fonts; identity is carried by shape so the status dot keeps sole ownership of color; empty/legacy Agent falls back to Claude
  • Keybindings: j/k nav, Shift+↑/↓ jump to prev/next group header (origin or checkout — from a session row the nearest header above is its own checkout header, so Shift+↑ surfaces the current group before climbing out; clamps to the first/last row when no header remains, so it doubles as top/bottom), Ctrl+Shift+↑/↓ the same motion one level up — origin headers only, so a repo with a dozen worktrees costs one press instead of a dozen (both share nextRowMatching, so the "own group first" landing, the edge clamp and the out-of-range guard can't drift apart; needs a terminal that sends CSI 1;6A for the chord — iTerm2/Ghostty/kitty/WezTerm/VS Code do, Apple Terminal does not), Enter attach, Space jump to next waiting/finished, P jump to the first session of the next checkout whose PR badge is red (CI failed / changes requested / unresolved threads / conflicts), else the next green one (approved + CI passed) — a collapsed checkout is expanded to reveal it, as Space does, and a checkout with no sessions lands on its header; the verdict is prVerdict, the same classifier prBadgeStyle paints from, so the jump can never land on a badge a different colour than it seeks; only checkout headers on screen are candidates (a collapsed origin hides its headers, muting it exactly as Space mutes its sessions; a collapsed checkout still shows its header), and snoozed checkouts — own deadline or origin umbrella — are skipped; drafts/merged/closed are never targets, and with PR badges turned off in Settings the jump is a no-op, since there is no badge to land on. Not a Space chord, though that was asked for: Ctrl+Space is macOS's "previous input source" shortcut on any Mac with two layouts, so the terminal never sees it, and Shift+Space arrives as a plain space — measured in Ghostty outside tmux (kitty flags=1, "space" for both) and through tmux — so it would silently fire Space's session jump instead; Alt+Space types U+00A0 unless the terminal sends Option as Meta. P pairs with p (open PR); like every uppercase command it is unreachable under caseless layouts (Hebrew/Arabic), where Ctrl+K → "Jump to Next PR Needing Attention" is the escape, a new session (instant, repo-scoped, default agent), A new session with agent picker (Claude/Codex/OpenCode/Copilot/Antigravity) + Claude account picker (Auto plus each account with its 5-hour quota; the row appears only with 2+ accounts and goes inert on a non-Claude agent), n new session (any repo, path autocomplete), w new worktree session (base branch + new branch; works on a session, checkout header, or origin header — an origin header bases the new worktree on the group's main clone), F fork to worktree (Claude-only), d delete (scope follows cursor: session = that session; worktree header = sessions + git worktree remove; repo header = forget repo from fleet, folder untouched; empty repo header = unpin; origin header = forget the whole group, checkbox-gated), u undo delete (5s window), r restart (confirm, configurable), R rename, m mark session as unread (idle→finished), z snooze (scope follows cursor; z again on a snoozed row wakes it), e editor, p open PR in browser, Ctrl+P copy PR link to the clipboard (same PR p resolves; copied via the copy-command tool — pbcopy / wl-copy / xclip / xsel; VS Code/Cursor's integrated terminal on Linux/Windows takes Ctrl+P for Quick Open before fleet sees it, so there Ctrl+K → "Copy PR Link" or the . menu is the escape — macOS is unaffected, Quick Open is Cmd+P), Y quick approve (waiting sessions), . context menu for the row under the cursor (session rows include "Move to Account…"), / filter, Ctrl+K command palette, t my tickets, i your stats (w inside it: weekly recap), ` toggle terminal drawer, S settings, W what's new (release notes reel), X dismiss on-screen tip, ! report (wrong status / bug / feature picker, captures a status snapshot on keypress), ? help (sectioned + type-to-filter), ctrl+c quit
  • Non-Latin keyboard layouts (issue #239): a terminal reports the character the layout produced, not the key pressed, so under a Hebrew layout the physical j arrives as ח and every letter command falls through handleKey's switch msg.String() silently. internal/keylayout holds one chart per layout (Hebrew, Russian, Arabic, Greek) written in the US-key → produced-character direction — the direction a keyboard chart reads, which is the only practical way to review it against one — and inverts them. The safety rule lives in buildToUS, not in discipline: an entry survives inversion only if the produced character is non-ASCII. Every fleet binding is ASCII, so a hit can never shadow a key the user actually pressed; that's why callers need no "is this already bound?" check and why a Latin layout (AZERTY/QWERTZ/Dvorak) is provably untouched. The cost is that positions emitting ASCII on their own layout aren't remapped (Hebrew q→/, Greek q→;), and Arabic b can't be (it produces the two-rune ligature لا) — all three are asserted as documented gaps, so a real omission still fails the test. normalizeKey (internal/ui/keylayout.go) rewrites both Code and Text: Key.String() returns Text verbatim when non-empty, and String() is what every switch here matches on, so setting only Code would pass a unit test and still dead-press in the app. Ctrl/Alt chords are skipped — they already carry a Latin letter on every layout. Two call sites, each placed so a text input is structurally out of scope rather than merely avoided: in handleKey below the modal/launchpad/focus/filter/drawer branches, and in routeToModal for the 8 dialogs owning no textinput (TestNormalizedDialogsHoldNoTextInput parses routeToModal for Update(cmdMsg) calls and fails if a text-owning dialog joins them; TestFindTextInputDetects is its positive control, since a blind detector would make it pass unconditionally). Deliberately never reaches forwardKeyToPane/handleFocusKey — those push msg.Text into tmux, so a Hebrew user's shell must receive Hebrew. One exception, and it's a symmetry fix, not a convenience: handleTypingKey matches the drawer's chrome on the US position (switch normalizeKey(msg).String()) because it intercepts keys above the remap — without it, Russian ё (which sits on the backtick key) would open the drawer and then be typed into the shell, with nothing left that closes it. Only the chrome comparison is remapped; everything forwarded stays literal. Cost: ё reaches the shell only via Ctrl+G full attach, the same trade already made for Ctrl+T/Ctrl+W (TestNonLatinKeyClosesDrawer). Caseless scripts (Hebrew, Arabic) send identical bytes for ש and Shift+ש — the shift isn't in the byte stream and no table can recover it — so the uppercase commands (A R S W X Y D F) stay unreachable by their letter there; Ctrl+K and . are the layout-independent escapes. Russian/Greek carry capitals, except Greek W: shift+w and shift+s both emit Σ and S (settings) owns it.
  • Terminal drawer (` key): a collapsible panel holding plain non-agent "shells" (dev servers, log tails, scratch commands), scoped to the selected repo/worktree. Separate from sessions (internal/shell, shells SQLite table) — never in the sidebar, no hooks/auto-naming. Placement is layout-aware (see renderBody in app.go): in dual it splits the right column — preview on top, terminal below (lipgloss.JoinVertical), session list untouched and full-height; in single/stacked it falls back to a full-width band at the bottom that shrinks contentHeight. renderDrawer(width, maxOuterH) clamps its outer height to maxOuterH (in dual that's contentHeight - drawerMinPreviewRows, so the preview keeps ≥5 rows). Renders as a bordered panel (fleet's panel vocabulary, accent border when focused) with tabs inset in the top border and a loud ● TYPING → <shell> label top-right. The body is a live virtual-terminal emulator (internal/vterm, wrapping charmbracelet/x/vt) fed by a tmux control-mode %output reader (internal/tmux/control_output.go → OutputReader, attached per active shell, re-pointed on tab switch/restart): byte- and cursor-accurate, event-driven (no capture-pane polling), rendered each frame on the View thread. syncShellStream/startShellStreamAsync/teardownShellStream (drawer.go) own the reader+emulator lifecycle — the attach (a tmux -C + PTY fork) and teardown (Close = Kill+Wait) run off the Update goroutine (async dispatch → shellStreamReadyMsg, installed only if the requested target+size are still current; attachShell uses a synchronous teardown before its full-screen takeover). On attach the fresh emulator is seeded via capture-pane (tmux.CapturePaneANSI → drawerSeedBytes): control mode replays nothing on attach, so without the seed the body is blank until the next output. The reader sizes the pane to the drawer body so wrap points match (renderDrawer records drawerInnerW/H), and the drawer is a stable-height viewport (capped by drawer_height, clamped to [DrawerHeightMin,DrawerHeightMax]=[4,14]), not content-fit. The reader writes bytes into the mutex-guarded emulator and schedules a single coalesced shellOutputMsg render wake (shellWake CAS); a slow drawerSyncInterval tick is the lifecycle/resize backstop. vterm strips screen/tmux ESC k … ST set-title escapes that x/vt would otherwise leak as visible text. Always-typing, 2 states (drawerMode: hidden/typing — see internal/ui/drawer.go): ` opens straight into TYPING (auto-creates a shell if the repo has none) — keystrokes forward to the shell pane via the focus-mode control client (forwardKeyToPane, which maps any Ctrl+<letter> → tmux C-<letter> so the shell's own line-editing keeps working; Esc passes through to the shell). No menu mode; chrome is a small set of Ctrl chords intercepted before forwarding: Ctrl+T new shell, Ctrl+W close (twice to confirm a running one, armed via drawerCloseArmed), PgUp/PgDn switch tab (plain or Ctrl-modified both accepted; chosen for reliable delivery — no modifier a terminal might swallow; costs the shell's PageUp/PageDown inside the drawer), Ctrl+G full attach (Ctrl+Q returns), ` close drawer. An exited shell restarts on Enter (no live process to type to). Cost: the shell loses Ctrl+T (transpose) and Ctrl+W (delete-word) to the drawer. Status (○ idle / ● running / ✕ exited+code) derives from tmux pane_current_command + pane-dead, no hooks. Shell tmux sessions use the fleetsh_ prefix; removing a worktree kills its shells first (killShellsForRepo) so the dir frees for git worktree remove. Max body height via drawer_height config (default 12).
  • Session hotkeys (RTS-style): Alt+0-9 (or = then digit) binds the selected session to a slot; re-pressing Alt+<N> on a session already in slot N unbinds; == then digit clears any slot; plain 0-9 jumps to the bound session (double-tap within 400ms also attaches); [N] badge in sidebar marks bound sessions; bindings persist in SQLite slot_bindings table (FK cascade on session delete)
  • Help sheet (?, internal/ui/help.go): 53 bindings grouped into sections (KeyBinding.Section, labelled by helpSections), filterable by typing. Two facts forced this: the session block is 23 entries, and every column was sized to the single widest binding in the table (colW = keyW + 2 + descW over all of them), so one 46-character description made two columns need ~130 terminal columns — at 80×24 the sheet was one column with 37 of 51 bindings off-screen, reachable only by j/k. Columns are now measured against their own contents (newHelpChunk), which is why the four slot bindings moved into their own slots section: they carried the two longest strings and were setting the width for every other key. The column count is chosen height-first (fewest columns that fit both budgets, falling back to the most that fit the width when nothing fits the height): a width-only search renders a two-hit filter as two one-row columns, which is what the pre-rewrite colsByHeight term existed to prevent. Sections flow across column boundaries rather than pinning them — packing whole sections into columns would floor the sheet at the height of session (23 rows) and make 100×30 worse than before; a section split across a boundary repeats its header as … (cont.). Typing breaks the old "press any key to close" contract deliberately, and with it j/k/g/G as scroll keys (scrolling is arrows / PgUp / PgDn / Home / End; esc clears a filter before it closes the sheet, so one press never discards both). The ⋮ +N above/below scroll notes ride the separator rows the frame already has (the blank under the filter and the blank above the hint), so scrolling reserves no rows of its own — overflowing by k rows hides exactly k, and the frame is identical whether or not the sheet scrolls. A version that added two indicator rows on overflow turned the one row the P binding added into three hidden bindings at 120×40 (TestHelpSheetHoldsTwoColumnsAt120 pins both budgets: whole at 120×42, exactly one row over at 120×41). Headers drop while filtering, following the palette's rationale, and the section folds onto the row instead — load-bearing, not decorative: `, Enter and PgUp/PgDn each appear in two sections meaning different things, so a filtered list without the tag shows one key contradicting itself. routeToModal hands this overlay the raw key, not the normalizeKey-remapped one, or a Hebrew user's search box would silently type Latin — which also moves it out of TestNormalizedDialogsHoldNoTextInput's scan set, so TestNonLatinTypingReachesTheHelpFilter guards that direction instead.
  • Context menu (.): a dropdown anchored to the sidebar row under the cursor (internal/ui/context_menu.go), listing the actions valid for that row kind — session / checkout header / origin header, seeded from the existing cursorBarContext() classifier. It adds no behavior of its own: each entry carries a dispatchCommand action id (buildContextMenuItems in app.go), so handlers, action-log entries, and analytics are inherited from the command palette's dispatcher. Three ids were added for it: delete_at_cursor (→ deleteAtCursor(), the scope-follows-cursor delete the d key now shares), toggle_group, and resume (a suspended row can't attach — its tmux is gone). Actions that exist but can't run right now render dimmed with the reason and are skipped by j/k. Every such guard is a conjunction, so the note switches on which clause failed — a Claude session with no resume id yet says no session id yet, not Claude only; a waiting session whose pane died says session not running, not not waiting. A constant note there is a bug: it contradicts the status dot rendered next to it. The guards mirror the real handlers exactly, so a lit row can never dead-click. Each row shows its keybinding and pressing that key inside the menu fires it, making the menu a discovery surface that trains users onto the faster path — so a row's shortcut must be the key that actually works: resume is pinned to a literal ⏎ because handleKey's suspended check runs above the split-mode Enter↔Tab swap, so Enter resumes in both modes. Renders via the palette's overlay pattern (View() returns a bare box, composited with overlayAt) but without dimBackdrop — it's a small box beside its row, not a modal takeover. Anchored by contextMenuAnchor() (sidebar content starts at y=2 in every layout: header row + panel border; +1 more when viewOffset > 0 adds the "… N more above" row); hangs below the row and flips above near the footer.
  • Context menu target (contextMenuTarget in app.go): the menu's entries all resolve their subject from h.cursor at dispatch time, so the cursor must still be on the row the menu named. Keys can't move it (routeToModal feeds them to the menu) but messages can — handleSessionCreate and the workspace-create handler both auto-select the row they just made, and rebuildFlatItems runs on the tick. Since workspace creation is non-blocking by design, a session finishing while the menu is open would slide the cursor onto a different row and d would confirm deleting a session the menu never named. So . captures the row's identity (targetForCursor) and the contextMenuMsg handler re-finds it (focusContextMenuTarget) before dispatching, refusing if the row is gone. Two guard tests: TestContextMenuIDsAreDispatchable parses dispatchCommand's case literals and fails if a menu id isn't handled (the dispatcher no-ops silently on unknown ids, so a rename would otherwise turn an entry into a dead click), and TestContextMenuDispatchFollowsTargetNotCursor moves the cursor under an open menu and asserts the action still hits the original row.
  • Command palette (Ctrl+K): renders as an overlay over the sidebar/preview (not a full-screen takeover); fuzzy-searches commands plus every repo/worktree currently in the sidebar (name, branch, full path all matched); picking a repo/worktree jumps the sidebar cursor to that header (auto-expand if collapsed); palette-only commands include "Reload All Sessions" (restarts all dead/error sessions). For a native Cmd+K feel on macOS, map Cmd+K → Ctrl+K in your terminal prefs (iTerm2: Profiles → Keys → Key Mappings → +; Ghostty: keybind = cmd+k=text:\x0b).
  • What's New (W / Ctrl+K → "What's New"): a curated release-notes reel. An animated rainbow ✦ What's New badge (internal/ui/whatsnew.go → renderWhatsNewBadge: a static Lab-blended ROYGBIV rainbow (lipgloss.Blend1D) with a narrow glint sweeping letter-by-letter, whatsNewFrame advanced by a ~60ms whatsNewTickMsg loop that self-reschedules only while visible — no idle CPU) composites at the top-right of the header (overlayAt, x=width-w-1, y=0) in View(), gated on hasUnseenWhatsNew && !modalOpen(). Content is the existing ReleaseNotesDialog in whatsNew mode: only each release's ### Highlights section, for releases newer than the seen version and within whatsNewWindowDays (7) — shared predicate isUnseenHighlight keeps the badge and the reel in agreement. Opening either view marks seen (config.ReleaseNotesSeenVersion via MarkReleaseNotesSeen, seeded to the running version on first run so fresh installs aren't nagged) → badge clears. Releases load once at startup (loadReleaseNotes from Init) so the badge computes without opening the dialog. Highlights only exist from the first release shipped after this landed (older releases carry no Highlights section). The full "Release Notes" view hides the duplicate Highlights block.
  • Contextual tips: a bottom-right hint box surfaces actionable tips when a condition holds (catalog in internal/ui/tips.go → tipRegistry). Two policies: tipRecurring (condition-driven, e.g. ≥4 error sessions → "Reload All Sessions" hint; dismissal is in-memory and the tip recurs when the condition repeats) and tipOnce (no recurrence, e.g. command-palette discovery; auto-expires after tipOnceBudget and is persisted in config seen_tips). A teaching tipOnce may also set LearnedKey: once the user has invoked that feature tipLearnedThreshold (5) times — counted in config feature_usage via Config.NoteFeatureUsed, bumped at the feature's call site (e.g. Ctrl+K, drawer open) — the tip retires for good even if never seen/dismissed (tipLearned gate in refreshTips). refreshTips runs on the ~2s tick; Shift+X (dismissActiveTip) hides the visible tip; rendered via renderTip + bottom-right overlay (stacked above any toast), suppressed while a modal is open (modalOpen)
  • Undo delete: u key restores last deleted session within 5s window (stacked — multiple deletes each undoable). Tmux kept alive during window for full restore.
  • Pinned repos: repos auto-pinned on session creation, persist in SQLite. Empty repos show dimmed with "(empty)". d on empty repo header unpins it.
  • Delete scope follows the cursor (single-purpose y/n confirm, no extra buttons): d on a session deletes only that session; d on a worktree header deletes its sessions + runs git worktree remove + unpins; d on a real-repo header "forgets" the repo (deletes its sessions + unpins, folder untouched); d on an empty real-repo header unpins instantly (no dialog). Worktree-vs-repo detected via cached RepoInfo.IsWorktreeRepo, falling back to a direct git.IsWorktree check for empty headers the worker hasn't cached yet. Header deletes route through the same deferred-delete machinery, so u undo works (LIFO, per-session).
  • Origin-row delete (d on the top-level origin header): forgets the whole group — every checkout under the origin (main repo + all worktrees) and their sessions. Because it wipes a group at once, the confirm dialog is checkbox-gated (ConfirmDialog.RequireCheckbox — space toggles ◉, y/Enter inert until ticked). confirmDeleteOrigin gathers checkouts via checkoutsForOrigin (scans sessions + pinned + pending, deduped — works even when the origin is collapsed) and fans out to deferDeleteRepo per checkout, so each follows its own rule and u-undo still works. Whether worktree dirs are also removed from disk follows the origin_delete_removes_worktrees config (default true; main repo folder always kept).
  • Worktree removal kills holding processes: leftover dev daemons (process-compose, air, vite/node) that detached from the tmux pane pin the worktree dir and make git worktree remove fail with "Directory not empty". Before removing, destroyWorktree (app.go) finds holders via internal/proc (platform-split discovery: lsof -Fpcn on macOS in proc_darwin.go, a native /proc/<pid>/{cwd,exe,fd} walk on Linux in proc_linux.go; shared prefix-match + kill policy) and SIGTERM→grace→SIGKILLs them — sparing a denylist (editors, language servers, shells, tmux, fleet, ssh). GitWorktreeProvider.Destroy falls back to os.RemoveAll + git worktree prune (package mutex serializes concurrent removes). The delete dialog pre-lists warnings: uncommitted-changes (from the git cache, then re-checked live by the async scan — see the git cadence bullet), running-session count (instant from cache), and an async "Will terminate N process(es): …" line (ConfirmDialog.StartScan/SetScan, gen-guarded; y is held until it lands). If removal still fails, the worktree is re-pinned + flagged ✕ removal failed — d to retry (failedWorktreeRemovals), so d retries.
  • tmux.RespawnPane runs its command as exec <command>: tmux hands a command string to /bin/sh -c, and Debian/Ubuntu's dash forks it instead of becoming it, so after any in-place restart (r, fleet restart) the pane's foreground process read sh for the agent's whole life — fleet status called it exited and fleet send refused it. macOS's sh already execs. The command must therefore stay a single simple command (TestRespawnPaneLeavesTheCommandInTheForeground, which fails on Linux CI without the exec).
  • Tmux status bar configured per session with detach hint (ctrl+q)
  • Attach uses PTY with Ctrl+Q intercept for clean detach (creack/pty + golang.org/x/term)
  • Copy-to-clipboard: a copy-mode selection (drag, double/triple-click, keyboard copy) reaches the system clipboard via tmux.EnsureCopyCommand → set-option -s copy-command <tool> — pbcopy on macOS; on Linux the first usable of wl-copy (needs WAYLAND_DISPLAY) / xclip / xsel (need DISPLAY), display vars read from fleet's own env — the proxy for the client sessions get attached from (clipboardCopyCommandFor); with no display-reachable tool nothing is set, since tmux's default set-clipboard external already OSC-52s copy-mode selections. tmux's default copy bindings run copy-pipe-and-cancel with no arg, which pipes to copy-command and emits OSC 52 (set_clip=1) — the two are independent, not a fallback chain, so a copy-command that fails does not by itself lose the copy (only set-clipboard off does, by suppressing OSC 52). copy-command still matters because OSC 52 is what iTerm2 blocks by default and Apple Terminal doesn't support: a local pipe is terminal-independent. copy-command is a server option (fleet shares the user's tmux server, no dedicated socket), so it's set only when unset, leaving a user's own copy-command alone; it re-checks the live server on each call (no process-level cache) so a tmux server created fresh after a restart still gets it. Set FLEET_NO_COPY_COMMAND (truthy) to opt out entirely — e.g. when deliberately relying on OSC 52 (remote tmux → local clipboard over SSH). Called from Start (server exists) + the startup bootstrap (existing-session users)
  • Extended keys (Shift+Enter): tmux.EnsureExtendedKeys turns on tmux extended-keys (+ appends xterm*:extkeys to terminal-features) so modified keys — most visibly Shift+Enter — reach the agent as a distinct sequence instead of collapsing to a bare \r; with tmux's default extended-keys off, Shift+Enter and Enter are the same byte, so Claude submits instead of inserting a newline. The pane sees \x1b[27;2;13~, not CSI-u \x1b[13;2u: extended-keys-format defaults to xterm and fleet deliberately leaves it alone (Claude accepts both, and the format is another shared-server option fleet doesn't own). tmux only sends the extended form to an app that requested mode 1/2 — Claude requests it whenever TERM_PROGRAM is on its allowlist, and tmux sets TERM_PROGRAM=tmux inside the pane, so the request fires regardless of the outer terminal (pane_key_mode shows Ext 2 when it worked). Both are server options (fleet shares the user's tmux server): extended-keys is set to on unless it's already on/always — and since tmux show-options -sv returns the effective value (not empty-when-unset), this also overrides an explicit extended-keys off (use FLEET_NO_EXTENDED_KEYS to opt out); the exact xterm*:extkeys entry is appended to terminal-features only when absent (no duplicate piling, and not fooled by an extkeys feature on a different pattern like screen*:extkeys). The append is load-bearing only for terminals tmux can't name: tty_default_features auto-detects iTerm2/XTerm/mintty (all of which already carry extkeys) off XTVERSION, but Ghostty is absent from every shipping tmux (3.5a/3.6/3.7 — master only). Necessary but not sufficient — the outer terminal must honor xterm's modifyOtherKeys mode 2. iTerm2 does, unconfigured; kitty never will (it refuses modifyOtherKeys on principle and tmux ignores kitty's own \x1b[>1u request), so kitty needs a manual map shift+enter send_text all \x1b[13;2u. Claude's /terminal-setup is not the fix for iTerm2/Ghostty/kitty/WezTerm — per Anthropic's docs it targets VS Code/Cursor/Alacritty/Zed. Version-gated (extendedKeysSafe): skipped on exactly 3.5 (Alt+Backspace emits invalid bytes, Shift keys mis-encoded — tmux#4146/#4156, fixed in 3.5a) and on all of 3.6/3.6a/3.6b (a fast key burst trips the assume-paste path and leaks the terminal's raw ^[[27;…~ bytes into the pane — tmux#5031, fixed in 3.7; Ubuntu 26.04 ships 3.6a). Both bugs live in the parser for keys arriving from the outer terminal — dead code while extended-keys is off, so they're bugs fleet would be handing users, on their own tmux windows, with nothing pointing back at fleet. tmux ≤3.4 requests mode 1 (Eneks=\E[>4;1m), so it likely gets no Shift+Enter benefit while still taking the server-wide change. Re-checks the live server each call like EnsureCopyCommand; called from Start + the startup bootstrap. The bootstrap path flips the option under already-running agents, which only record their mode request while extended-keys is on — an existing session can eat a Shift+Enter until it's restarted. Set FLEET_NO_EXTENDED_KEYS (truthy) to opt out — e.g. a terminal whose Shift+Enter you've bound differently, or a remote tmux you don't want reconfigured
  • Hyperlinks (Cmd+click): tmux.EnsureHyperlinks appends xterm*:hyperlinks to the server's terminal-features (tmux ≥3.4, hyperlinksSupported; called from Start + bootstrap like EnsureExtendedKeys). Both go through ensureTerminalFeature, which compares whole entries line by line (hasTerminalFeature) — a substring check would let screen*:extkeys satisfy xterm*:extkeys. The version gate is best-effort: the version is read once per process, so a first read before any server exists treats tmux as new, and a pre-3.4 server then rejects the set-option, whose error is ignored. tmux forwards OSC 8 only to a client it believes supports it, and auto-detects that only for terminals it can name — nested setups never qualify (measured under zellij: client features bpaste,ccolour,clipboard,cstyle,extkeys,focus,RGB,title, links stripped to text). Applies to clients attaching afterwards. FLEET_NO_HYPERLINKS opts out. Shift+Enter under zellij can't be fixed from the tmux side (zellij doesn't pass modifyOtherKeys through); a tipOnce (zellij_shift_enter) points at the zellij binding instead — sending CSI-u ESC [13;2u, which tmux parses as Shift+Enter when it arrives from the outer terminal (and then re-encodes for the pane in extended-keys-format). Gated in NewHome on ZELLIJ and tmux.ExtendedKeysUsable(): on tmux 3.5 / 3.6.x fleet leaves extended keys off, so the binding couldn't work there; the tmux half is asked only under zellij.
  • Warp can't drag-copy at all: Warp doesn't deliver mouse drag-selection to terminal apps (no tmux entry into copy-mode), so neither copy-command nor any tmux binding helps — unfixable from our side. ApplyStatusBar shows an amber "⚠ Warp doesn't support drag-to-copy (Warp bug)" on the bottom-right when isWarpTerminal() (TERM_PROGRAM=WarpTerminal)
  • mouse on (set per session) is required for scroll: Claude/Codex render to the main screen (not the alternate screen), so with mouse off the wheel scrolls the outer terminal's scrollback (stale frames) instead of session history. Cost of mouse on is that native click-drag selection needs a terminal modifier (Shift; Option in iTerm2)
  • Mouse (internal/ui/mouse.go): fleet reports the mouse in cell-motion mode (DECSET 1002 + SGR 1006), set on the tea.View by Home.chrome. Click a sidebar row to select it, double-click to activate it (activateCursorRow, the literal body of the Enter handler, so attach / resume / focus-split / toggle-group can't drift from the key), wheel to scroll, and click an entry in the context menu, command palette, snooze picker, account picker or allowed-accounts editor to run it. FLEET_NO_MOUSE opts out, like FLEET_NO_COPY_COMMAND and FLEET_NO_EXTENDED_KEYS. Reporting was deliberately off until now (#268) and the reason has not gone away: v2's eventLoop calls View() after every message and there is no click-only mouse mode, so one trackpad flick is ~300 MouseWheelMsg/sec, each buying a full compose — measured at 220% CPU. Two things hold it off, both in Update/View rather than in any handler: a mouse message is the only kind that does not mark viewDirty, so an event nothing acted on is served the cached frame (Home.screen); and one that does act repaints at most once per mouseRepaintInterval (16ms) with a trailing mouseSettleMsg so the settled state still lands. The wheel scrolls viewOffset and never the cursor — every cursor move fires fetchPreviewForSelected, which forks a tmux capture-pane, so a wheel bound to j/k would fork hundreds of processes per flick; scroll to look, click to select. Geometry is recorded at render, never re-derived: renderBody writes h.layout.sidebar per layout branch (all three put content at sidebarContentTop=2, the constant contextMenuAnchor inverts) and composeScreen writes h.layout.overlay where it already knows the box's x/y. Row maps are built by each dialog's own View as it emits rows (overlayRowMap) because the palette interleaves section headers, a recent label and blank spacers with its results — nothing but that loop knows which line a row got, and sidebarWindow is shared with RenderSidebar for the same reason (the … N more below indicator sits exactly on the first index a naive viewOffset + row returns). Activation is the dialog's own key, returned by ClickRowAt and replayed through routeToModal: enter in a menu, space in the allowed-accounts editor (where enter saves, so a menu-style click would store whatever happened to be ticked), and nothing on the snooze dialog's custom-duration row (enter there means "snooze for what I typed" and the box is empty when you click into it). A click outside an open overlay closes it via its own Esc; nothing falls through to the sidebar behind, which is still painted because the dropdowns deliberately don't dim. Clicks are inert while the drawer is typing or a split is focused — j/k can't move the sidebar there either, and a click that did would point the highlight at one session while the keys go to another; the wheel stays live, since scrolling is looking. Drag, motion and release are swallowed. Not covered: full-screen dialogs, the preview and drawer bodies (neither has scrollback), and drawer tabs
  • macOS TCC-blocked folders: sessions/shells under ~/Documents, ~/Desktop, ~/Downloads fail with "Operation not permitted" because tmux daemonizes into its own TCC "responsible process" and loses the terminal's Full Disk Access grant (unfixable from our side — the access happens in the tmux server, and there's no API to request a folder prompt for a CLI). fleet probes actual access lazily via tmux.DirAccessBlocked (a run-shell ls inside the server, so it reproduces the pane's attribution — not fleet's own process; cached per protected root per launch in handleSessionCreate/forkSessionMsg/createShell) and surfaces a tipRecurring (tipTCCBlockedID) pointing to a Ctrl+K → "Open Full Disk Access Settings" command that deep-links the FDA pane. Opt out with FLEET_NO_TCC_WARNING (remote-tmux/SSH)
  • Idle-session suspend (memory-pressure hibernation): a full fleet of claude --resume processes (~400MB each) can exhaust RAM/swap and get the shared tmux server OOM-killed — taking every session down at once. The background worker's heavy pass runs maybeSuspendIdleSessions (throttled ~20s via lastSuspendSweepAt): it probes perfwatch.MemoryPressure() (platform-split: macOS kern.memorystatus_vm_pressure_level, Linux PSI /proc/pressure/memory — better OOM signals than "Pages free") plus free swap, where low swap escalates to critical per platform rules (SwapEscalatesPressure: trusted outright on macOS's demand-grown swap; on Linux only corroborating a PSI warning, since fixed partitions sit partially used on healthy boxes) and hibernates the most-idle sessions. Only StatusIdle sessions are ever auto-suspended (never running/waiting/starting/finished). Suspend = Session.Suspend(): clearHookState + kill the whole tmux session (frees agent process and the server's pane buffers) + set StatusSuspended; ClaudeSessionID is persisted so the conversation survives. Resume is lazy — Enter on a suspended row runs resumeSelected → Restart() (recreates tmux + --resume <id>) then attaches. Aggressiveness via session_suspend_mode config (GetSessionSuspendMode, default light): off / light (critical pressure + idle>24h) / balanced (warning+ pressure + idle>4h) / aggressive (warning+ pressure + idle>1h). Every mode gates on memory pressure — nothing is suspended on a healthy machine — see suspendIdleThreshold. StatusSuspended short-circuits at the top of UpdateStatus (its tmux is intentionally gone, so the liveness gates would otherwise flip it to error + crashdump); UpdateHookStatus ignores the killed agent's SessionEnd death-rattle while suspended. Excluded from reloadAll (never auto-revived) and status-summary pills (like idle). Palette: "Suspend This Session" / "Suspend Idle Sessions Now". First auto-suspend fires a one-time tip explaining what happened (suspended rows render a dim idle-style ·, so the tip keeps it from reading as a crash).
  • Snooze (z): an attention mute with a deadline — 30m / 1h / 4h / tomorrow 9am, or a typed duration (15m, 30h, 2d). Deliberately not a Status and not Suspend. Not a status because a snoozed session that is waiting is still waiting; overwriting Status would destroy that and force reconstructing it on wake. Not Suspend because snooze never touches the process (Suspend answers "free my RAM", snooze answers "stop nagging me"), which is what makes it safe to snooze a running session. So it's an orthogonal deadline that only the attention surfaces consult: the Space rotation (findNext), the status pills, and the row's dimming. Precedence lives in exactly one place — snoozeState (internal/ui/snooze.go): origin umbrella → checkout umbrella → the session's own deadline. BuildFlatItems resolves it once per session and stamps SidebarItem.Snooze, so no downstream caller re-derives it (the jump scan and the pills both read that field). A session's own snooze runs independently underneath a group's, so it survives the group waking. Group snooze is an umbrella, never fanned out onto sessions — stored in the snoozed_groups table keyed in the same space as collapsed_groups (origin:<key> / repo path), which is why a session created after the snooze is muted too. Snoozing a group also collapses it (setExpanded(key,false)); waking re-expands, symmetrically. Only the group holding the snooze renders a countdown — children carry a bare ☾ so N of them don't repeat one number N times. Marker is ☾ U+263E, not the more obvious ⏾ U+23FE: Menlo (macOS Terminal's default) has no U+23FE glyph and renders a fallback box — the same failure that got U+2B21 rejected for the agent sigils. The suffix comes out of the title's width budget (reserve in renderSessionItem) rather than bumping the constant, since it's present on only some rows. Expiry rides the ~2s Update tick (maybeWakeSnoozed, throttled 15s via lastSnoozeSweepAt) — not the worker, unlike the idle-suspend sweep, which lives there only because it probes memory pressure; keeping snooze on Update means h.groupSnooze needs no lock. Expiry is a reminder, not just the mute ending: a session whose own deadline lapses while it sits idle is flagged unread (the m flip, idle→finished, via expireSessionSnooze → flagUnread) so it re-enters the rotation — expiry only (a manual z wake goes through clearSnooze untouched, since you're already on the row) and session scope only (a group wake never fans out onto its children). Deadlines that lapse while fleet is closed are reconciled in the startup handler for both sessions and groups; FromRow deliberately keeps a lapsed session deadline so that handler can see it and persist the clear — it used to drop it in memory only, which left a dead deadline in the row, harmless until the wake carried a side effect, at which point it would re-fire on every launch. That path runs before the hook watcher has seeded anything, so unlike m the flip is not gated on hook state: on a never-run session it simply doesn't stick. The duration picker (SnoozeDialog, internal/ui/snooze_dialog.go) is a row-anchored dropdown composited via overlayAt like the context menu (no dimBackdrop), holding the four presets plus a free-text duration. The input is the row below the last preset (focus indexes presets, with len(SnoozeDurations) meaning the input), so ↑↓/tab walk the whole dialog as one selection and Enter always acts on whatever carries the highlight — the highlight is the promise. setFocus moves the text input's own focus in step, so the caret only blinks where the highlight is. Typing from a preset row jumps to the input and keeps the keystroke (isTypingKey), so the fast path (open, type 2d, Enter) never needs the arrows. A focused-but-unparseable box refuses rather than falling back to the highlighted preset. parseSnoozeDuration takes a single unit only (15m / 30h / 2d, capped at 30d): deliberately not time.ParseDuration, which accepts combos and seconds we don't offer and has no notion of days, so its errors would describe a syntax fleet doesn't have. Its error strings are user-facing — they render live in the box. The box is fixed width and height (contentW); the verdict line swaps between the key hint and the resolved wake time, and a hint long enough to wrap would grow the box a row mid-keystroke (TestSnoozeDialogHeightIsStable pins this). Preset rows pad the raw text before styling — padding a styled string counts the ANSI bytes and the columns come out ragged. Sidebar-only by design: no global count, no wake toast.
  • Repo headers show branch name (), dirty indicator (*), and PR badge (#N)
  • Stats (i / Ctrl+K → "Your Stats"; internal/stats + internal/ui/stats_*.go): local-only personal analytics in ~/.config/fleet/stats.db (its own file, so "reset my stats" is deleting it; WAL). Scope is fleet sessions only — turns are backfilled from the transcripts of sessions fleet launched (joined via every Claude id a session has had, so a /clear rotation doesn't orphan history), never all Claude usage on the machine. Forks must not count their parent twice, which took three guards: a turn that starts before its fleet session's created_at is dropped at load (a --fork-session transcript copies the parent's history); a Claude id maps to its first owner (claude_ids is insert-or-ignore, because a fork's first SessionStart reports the parent's id and a last-writer-wins upsert handed the parent's transcript to the fork); and the scan reads one file per Claude id, the largest (a fork into another cwd stages a frozen copy of the parent's transcript under the parent's id). The in-fleet half comes from recorder tees: recordStatus beside every persisted status change (updateAndPersistStatus on the worker, suspend, resume, restart, flagUnread), RecordAttach in the attach callback, NoteSession on load/create/adopt and on a new Claude id, and recordStats(stats.Action*) for fleet actions — logAction maps through statsActionFor, a fixed table read by action name only (unmapped actions record nothing); actions logged before their own guard runs (quick approve, mark unread, open PR, copy PR link, open editor) are deliberately absent and record where they succeed — the quickApproveMsg/openPRMsg/copyPRLinkMsg/openEditorMsg handlers on err == nil, and markUnreadSelected past its guards (not flagUnread, which snooze expiry also calls) — or a Y on a running session counted as an approve, plus direct calls at Space/P/slot jumps (through recordStatsJump: counted only when the jump lands on a different row than the cursor started on, and a press within statsRepeatWindow (300ms) of the previous press of the same key — counted or not, so a held key is one jump however long it's held — continues that burst; terminal auto-repeat once turned a held Space into 942 "jumps" in a day), palette/help opens, rename, confirmed deletes, session and worktree creation. The recorder never blocks (drop-on-full queue, one writer goroutine) and every method is nil-safe, so a stats.db that fails to open costs only the feature. Privacy line: stats.db holds enums, ids, numbers, timestamps, model names and repo base names — never prompts, titles, message text, tool input or paths (a transcript is keyed by a hash of its realpath, since the path spells out the home dir and the project's cwd) — and nothing in it ever passes through internal/analytics. Opening Stats is not recorded: pressing i must not inflate the numbers it opens. The first-run screen is chosen on content, not coverage (statsReportEmpty: no turn, no measured reply, no active day in the heatmap year) — status changes start the recording clock and loading the sidebar notes every session before the user has done anything. The transcript scan runs on a tea.Cmd goroutine of its own, never the status worker (whose 90s stall budget is spent on git/gh) and never Update: 10s after launch and on every Stats open (incremental by byte offset, ~20ms warm), progress throttled to ~10/s and skipped during an attach (h.send is a rendezvous the attach suspends). Reports and recaps compute off-goroutine after a Flush, guarded per range by a generation counter. The "Your week" badge is the only push surface: after each scan, and on the tick once the week rolls over (maybeRecapNewWeek — instances run for days), the last full Mon–Sun week's recap is computed, and if it has cards and its Monday ≠ stats_recap_seen_week the badge takes the What's New corner (What's New wins when both are due; hidden while a modal is open), sized to the room the breadcrumb leaves — it drops · press i, then itself, rather than overprint a title. It advertises i, so i with the badge up opens Stats with the recap on top; opening the recap marks the week seen. Recap cards copy with c through tmux.CopyToClipboard, leaving out the lines that name repos (RecapCard.RepoLines) unless r is toggled — repo and worktree names often carry client or ticket names, and a card is copied to be shared. The concurrency curve plots each bucket's peak, not its mean: a 6-hour bucket's mean sits under 1 and never reaches the peak the hero reports. Layout is a card grid (statsGrid): rounded ColorBorder cards with dim titles inset in the top border tile the full width (uncapped — a capped grid floated inside a full-width frame whose title and hints no longer shared its edges), columns pack greedily and wrap by width (a last row left holding one card steals the previous row's last one, rather than stretch a lone card across the screen), cards in a row share a height with a short stack's slack split evenly between its cards, and a card with no data is left out rather than drawn empty (hero tiles keep an honest —). No card should be mostly blank, which took three rules: which cards share a row under the chart is chosen, not fixed — statsLowerLayouts offers a handful of arrangements (everything in one row; records and fun facts stacked or side by side; the notes in a row of their own) and statsBestGrid keeps the one stranding the fewest blank card cells, counting rows under a short body, columns beside a narrow text body (records and fun facts are capped near their natural width so spare columns go to bar cards) and half of a bar card's columns past fullW, plus a per-card penalty for blank rows past statsMaxBlankShare (30%) of that card's body — summed cells alone never saw one hollow card, and let a one-row layout strand half of fleet actions under a tall records + facts stack; height is only a tiebreak (cw/32 a line) until it shortens the chart and dear once it scrolls — at cw/8 it outvoted the waste it was meant to break ties on (TestStatsNoCardIsMostlyBlank, measured off the rendered frame); lists stretched by their row re-render to fill it (statsCardSpec.fit) — fleet actions show the top five and a dim +N more, or as many as the row holds, and fun facts open a blank line between facts when they all still fit; and the agents card exists only when it compares (≥2 agents with turn data), otherwise the agent split rides a dim line under the repos, since one agent drew "Claude 100%" in a tall empty box. statsReportLines picks the richest style that fits — big hero digits + card padding, then padding, then neither — and grows the concurrency chart into the rows left up to statsChartMaxRows (10): taller, a sparse week became a wall of thin spikes. Rows a tall screen still has spare become air, not stretched cards (statsBalance): the page is top-anchored — it starts right under the range tabs, spare rows open at most one blank row between bands, and the rest fall below the page — with the footnote attached one row under the grid (TestStatsViewBalancesSpareRows). Centring floated a short page mid-screen with a band of empty rows between the tabs and the first card; pinning the footnote to the bottom like a status line left 7–12 empty rows between the cards and their footnote at 250×62. The range picker is a tab row pinned at the top of the page (rangeTabs: 7 days 30 days all time · Sep 24 – Sep 30, the window dim beside it), the active tab a mode (ModeOn, never filled); 1/2/3 pick a range directly, [ ] / ←→ / h l cycle. It replaced a ‹ 7d 30d all › chip inset in the frame's top-right border that nobody noticed (a desktop notification covered it in the reporter's screenshot). A blank row under the tabs is spent only when the page fits without scrolling (tabRows). The window moved off the footnote onto the tabs. The scan's progress line rides under the footnote. The plot stops one column short of the card's text edge, or the bar for the hour in progress ran into the right border. The chart never snaps to a multiple of the peak, since eighth-block tops step cleanly at any height. The concurrency chart is solid block columns (statsBlockChart, never braille — Ghostty renders braille as sparse separate dots) laid on equal-width slots (statsChartSlots: with fewer than two samples per column every slot is ≥2 columns, since mixing 1- and 2-sample columns drew bursts as 1-column slivers and gaps), over a dim ─ baseline, with ┈ gridlines only when a level spans ≥3 rows. The heatmap is always two columns per week (one column reads as stripes), shows only weeks with data, and is sized to share a row with repos/agents when ≥16 weeks fit there. A day's level is the higher of two quartile levels, one over fleet actions and one over agent time (statsDayLevels): turns are backfilled from transcripts months before fleet records its first action, and scoring by actions alone once any day had one drew every backfilled day as a zero dot. Only days before the earliest data source (TurnsSince or RecordingSince) are blank. Every cell is the same ■ — a zero day a border-tone square, today a text-colour one, rows labelled M T W T F S S: zero days drawn as · read as static, and a ▣/□ today marker is East-Asian-Ambiguous, which Ghostty draws two columns wide, shearing the grid and eating the legend's space (■ renders one column there). Charts are coloured with StatsRamp (built in ApplyPalette: step 0 is the border tone, the data steps start ~40% of the way to the accent so the lowest band doesn't read as chrome), the one sanctioned exception to "colour means status" (docs/design-system.md §5); concurrency uses three far-apart classes (solo / 2 / 3+). Under the chart, one line splits busy time into those classes (statsShareLines): a when agents were busy caption, a short bar (≤40 cols) and the shares named in their segments' shades — a full-width bar with a swatch legend and no caption read as an unexplained stripe, or as part of the chart's axis. Hero numbers are the only accent-coloured figures (statsFigure, units dim); when every tile in the row fits them and the page doesn't scroll they render in a 3-row half-block font (statsBigFigure — ▀ ▄ █ are solid cells with no seams, unlike box-drawing strokes), as does the recap's figure, centred in the tile (hugging the left edge left a wide tile mostly blank). Units are glyphs in that font too (h m s ×, dim), shaped never to pass for a digit (s is the round S, not the square 5), and a space in the value opens a three-column gap: drawn as ordinary letters beside three-row digits they shrank to subscripts, and 21h 00m read as 2100. Two deliberate exceptions: a thousands comma is dropped ($1,412 draws as 1412) — any one-pixel mark at that size read as a decimal point, including a comma half a row below the period — and $ is a small dim superscript on the top row, as a price tag sets it, since six pixel rows drew it as a blob. A value holding a character the font lacks falls back to the one-line figure. Below the width that holds five full tiles the heroes collapse to a one-row strip (value only, short labels) instead of wrapping 3 + 2. The laid-out lines are cached per (size, range, data generation): clampScroll runs on every key. The API-price dollar figure is a fun fact about tokens you didn't pay for on a subscription, not a bill; it lives in the hero row only. Fun facts that compare or rank must be earned by the data: they wait for minRecordedDays (7) local days of recording (recordedDays: recording_since through today) whatever their samples say — a first weekend can clear every per-bucket gate with one burst — and then a comparison needs minCompareSamples (10) in each bucket it compares and a pattern must span minFactDays (3) distinct days (replySpeedFact, busiestHourFact, the not-attached share); the busiest hour must also hold time from minFactDays days of its own and beat the runner-up by busiestHourMargin (20%), or a near-tie crowned whichever hour came first — MinSamples (5) is enough to show a median, not to claim two buckets differ, and one afternoon of first-day recording produced "your replies get quicker when 2+ other agents are busy". Records only — no badges, achievements or personas.
  • Tickets (internal/ticket + internal/linear + internal/jira, routed by internal/ticketing; opt-out-by-absence): starting work from a ticket, with one mutation. Two independent gates, and both must hold per provider: fleet needs a credential (workspace-level) and the provider must have keys for the repo. For Linear those default to the teams you are a member of (Account.Mine, read off the same workspaceQuery as the workspace — viewer { teams }), so a connected user's own teams are on in every repo with nothing to configure; a repo can name its own team(s) instead (exactly those, not the union) or opt out with {"linear": {"enabled": false}} (linear.TeamKeys, TestTeamKeysDefaultsToYourTeams). That reversed a per-repo-only rule whose required .fleet.local.json step was the one people missed: connected, then nothing, and nothing said why (#373). Jira stays per-repo — it has no membership to read. There is still deliberately no fallback to "every team in the workspace" / "every project on the site": that would put strangers' tickets under the branch field of every repo on the machine, and a real Jira site has hundreds of projects. Your memberships are usually one to three. The memberships are cached in memory only: ticketing.WarmAccounts (TUI startup and fleet worktree --ticket) reads them, and the Connect dialog keeps its verification reading via linear.CacheAccount — without that, a user who had just connected got nothing until a restart, which is the session they try it in. Before the reading lands, and after Disconnect, the default is empty: quiet, not wrong. A defaulted key never outranks an explicit one: a member key the repo names as a Jira project is dropped from Linear's default (the registry breaks ties Linear-first, so otherwise a repo naming Jira OPS would hand OPS-42 to Linear for anyone on a Linear team keyed OPS). A ticket named outright — fleet wt --ticket, or Materialize with no provider — falls back past the repo's keys to any connected account whose workspace has the key (ownerForNamed, cached readings only); a failed account read is reported as such rather than as missing config.
  • The core move is fetching one step earlier than you'd expect. If fleet materializes the ticket at worktree-creation time, the agent never needs to know the tracker exists — which is why fleet ships no tracker skill and no sidebar badge. It hands over content, not instructions.
  • The layering is domain / providers / router, and the domain package imports no provider — that's what keeps it acyclic. internal/ticket owns everything that was never tracker-specific: the Provider interface, Ticket/Document/Result/Account, branch naming, the seeded prompt, the image downloader, the keychain Store, ticket.md, the meta.json ledger and Materialize itself. internal/linear and internal/jira are clients that implement Provider and nothing more. internal/ticketing is the only ticket package the UI and cmd/fleet import; it holds the registry and is the one place that knows there is more than one tracker.
  • A provider is a zero-size value over package-level state, not a struct with fields. That state has to be reachable from Available(), which the Bubble Tea Update goroutine calls and which therefore may not do any work — two atomics behind a package var is what makes that free, and an instance the UI would have to find first is not. Same reason Keys(repoPath) is two small file reads.
  • There is no tracker CLI anywhere in these packages, and that is load-bearing (TestNoTicketSubprocess, an allowlist of the three OS helpers — two keychains and a browser opener — scanning all four ticket packages, so a new subprocess has to be added deliberately). An earlier version shelled out to schpet/linear-cli and ate three version-skew bugs in one session: a Homebrew build compiled without --allow-net=uploads.linear.app that failed every image download and still exited 0; an auth login command absent before v2.5.0; and the CLI's own error text naming a configure command that never existed. The gh precedent did not transfer — gh is already installed for most developers, linear was a download demanded for this feature — and Jira has no comparable CLI, so shell-out was a Linear-only trick rather than an architecture. The guard scans every package because the single-directory version passed vacuously the moment a second provider arrived.
  • Auth resolves per provider, env first, both cheap. Linear: LINEAR_API_KEY → fleet's own store; two credential kinds differing in exactly one place — authHeader() — where a personal API key is sent raw and an OAuth access token takes Bearer (sending either in the other form reads as a rejected credential; TestAuthHeaderFormDiffersByKind). Jira Cloud: JIRA_SITE + JIRA_EMAIL + JIRA_API_TOKEN, all three or none (a site with no token is not a credential, and falling back to the store while JIRA_SITE is exported would authenticate against a different site than the variable names) → fleet's own store; one kind, Basic base64(email:token) — not a bearer, which is rejected exactly like a wrong password with nothing saying the form was the problem.
  • A search term is escaped for TWO parsers, in order (escapeJQL): Lucene first (backslash-prefix its reserved set), then the JQL string literal (double every backslash, escape "). Quoting alone is not enough — Lucene parses the contents of the literal for a ~ comparison, so fix (login typed into the New branch field, which fires a search at three runes, came back as a 400 the dialog reported as "Jira: unavailable". Half a branch name is not evidence that the tracker is down.
  • Jira is Cloud only, and that is enforced by the API version rather than the hostname. REST v3 is what serves ADF and exposes /rest/api/3/search/jql; Server and Data Center speak v2, return wiki markup, and take a bearer PAT — a second fetch path and a second auth story for a product fleet cannot test against. NormalizeSite therefore accepts any host with a dot (Atlassian now serves Jira Cloud on customer-owned domains, and refusing those would refuse an ordinary site) and appends .atlassian.net only to a bare tenant name. A Server site fails VerifyCredential with a 404, which the Connect dialog turns into "fleet supports Jira Cloud only" — the one place that diagnosis can honestly be made.
  • Error classification is per-tracker and the two are opposites, so each has a test saying which way round its API works. Linear answers an unknown issue with HTTP 200 and an errors[] entry whose own extensions carry statusCode 400 (TestGraphQLErrorClassification); reading the status alone would file "no such issue" as a generic failure. Jira answers with real status codes (TestErrorClassification); reading the body first would do the same in reverse. Jira's 404 means "not found, for you" — it deliberately does not distinguish a missing issue from one the credential may not see, since telling an unauthorized caller which keys are real is a leak.
  • The store is first-usable and per provider, mirroring clipboardCopyCommandFor: macOS Keychain (security) → secret-tool (libsecret) → ~/.config/fleet/<provider>.json at 0600. ticket.Store{Service, Label, FileName} carries the names on a value, which is what makes the second provider a construction rather than an edit — the previous version hardcoded fleet-linear in three places and a fourth that disagreed (the secret-tool branch ignored the service it was handed, so the test seam silently did not work on Linux). The secret never touches argv: security -w <value> and -X <hex> both work and both publish it to every ps on the machine, so Save feeds it on stdin twice — security ... -w implements an interactive "type it again" prompt and does not care that stdin is a pipe. Verified against a live keychain. That prompt reads through readpassphrase(3), whose buffer is _PASSWORD_LEN = 128 bytes, and past it security stores the first 128 and still exits 0 — no failure, no warning. The record then reads back as a JSON prefix that cannot parse, the load reports "no credential", and the user reconnects on every launch with nothing saying why. It split the user base in the worst possible way: an API-key record is ~85 bytes and fits, so the paste path looked perfect while every OAuth login was destroyed on every write. So the record is chunked at 96 bytes each, chunk 0 carrying a <total>: header so a torn write reads as absent rather than as a short credential, and old chunks are deleted before a write so a shrunk record leaves no tail. The chunk writer must never build its stdin with append(data, '\n'): data is a slice into the record, so that writes into its spare capacity — the first byte of the next chunk — and it corrupted every multi-chunk write while each call still returned success. TestKeychainStoresRecordsPastThePasswordBufferLimit pins 129 (the first byte over the cliff) and the multi-chunk sizes; a round-trip test with a short value passes either way, which is exactly what the original one did. sanitizeForIssue redacts lin_api_*/lin_oauth_*, ATATT* and a bare Basic <base64> header beside sk-ant-* — the last one because Jira's token is base64-encoded away inside the header, so a prefix rule alone catches only half of it (TestBuildStatusReportBody_NeverLeaksJiraToken).
  • Linear ships both auth paths and the user picks. Browser sign-in is the shorter one; pasting a personal API key is the only one that works over SSH, in CI, where an admin has disabled OAuth installs, and where the user wants read-only or team-scoped access. OAuth is PKCE, so no client secret ships — the client ID is public like projectAPIKey (FLEET_LINEAR_CLIENT_ID overrides). Redirect ports are fixed (53682-53684, first free) because Linear matches redirect_uri against the app's registered list and an ephemeral port is simply rejected; all three busy, or no browser, returns ErrOAuthUnavailable, which is a routing answer, not a failure — the dialog points at the paste path. The state check runs before the code is touched (TestOAuthStateMismatchRejected): the callback is a fixed loopback port, so anything on the machine can reach it during the window. Access tokens last 24h; credential() renews at a 5-minute margin, serialized by refreshMu — without it a ticket with a dozen screenshots starts a dozen downloads that each find the token stale and each spend a refresh. A refused refresh disconnects (the grant is gone), while an unreachable endpoint does not — fleet failing to reach Linear is not evidence against the grant.
  • Jira ships one auth path, deliberately. Atlassian's OAuth 2.0 (3LO) needs an app brizz would register and own forever, and in many organizations a per-site admin has to approve each install — for a credential a user can mint themselves in two clicks at id.atlassian.com. The API token also covers the SSH/CI case Linear needs its paste path for anyway. An Atlassian API token does not expire on a timer, so there is nothing to renew and a rejected one is a revoked one: the honest move is to report it rather than retry.
  • Available(), Resolved() and Keys() are called from the Update goroutine and therefore touch no network and no keychain — atomics and small file reads. The keychain reads happen once, in warmTickets() from Init. Resolved() is separate from Available() on purpose: before the warm finishes, "no credential" is ignorance, not a fact, and anything acting on the absence of one (the discovery tip) must wait. ticketing.Resolved() requires every provider to have warmed, not any — a tip that fires while one is still resolving would offer to connect a fleet that is about to say it already is.
  • Repo keys come from .fleet.json/.fleet.local.json: {"linear":{"team":"BRZ"}} and {"jira":{"project":"OPS"}} (plural teams/projects lists append and dedupe; a local singular replaces the committed one — see the .fleet.json bullet below). Linear also falls back to team_id in a committed .linear.toml; that file belongs to the CLI fleet no longer uses, but reading one key out of a file someone already has costs nothing, and api_key in the same file is never read (TestTeamKeysReadOnlyTeamID). Jira has no such fallback — no tool writes a per-repo Jira file anyone already has. Gating is on the set, not one key — a workspace routinely has several teams and one repo may see branches from both.
  • A ticket that already knows its provider is never re-resolved. ticket.Opts carries Provider, and ticketing.Materialize prefers it, falling back to Owner(repoPath, id) only for a bare identifier nobody has claimed yet (the fleet wt --ticket path). Applying the repo gate a second time was a real regression: search is deliberately unscoped, so a repo tracking only BRZ offers PRD-45, and re-resolving that pick refused it after the branch was named and the worktree created — with ticketStatusLine swallowing ErrNotConnected, so nothing on screen said why. The repo gate decides whether ticket surfaces appear at all; it is not a rule about which issue you may work on. ticketStatusLine no longer swallows ErrNotConnected either — at that call site the user demonstrably has a ticket in hand, so it means the credential went away in between, which is the same argument that already applied to ErrNotFound.
  • ticketing order decides who owns a contested key. A repo naming BRZ as both a Linear team and a Jira project is pathological, but "first configured wins, and the order never changes" is an answer where "whichever the loop reached first" is a coin flip that lands differently between launches. Owner/OwnerIn resolve by the identifier's key prefix; Keys is the deduped union, which is what LooksLikeIdentifier and IdentifierFromBranch gate on.
  • One round trip does everything per provider. Linear: issueFullQuery carries description, comments, labels, assignee, priority, parent/children, attachments, and the team's workflow states, so the optional state write needs no second query — measured at 87 complexity points against a 10,000-per-query cap. Jira: one GET /rest/api/3/issue/{key}?fields=… carries the same, with a second call only when comment.total exceeds the page returned (the newest comment is usually what changes what a ticket means). That call is orderBy=-created, not created — Jira's orderBy is ascending by default, so the plain form fetches the oldest page, the exact opposite of the reason the round trip is worth taking. The page replaces the embedded set only when it is larger (an issue can embed more than commentFetchLimit, and swapping 100 for 50 would lose half of them while looking like a fix), and is reversed back to chronological before rendering so ticket.md reads as a conversation in both trackers. Rate limits are generous against roughly 2 calls per worktree, so no throttling machinery exists in either.
  • ticket.Priority keeps Linear's numbering on purpose — 0 unset, 1 urgent … 4 low — so the palette's priority gauge and its colour ladder need no translation layer and a Jira row renders identically to a Linear one. Rank() exists because the raw number cannot be sorted on: 0 means "not set", so ascending order would float every unprioritised ticket above the urgent ones. Linear's number converts verbatim; Jira maps by priority NAME, not id (schemes are per-project, so the default ids 1..5 mean Highest..Lowest only on a site nobody configured), covering highest|blocker|critical / high|major / medium|normal / low|minor|lowest|trivial. Anything unrecognized is None, not Medium: guessing a middle rank would put it above a real Low, and the list is sorted on this.
  • ticket.StateType normalizes the state category, and ticket.SortAssigned owns the one comparison (state type → position → priority → the server's order, stable) so a merged Linear+Jira list is ordered by the same rule as either one alone. Linear supplies a real StatePos — the difference between "In Progress" and "In Review" leading the list; Jira has no position at all, so it supplies 0 and the tiebreak falls through to priority. Jira has no distinct backlog or triage category either, so both collapse into Unstarted — honest rather than lossy, since a Jira "To Do" really is one bucket.
  • The one mutation. Linear resolves the team's started state by type, against a position-sorted list (TestStartedStateResolvesByTypeAndPosition) — type so it works on a team whose started state is called "In Dev", position because a real team has several started states and the lowest is what a human means by "I'm starting this". Jira has no position and every in-progress-ish status shares the indeterminate category, so startedTransition prefers the exact name "In Progress" (Jira's own default) and otherwise takes the first indeterminate transition in the workflow's own order — picking wrong would move a fresh ticket straight to review. It costs a second round trip, unlike Linear's, because available transitions depend on the issue's current status and the caller's permissions and cannot ride along with the fetch. Fires only on create-from-ticket (config ticket_start_state, default true; the pre-Jira linear_ticket_start is still read when it is unset), never when a later session opens in an existing worktree — by then a human may have moved the issue on. meta.json records state_write so it stays exactly-once, and now records provider too: two trackers can land different issues in one .fleet/ticket/<ID>/, and a Linear write says nothing about whether the Jira issue of the same key has been started.
  • Extensions come from the BYTES, and only from the bytes. Linear's default alt text is literally image.png and its upload URLs carry no filename, so a real PNG would land unnamed and unextensioned — and an agent's file-read tool dispatches on extension, making a perfectly downloaded screenshot unreadable. detectExt sniffs magic bytes (http.DetectContentType) and takes no filename argument at all. It used to short-circuit on a recognized extension, and fetchImage used to read Content-Disposition/Content-Type first — which meant that for Jira, where the alt is the filename and both headers are always sent, the sniff never ran: a 200 carrying an HTML interstitial for screenshot.png landed on disk as a .png, past a check whose whole stated purpose was to stop that. The one exception is SVG, which Go's sniffer cannot name (<?xml reads as text/xml, a bare <svg> as text/plain), so a header saying image/svg+xml is honoured only when the body sniffs as XML or plain text — an HTML body is refused whatever the headers claim (TestBytesBeatHeaders).
  • Images are declared by the provider, never scraped from the rendered markdown. A Document carries Images []Image and writes ![alt](fleet-image:<n>) placeholders into its body; collectImages downloads and rewrites them. The indirection exists because the two providers find their images in incompatible ways and neither can write a final path — the on-disk name is only known once the bytes arrive. Matching is on the whole link target including the closing paren: fleet-image:1 is a prefix of fleet-image:10, so matching the bare token would let image 1 succeeding rewrite half of image 10's link (TestCollectImagesIndexesAreNotPrefixes). A placeholder whose download failed or hit a cap degrades to (image: alt — not downloaded) rather than a dangling link, because an agent told to open every file in images/ will try.
  • Jira downloads every image/* attachment, not only the referenced ones, and that is forced by Atlassian rather than chosen. An ADF media node's attrs.id is a Media Services file id and is not the attachment id the REST list is keyed by (JRACLOUD-96383/96384 are open requests to add the mapping); alt text is the only bridge and Jira frequently writes none. Inline-only matching would silently drop the screenshot on exactly the bug reports that are mostly screenshot. Everything is listed under ## Attachments, inlined where a media node resolved and marked (shown above) where it did. Two indexes, because they answer two questions: ## Attachments looks up by attachment id, since one issue can carry two files both called image.png and a name-keyed map collapsed them — both resolved to the second, the first became unreachable, and one screenshot rendered twice while the other was never downloaded, on exactly the screenshot-heavy bug report this branch exists for. A media node has only the filename to go on, so byName holds a queue and each node claims the next unclaimed index, falling back to the first once they are all taken (the same image referenced twice must render twice, not degrade). Non-images are named, never fetched: an agent cannot read a 40MB video, and pulling a customer's spreadsheet into a worktree unasked is not fleet's call.
  • ADF → markdown is a walker, not an HTML pass (internal/jira/adf.go). v3 serves descriptions and comments as a JSON document tree. expand=renderedFields returns HTML, which needs its own converter and loses the structured media references; v2 returns wiki markup, a different markup language to convert and one Atlassian is moving away from. Walking the tree is the only option that also solves the image problem, since media nodes are where inline screenshots are named. code is applied innermost and suppresses the other marks, because **x** inside a code span is literal backtick-asterisk text. An unknown block recurses into its content rather than dropping — ADF gains node types faster than fleet will track them and their text lives in an ordinary content array underneath. underline, textColor, subsup and border have no markdown form and are dropped silently: the words survive, and a marker for "this was purple" helps nobody.
  • Image gating is per provider and re-checked at the credential. Document.Host is Linear's uploads.linear.app or the configured Jira site, compared on url.Hostname() — never a prefix or suffix, since a suffix test matches uploads.linear.app.evil.example and a prefix test matches it too. https only, so the credential never crosses the network in plaintext even to the tracker itself. ticket.fetchImage re-checks the gate on the line that attaches the credential: a gate one call away from the thing it protects is a gate a later refactor removes without noticing. imageClient refuses every redirect, because Go strips Authorization only across a registrable-domain change and deliberately permits uploads.linear.app → anything.linear.app. Issue bodies and attachment records are attacker-influenced content — anyone who can write to an issue fleet later materializes, including through Linear's customer requests and Jira's public service-desk intake.
  • Files land at <worktree>/.fleet/ticket/<ID>/ — inside the worktree so the agent reads them with a relative path and no permission prompt, since a prompt on the session's first act renders as - waiting, the friction this feature removes. Deliberately not namespaced by provider: that would change the path under every worktree that already exists and lengthen the one line of the seed prompt an agent has to act on, to fix a collision that needs a repo tracking both trackers and a key shared between them. meta.json carries the provider instead. Git exclusion uses git rev-parse --git-path info/exclude, never --git-dir + info/exclude: info is on git's shared-path list, so a linked worktree's --git-dir gives a path git never reads — the entry would look installed and exclude nothing (TestAddFleetExcludeFromLinkedWorktree proves it with check-ignore). The entry is repo-wide, written once, idempotently, and it is .gitignore's opposite on purpose: .gitignore is tracked, so writing it would dirty a fresh worktree and risk committing customer screenshots. The exclude is written before the first byte, since a window where the files exist and the exclude does not is a window where git add -A sweeps a customer screenshot into a commit.
  • Branch names are brz-3182-<slug-of-title> (BranchNameFor), not the tracker's own suggested name — Linear's carries an owner prefix (alice/brz-3182-…) and Jira's carries the summary verbatim. Both trackers link a PR by finding the identifier anywhere in the name, so every form links identically; this one matches the convention already on disk. identifier.go is one file for both providers because a Linear team key and a Jira project key are the same shape.
  • Inference is key-gated (IdentifierFromBranch). The regex is deliberately loose about the prefix because the caller gates on the repo's real keys; ungated it reads fix-123-thing as FIX-123 and release-2024-cleanup as RELEASE-2024, identifiers for teams that don't exist. The gate is what makes a non-ticket branch cost nothing.
  • Nothing polls, and a prompt is seeded exactly once. Ticket work is event-driven and one-shot: it happens at worktree creation and nowhere else (w + a ticket, fleet worktree --ticket), so a session added by hand with a/n/A starts empty like every other manually created session. handleSessionCreate therefore does no inference at all — it passes msg.prompt through untouched. fleet used to infer a ticket from the branch on every session creation, plus reuse the already-written prompt.txt when .fleet/ticket/<ID>/ was present. Both re-asked the original task on every session after the first, and the reuse branch never looked at the branch at all, so a worktree that once held a ticket kept seeding it after the checkout had moved on to master. A seeded first message is the gesture of starting a worktree from a ticket, not a property of the directory. TestTicketWorkStaysOffTheWorkers keeps it out of refreshAllGitAndPR, whose workerStallThreshold (90s) is already sized against ~70s of git + gh per repo — and it names every ticket package, since the single-name version passed vacuously the moment a second provider arrived. This is only affordable because there is no badge, hence no live state to keep fresh.
  • The seeded prompt is a short pointer that tells the agent not to start (TestSeedPromptTellsAgentNotToStart), stated at the top and bottom because a first message describing a task reads as an instruction to perform it. Line 1 leads with the tracker's name and the identifier before the title: the identifier because it is three surfaces at once (the agent's instruction, the preview pane's prompt strip, and the input to naming.GenerateTitle, which cuts at ~50 runes), the tracker's name because it is a fact the agent can act on — it is what makes "look it up yourself" possible when the snapshot on disk has gone stale. It rides sessionCreateMsg.prompt -> Session.InitialPrompt.
  • Base branch autocomplete (internal/ui/workspace_picker_branch.go, issue #277): the w dialog's Base branch field suggests branches beneath itself, on the ticket rows' vocabulary (▸ + selTitle, dim otherwise, branchMaxRows=5) and through the same setSelection highlight. The list is fetched once, by fetchWorkspaceListForRepo on the worker goroutine beside the GetDefaultBranch it already ran, and rides workspaceListMsg.branches — so filtering is a synchronous strings.Contains, with none of the ticket machinery's debounce or generation guard, which exist only because a lookup is a network round trip. A failed listing leaves the field exactly as it was. While that field carries the highlight the existing-worktrees list is hidden, which is a height budget rather than a flourish: the dialog has none of its own (wrapDialog only Places, and the worktree loop is unbounded), so at 80×24 with six worktrees five suggestion rows took the box from 21 lines to 26 and pushed the footer off the bottom. Dropping the list reclaims more than the rows add, so the focused dialog is strictly shorter than the resting one (TestWorktreeFocusedDialogIsNoTallerThanAtRest; TestWorktreeDialogRowsNeverOverflow is width-only and runs at height 40, so it could never catch this). Capping the rows against remaining height was the alternative and was rejected: setSelection runs nowhere near View, so the cursor clamp would have started varying with window size. Hidden is not unreachable — shift+tab still cycles onto the list and brings it back. Rows render only while that field carries the highlight: the field always holds text, so rendering them unconditionally would park five rows mid-dialog for every user including everyone who never touches the base branch — deliberately unlike renderTicketBlock, which renders whenever tickets exist because prose in the other field is what put them there.
  • tab moves between fields, ↓/↑ walk rows — split apart for this. They were one merged case, which was fine while only the New branch field grew rows and stopped being fine the moment the Base branch field grew its own: tabbing off a focused base field would have taken six presses to reach the next input. The ↓/↑ walk is the full continuous path (base input → base rows → new-branch input → ticket rows → worktree list) and must retrace itself exactly — which is why ↑ from the New branch field lands on the last base row (visibleBranchCount()-1), not the base input. It cycles: tab wraps the worktree list back to the base field and shift+tab wraps the other way, because a key documented as "next field" that does nothing on the last field is a dead key rather than a design, and wrapping one direction only moves the dead end onto the other. Cost: tab no longer walks the worktree list; ↓ still does. visibleBranchCount() is deliberately not focus-gated even though renderBranchBlock is — that ↑ handler asks for the last row while focus is still elsewhere, and a focus gate would answer 0 and silently land on the input.
  • A suggestion is stored as the exact ref that will be written into the field, which is why a remote-only branch always comes out origin/-prefixed (baseRefFor). GitWorktreeProvider.Create runs git worktree add <path> -b <new> <base>, and with -b present git resolves <base> as a plain revision with no remote-tracking DWIM — so a bare remote-only name is a row that looks valid and fails on Enter, and the no--b retry silently drops the base entirely. A field already reading origin/… keeps its prefix and matches only branches with a remote (git.BranchInfo.HasRemote, added for this): GetDefaultBranch pre-fills origin/<default> precisely so a worktree starts from the remote tip, and quietly swapping that for the local branch would change what gets built without saying so. HasRemote forced ListBranches into two passes — a branch shares its committer date with its origin/ counterpart only when it is level, so a branch you have not pulled has its remote ref sort first, which the old single-pass form both missed the flag on and emitted twice (TestListBranchesRemoteCounterparts; the duplicate was already visible in the b key's picker).
  • An at-rest field lists the alternatives, not itself. Filtering the pre-filled origin/<default> yields exactly one row echoing the field — a row that answers nothing and no-ops on Enter — so a field nobody is typing into widens to the unfiltered list instead, keeping wantRemote (you asked for a remote ref, so the wider list is the other remote refs) and excluding the field's own value, which would otherwise reinstate the very no-op row the widening removes. That exclusion runs before the branchMaxRows cap: filtering matchBranches' result instead silently returns one row fewer than fits. The gate is baseAtRest — set by Show and pickBaseBranch, cleared by the first typed change — and not equality between the field and a branch name, which looks equivalent and is not: typing your way to master-fix passes through master, so the equality form widened 1 row to 5 at the r and collapsed back at the -, and since the dialog is vertically centred that was the whole box jumping four rows mid-word.
  • A ticket picked from My tickets always resolves, even in a repo whose keys don't cover it (a team you aren't on): the palette row carries TicketProvider, openTicketFromPalette stashes it beside pendingTicketID, and PrefillTicket(id, provider) binds that one key to that provider for the rest of the open (bindTicketKey, copying the handed bound rather than writing through it). Coverage is checked per provider: when another tracker holds the key it loses it for this open, or a Jira OPS-7 would be fetched as Linear's OPS-7. Before this the hand-off fell through the repo gate — no lookup, no branch name, no ticket.md — and the session started with nothing on it (#373, TestPickedTicketResolvesInARepoThatDoesNotTrackIt).
  • Ticket suggestions live in the w dialog's existing New branch field, not a new field and not a mode (internal/ui/workspace_picker_ticket.go). The field IS the literal option, so nothing duplicates it and only one thing ever claims Enter. Two rules make that hold: exactly one highlight, and the caret lives with it — arrowing onto a ticket blurs the input, typing returns both and keeps the keystroke (isTypingKey, borrowed from the snooze dialog, whose "the highlight is the promise" rule this follows); and shape decides the default, never a mode — text matching a tracker's identifier shape resolves in place (LooksLikeIdentifier), prose stays literal with tickets one down-arrow below. In place means the field becomes the branch name (applyResolvedBranchName → BranchNameFor) while the highlight stays put; it does not mean "only record the ticket". That half was missing at first, so typing BRZ-3217 fetched the ticket, materialized it and named the session after it — and then created a git worktree literally called BRZ-3217, breaking the invariant pickTicket's own comment states, that both ways of naming a ticket end up identical. The rewrite is gated on the field still holding nothing but that identifier: the generation counter drops a reply a later keystroke invalidated, but it cannot see a current reply for a shorter identifier you paused on en route (BRZ-321 while typing BRZ-3217), which would otherwise drop brz-321-<slug> under the cursor and let the rest of the typing land on the end of it. The same check leaves a tail you edited by hand alone. The confirmation line reads ✓ named from BRZ-3217 · <title>, not a bare identifier: it renders in the same place the selectable ticket rows do, so on its own it read as a row you might still need to arrow onto when the naming had already happened — and it is the only thing on screen that explains why the field rewrote itself a moment earlier. ✓ is U+2713, East-Asian-Neutral, so it is always one column — the same width check the priority gauge had to pass. The highlight never moves on its own; a picker that jumps its own selection is the ambiguity coming back through the window. setSelection is the single writer of focus/ticketCursor, enforced by TestWorktreeSelectionMutatorIsTheOnlyWriter, because a stray write skips the clamp and renders two selection markers. The footer names what Enter will do and changes as the highlight moves.
  • The dialog is a pure function of what it was handed, never of the registry. Show takes []ticketing.Bound and derives its key union once; SearchBound/OwnerIn act on that set. Two reasons pointing the same way: the dialog latches individual providers off as their credentials are refused (ticketsOff is keyed by provider Kind, so a rejected Jira token cannot silence the Linear suggestions in the same repo — the two credentials fail independently), so re-deriving would search a tracker it has already given up on; and a dialog whose behaviour depends on process-wide credential state cannot be tested at all. A fan-out search that fails latches nothing, because it names no single provider. The searching line names the live trackers (⋯ searching Linear and Jira…), deduped so a repo tracking two Linear teams doesn't read "Linear and Linear".
  • Lookups are debounced (250ms) and generation-guarded, never per keystroke. Without the generation counter, typing BRZ-3182 then editing to BRZ-3184 lets the slower first reply overwrite the field with the wrong ticket's branch name, which then becomes a real git branch (TestWorktreeStaleTicketReplyIgnored). The counter is monotonic and never reset to 0, unlike ConfirmDialog.scanGen — that one lives on Home and never recycles; a per-dialog counter reset to zero would let a reply from a previous open match a new one. d.loading is deliberately not used for ticket lookups: it swallows every key but esc. The owning provider is resolved before the closure fires, so a failed reply can still name the tracker it went to — which is the case where naming it matters most.
  • Degradation is structural: no credential, no team or project, rejected key, offline, unknown id, or nothing matching — every case leaves Enter working and the dialog usable (TestWorktreeEnterAlwaysCreates). ErrNotConnected is the resting state for everyone who never connected and is never surfaced as an error; ErrNotAuthenticated is, because it names a thing to fix. The sentinels carry no provider prefix: they used to read linear: issue not found, which the UI rendered as Linear: linear: issue not found, so every caller hand-worded its message instead of formatting the error. The provider name belongs to whoever is drawing the line. Once the worktree exists nothing may fail the caller: Materialize sits beside copyClaudeSettingsFile and CopyConfiguredFiles and shares their posture, and a failed fetch costs the prompt, never the session.
  • Connect dialogs (internal/ui/connect_linear.go, internal/ui/connect_jira.go): separate palette commands, not one chooser — "Connect Linear" and "Connect Jira" each go straight to the thing they name. A pasted credential is verified before it is stored (Linear one viewer/organization/teams query; Jira /rest/api/3/myself then /rest/api/3/project/search), so "connected" is a fact rather than a hope and a typo is caught while the user is still looking at the field they typed it into. Jira's project list is a nicety, not a proof: /myself already verified the credential, and a token scoped away from project browsing must not read as a bad token. Linear's done screen then names your teams, now on in every repo, plus the two per-repo overrides (team to narrow, enabled: false to keep a repo quiet); a user on no team gets the old per-repo .fleet.local.json line instead, since they have no default (TestConnectedScreenNamesYourTeams). Jira's still shows the exact .fleet.local.json line that turns a repo on. Jira's form has three fields, and Enter on any but the last advances rather than submits: one keystroke meaning two things depending on where you happen to be is how a credential gets submitted half-typed. Only the token is masked — a masked site field is how someone spends five minutes not noticing a typo. Discovery is a tipOnce firing when a session's branch matches the generic <team>-<number> shape and nothing is connected — deliberately not IdentifierFromBranch, which is gated on keys nobody has configured yet at the moment the tip should fire; a false positive costs one dismissible hint, since the tip only offers and never fetches. Its id stays the literal string connect_linear even though it now offers both trackers: that value is persisted in config.seen_tips and counted in config.feature_usage, so renaming it would re-show a tip every existing user has dismissed and reset everyone's learned count. Only the Go constant changed, to tipConnectTicketsID.
  • My tickets is a tab in the command palette, not a new dialog (internal/ui/palette_tickets.go; t opens straight onto it, Ctrl+K reaches it by cycling), and it is one merged list across every connected tracker, not a tab each. The question the tab answers is "what am I meant to be working on", and that does not have a Linear half and a Jira half — the identifiers already say which is which, and ticketing.Assigned fans out concurrently and re-sorts the union through SortAssigned. A provider that fails contributes nothing and does not fail the others: half a list is worth more than an error, and one revoked credential must not empty the tab. The palette already had tabs (paletteTabOrder, cycleTab), so this is the existing surface rather than a fourth full-screen view — and typing narrows the list, which is why the whole open assigned list is fine here where it would be noise in a static list. The rows carry the join, which is the only thing this shows that a tracker cannot: which tickets already have a worktree and what that session is doing. Tracker keys are derived from the identifiers themselves (the prefix is the team or project), so it needs no repo config, spans every repo on screen, and needs no idea which tracker a row came from. When several sessions share a worktree the row reports the one that most wants you (ticketSessionRank), never whichever came first. Enter jumps to the session if one exists, else opens the ordinary w dialog with the identifier prefilled (PrefillTicket, pendingTicketID consumed exactly once) — so the repo and base branch are still confirmed on the screen that always confirms them, and a ticket becomes a branch name by only one code path. Because the list sorts on priority, priority is shown, as a three-cell gauge in a lead column — ▰▰▰ urgent, ▰▰▱ high, ▰▱▱ medium, ▱▱▱ low, and blank for no priority, since "low" is a choice someone made and "none" is the absence of one. A gauge rather than a label (P1/!!) because the list is sorted on this key and a sort key you have to read row by row gives you nothing across fifty rows — ▰▰▱ ranks below ▰▰▰ at a glance, P2 only does once you've read both; it is also the shape Linear's own UI uses. U+25B0/25B1 are Geometric Shapes (the status dots' block) and East-Asian-Neutral, so they are always one column — the obvious alternatives ■ □ · • are Ambiguous width, which some terminals render double and which would shear the column out of alignment; Menlo covers both. paletteLeadWidth is 4, not 3: the gauge fills every cell it is given, so a three-wide column rendered ▰▰▰BRZ-1 with no separator. Colour stops after high (red, then orange; the lower two carry rank by shape in the ordinary dim tone): colouring all four tints nearly every row and the top two stop standing out — and yellow, the obvious third step, already means waiting in the sidebar. It rides in a column of its own, not inside Name, for two reasons: a column can be coloured, and a column can be omitted — and it is omitted in the mixed all tab, where a lead column no other kind has pushed every ticket title four columns right of every command and worktree. Both of the tickets tab's dedicated columns vanish outside it, so ticketRightColumn puts state and priority back into the right column there — otherwise a ticket in a mixed list shows nothing but its title. State grouping is likewise tickets-tab-only: a Todo header sitting above a run of commands would describe rows it has nothing to do with. Rows are grouped under the state with a count when nothing is typed; typing drops the headers and folds the state back onto the row, since nothing else would carry it. The badge column is chosen by tab, not by kind: in the mixed all tab it is a plain tkt label, and in the tickets tab it is gone entirely — it is 4 wide because of cmd /repo/wkt , and there it only ever held a one-character dot. The is this in fleet answer moved to the right column, which was empty in that tab, and is spelled out: ● running, ◐ waiting, · suspended, blank when there is no worktree (ticketsTabRight). This reverses the earlier rule that the status is carried by the dot and never repeated as a word — that was right while the two sat in different columns saying the same thing, and wrong once the dot was alone on the far left, carrying two facts (is it here, what is it doing) in one glyph with no legend. Right-column content is composed in parts, never styled as one string, and it never takes the fuzzy highlight: the matched indexes belong to the Haystack, and painting them onto fleet's own annotation lights up the wrong runes. While filtering, the headers are gone so the state folds back onto the row in front of the join — using it.Group, deliberately not ticketRightColumn, which also appends the priority and would render the gauge a second time two columns from the first (TestFilteredTicketsTabDoesNotDoubleThePriority). Identifiers pad to a common width so titles start in one column. Ctrl+O narrows the tab to work you have not started (scopedOut in command_palette.go) — the tickets tab's own scope, not a global one. The cut is State != StateStarted rather than an allowlist of todo and backlog, so a category neither provider maps (Linear's StateOther) stays visible instead of silently vanishing from a list the user believes is complete; and it is not spelled "backlog only", because Jira emits no backlog or triage category at all and that scope would read as permanently empty there. The chip carries it (tickets · todo 7) rather than a second chip of its own, and renderTabs applies the same predicate as rebuildFiltered so the count can never contradict the rows beneath it. Ctrl+O because the search box owns the obvious chords — bubbles' textinput binds ctrl+a/b/d/e/f/h/k/n/p/u/v/w plus the plain arrows for line editing, and ctrl+c/ctrl+k/ctrl+q/ctrl+s are quit, close, detach/XOFF and flow control, while ctrl+i/m/j/[ are byte-level aliases of tab/enter/newline/esc. Arming requires the tickets tab; clearing does not — off it the key falls through to the input while the scope is off, and is live while it is on. Asymmetric because the two presses are not the same act: arming has an effect you can only see where the rows are, while the chip it lights renders from every tab, and a mode you can see but cannot reach from where you are standing is worse than one you cannot see. There is exactly one scope, so clearing it is never ambiguous. The footer hint follows the key rather than the tab (ctrl+o: todo / ctrl+o: all), so a dead key is never advertised — the same rule the context menu's dimmed rows keep. Deliberately not reset by Show: a queue you pick your next task out of is the state you want most of the time, so re-pressing it on every open would make it a chore rather than a mode — it is not persisted to config, so a restart clears it. A scoped tab that ends up empty says Nothing unstarted — ctrl+o shows all rather than the generic No matches: with ticket_start_state moving your active work to In Progress, "everything I am assigned is started" is the routine outcome of this scope, and it otherwise looked exactly like a fetch that failed. Claimed only when rows were really scoped out and nothing is typed — with a query, or with nothing hidden, the scope is not the reason and saying so would be a guess. Colour therefore means session status and only that, the same discipline that keeps agent glyphs monochrome. Haystack must be exactly Name + " " + <right column>: the renderer maps matched indexes back onto those two strings by offset. The palette's name column is budgeted against the widest right column rather than a fixed 22-rune cap, which was truncating titles to Storage opt… on a terminal with room to spare. Fetched when the palette opens and never polled — ticketListLimit is 100 per tracker, one page for both (Linear takes first up to 250, Jira's /search/jql accepts it in one POST), and the number matters because the fetch is ordered by updatedAt, so the cut falls on recency rather than state: the earlier fifty truncated exactly the untouched backlog the todo-only scope exists to surface. Ctrl+K costs nothing at all when no tracker is connected.
  • fleet worktree --ticket <ID> (-t) mirrors the TUI and names the branch when no branch is given. Conflicts with -p — both set the first message and say opposite things — but is allowed with --no-session, unlike -p: a promptless session is meaningless, a materialized git-excluded ticket directory is not. A bad identifier fails before anything is created, the same line -p - draws. It calls ticketing.Warm first — a one-shot process has read no keychain yet, so every provider would otherwise report itself unavailable. When no provider will read the identifier, unclaimedTicketAdvice names which gate failed: a repo that already declares the project needs a credential, not a config edit, and telling someone to add a line they can see is already there is a false statement about their own setup.
  • Git info (branch/dirty) refreshes on a per-repo cadence (internal/ui/git_cadence.go): every 2s while a session in the repo is running/waiting/starting or ran within the last minute, every 30s when its sessions are at rest, every 5 min when every session is suspended or errored (kept, not dropped, so a merged PR still turns its badge). triggerGitRefresh (detach, checkout, create) forces a full pass via gitForceNext. It used to refresh every repo every 2s — measured ~1.6 CPU-s per cycle across 11 large worktrees, ~80% of a core in child processes fleet's own %CPU never shows. git runs with GIT_OPTIONAL_LOCKS=0 (gitCommand), so the periodic git status never takes index.lock in a worktree an agent is committing in. PR info every 60s hot / 2 min cold via gh CLI, only for a repo whose git refresh ran. Because a cold repo's IsDirty can be minutes old, the worktree/origin delete dialogs re-check it live in their async holder scan (countDirty → dirtyScanPrefix; a git status that fails or times out is reported as "Couldn't check", never read as clean — git.UncommittedChanges returns the error HasUncommittedChanges swallows), and y/Enter is held until that scan answers (ConfirmDialog.scanPending, read by confirmLocked for both the key and the greyed button; esc still cancels): removal is git worktree remove --force, so a cached "clean" must never be the last word, and a fast d y must not beat the live one.
  • tmux status bar repaint (refreshTmuxStatusBars): skipped for sessions with no tmux (suspended, or errored with tmux gone — statusBarApplicable; applying to them failed with exit status 1 for every such session on every launch). The cache key (statusBarKey) holds every rendered input and the pane pid, deliberately not the session status: no option renders status, and keying on it re-ran 13 set-options — redrawing the attached client's chrome — on every running↔finished flip. Two inputs take over the job status did by accident — a restart paints a plain bar in Start, so the themed one must land after it: the pane pid (new per pane process) and a starting bit, which flips once per launch and repairs a themed apply that lost the race to Start's plain one.
  • Crash dumps fire only on a new death. deathRecorded is in-memory, so a session persisted as errored was re-dumped on every launch (580 files, 29 for one session). FromRow sets loadedDead for a row already in error, and triggerCrashDump skips while it holds; the relaunch paths clear it with deathRecorded. It also lifts once the session is seen alive after the load: a non-dead hook stamped after loadedAt (a stale file read at startup doesn't count), or — for Codex/OpenCode only, whose deaths are pane/tmux-only — a pass where tmux and the pane are up and the hook isn't dead (OpenCode persists a recoverable session.error as error with its pane alive). Claude/Copilot wait for the hook: on the first pass the watcher may not have seeded the stale dead hook yet. It is a separate flag, not a seeded deathRecorded, because a stale non-dead hook file read at startup re-arms deathRecorded; and it is keyed on loaded rather than on any error status, so a session that errored while alive (an agent-reported error) and then really dies still gets its dump. The dir is pruned to the newest 100 (pruneCrashDumps).
  • While attached, the status worker's fast active-pane pass rides the 2s heavy cadence instead of 500ms (hook-driven priority updates still run every cycle; detach forces a full cycle): the sidebar isn't on screen, and each pass is a capture-pane against the tmux server relaying the attached session.
  • PR badge: green ✓ (approved+CI passed and GitHub not blocking the merge — github.PR.ReadyToMerge, the one predicate the badge, its colour, the P jump, the preview line and fleet status all ask; an approved, green PR whose mergeStateStatus is BLOCKED (an approval-policy bot, CODEOWNERS, conversation resolution) or BEHIND drops to a bare yellow #N, with the reason spelled out in the preview line and as blocked/behind in fleet status. A deny-list rather than == CLEAN, because GitHub computes the field lazily and answers UNKNOWN on a cold read), yellow ◔ (CI running) / ⌕ (review required) — stacked ◔⌕ when both, and shown only when there's nothing red to fix, red ✕ (CI fail) / ↩ (changes requested or unresolved threads), purple ⇡ (merged), gray ◌ (draft; ✕ appended on CI fail), hidden (closed)
  • PR info includes unresolved review thread count via GitHub GraphQL API
  • gh CLI optional — PR info hidden if not installed
  • Preview strips OSC-8 hyperlink sequences to prevent dotted underline artifacts
  • Status detection: hook-based (primary, no time expiry) via Claude Code hooks + pane capture (fallback, ANSI-stripped)
  • Claude's own status file (internal/session/claude_proc_status.go): Claude Code keeps <config dir>/sessions/<pid>.json per live process — ~/.claude, or the account's CLAUDE_CONFIG_DIR (measured: Claude creates sessions/ there) — and since 2.1.327 writes status: "waiting" with a waitingFor reason. fleet reads the owner pid's file (the pid the hooks report; no scan), requires its sessionId to match the owner conversation and the pid to be alive, and uses it only to confirm waiting, applied last in the Claude hook path over whatever hook + pane concluded. Only to confirm, because Claude sets it only for dialogs that declare a reason: AskUserQuestion and MCP input say input needed, while several permission and plan-approval dialogs declare none and read busy. Trusted reasons are input needed / sandbox request / worker request / goal proposal; dialog open is not, since Claude also reports it for a /model or /config the user opened themselves, which would put the row in the Space rotation. It closes the cases the hook and pane get wrong: a PermissionRequest that lands before the question renders (overridden to finished), and a message typed while a question is open, which is queued and still fires UserPromptSubmit, so a running hook lands after the waiting one and masks it. For that second case the stale-running rule also settles to waiting, not finished, when the pane structurally shows a prompt (older Claude, or a reason fleet doesn't trust). Once the file stops saying waiting, the status it overrode is handed back (claudeBumpedFrom, idle included), so a latch that only preserves status can't keep the row waiting. fleet status honours it too (ClaudeWaitingFor): its "no prompt on screen means answered" rule would otherwise report running before the question renders.
  • Agent team status: sub-agents don't fire hooks, so pane detection handles team states via structural checks (numbered menu ❯ 1.+2.+ a menu footer — Esc to cancel, or approve with this feedback for ExitPlanMode plan-approval prompts; box-drawing │+Waiting for team lead); a fresh hook=running is never overridden to waiting by pane (avoids false-positives from code in scrollback); one ruled stale (>10s of stable content) settles to waiting only on a prompt shown by its layout (paneShowsPromptStructurally — menu + footer, team box, AskUserQuestion footer), never on the approvalPatterns text fallback
  • Background agents (Agent tool + run_in_background): the lead fires Stop (hook=finished) and parks until the agents re-invoke it, so the session would read idle/finished. detectBackgroundAgentsRunning (session.go) catches the in-flight dock rows (◯ <type> <desc> <elapsed> · ↓ <tokens>, rendered below the input box → scrollback-safe) and returns Running; applyHookFinished then overrides the finished hook → Running. Only the in-flight glyph ◯ matches, so the session self-clears to finished when the agents complete. Trade-off: a long background job shows Running for its full duration (chosen over hiding live work under idle).
  • All blocking I/O (tmux, git, gh) runs in background worker goroutine, never in Bubble Tea Update()
  • Hook status files: ~/.config/fleet/hooks/{session_id}.json, written atomically via a uniquely-named temp file (os.CreateTemp) — hook handlers are one-shot processes and an agent can fire two at once (Codex asks permission per concurrent tool call), so a shared <id>.json.tmp let the loser's rename fail with ENOENT and could rename a torn write into place
  • Hook handler: fleet hook-handler (invoked by Claude Code hooks, reads FLEET_INSTANCE_ID env)
  • Hooks auto-installed into ~/.claude/settings.json on TUI launch
  • Debug log: ~/.config/fleet/debug.log (slog, init in TUI and hook-handler)
  • Config file: ~/.config/fleet/config.json (tick_interval_sec, default_project_path, editor, theme, auto_name_sessions, copy_claude_settings, worktree_path, confirm_before_restart, origin_delete_removes_worktrees, drawer_height, session_suspend_mode, account_strategy, default_account, allowed_accounts, ticket_start_state (legacy linear_ticket_start still read), account_usage_style, stats_recap_seen_week)
  • Ticket credentials: OS keychain items fleet-linear and fleet-jira (or secret-tool, or ~/.config/fleet/{linear,jira}.json at 0600). Never in config.json, never in a session's tmux environment
  • Claude accounts: ~/.config/fleet/accounts.json (0600) records emails/orgs/config-dir paths; the logins themselves live in the macOS Keychain, one item per account dir. Per-account Claude Code homes: ~/.config/fleet/accounts/<8hex>/
  • Workspace: built-in git worktree support (zero config), per-repo .fleet.json (or legacy .bc.json) overrides with custom shell commands
  • Workspace creation is non-blocking: dialog closes immediately, phantom "Creating..." entry with spinner appears in sidebar, user can keep navigating
  • Worktree creation copies .claude/settings.local.json from source repo (configurable via copy_claude_settings, default true)
  • Base-branch fetch before worktree creation (git.FetchBaseRef): git worktree add -b <new> origin/master resolves origin/master out of the local clone and never asks the remote, so a worktree could start days behind and need a merge as its first act. Both create paths — the w dialog's async closure and fleet worktree — refresh that one ref first. The refspec-less origin <branch> form is deliberate: it is what opportunistically updates refs/remotes/origin/<branch>, the ref worktree add then resolves — behind a -- terminator, because git's parser takes options after a positional, so a base of origin/--upload-pack=/tmp/x would otherwise reach --upload-pack and run it (reproduced; git refuses to create such a branch, so it can only come from someone typing it, but the terminator is one token). --no-write-fetch-head because FETCH_HEAD is the user's and a manual git merge FETCH_HEAD must not merge fleet's fetch (it costs the feature on git <2.29, the safer of the two failures); -c gc.auto=0 -c maintenance.auto=false because a fetch normally signs off by kicking automatic housekeeping, which on a large repo is a repack competing with the agent sessions already running. Only an origin/-prefixed base is fetched — the only form fleet produces — since splitting a bare name on / would read a local feature/foo as remote feature and spend the whole budget on a fetch that cannot work. Advisory, exactly like the file copies beside it, and the budget is two mechanisms rather than one: fetchTimeout 5s (deliberately under the 8s gitTimeout — offline it can only ever fail, so the budget is what an offline user should wait) plus cmd.WaitDelay, without which the timeout does not bound anything. CommandContext kills git on expiry, but CombinedOutput's Wait then blocks until every holder of the pipe's write end exits, and a fetch over SSH hands that end to an ssh grandchild the kill never reaches — measured at 30s against a 1s budget, with the Creating… phantom spinning the whole time (TestFetchBaseRefReturnsWhenAChildLeaksThePipe, which needs a full second of budget: a shorter one kills the fake before it spawns the grandchild and then passes against the unfixed code). GIT_TERMINAL_PROMPT=0 governs git's own prompts and not ssh's, which reads /dev/tty directly and would print over the TUI, so GIT_SSH_COMMAND=ssh -o BatchMode=yes is set too — only when the caller defines none, since overriding one carrying an identity turns a working fetch into a silently failing one; a core.sshCommand in config is the residual gap, and WaitDelay bounds it. Any failure branches from the refs already there. It runs after the dialog closes, inside the Creating… phantom's window, where a ~2s round trip is invisible — at dialog-open time it would either hold the box shut for it or move the base-branch suggestion rows under the cursor when it landed. Deliberately not periodic: measured across 10 origin groups here, the repos worktrees are actually cut from were already current (agent sessions fetch as part of the work), so a background sweep would spend ~2s per group forever to refresh what is already fresh. Skipped when the branch already exists, on both paths (git.BranchExists, promoted out of cmd/fleet): Create retries without -b, which drops the base, so the fetch would refresh a ref worktree add never reads. F (fork) is untouched — it branches from the session's HEAD, not from origin. GetDefaultBranch's fallback had to change with it: git init + git remote add writes no refs/remotes/origin/HEAD, so it returned a bare local main/master, which both contradicts its own contract and misses this gate — it now prefers origin/<name> when that ref verifies, leaving the bare name only for a repo with no remote copy at all.
  • .fleet.json / .fleet.local.json in repo root (legacy .bc.json / .bc.local.json still read): {"workspace": {"list": "cmd", "create": "cmd {{name}} {{branch}}", "destroy": "cmd {{name}}"}}
  • .fleet.json / .fleet.local.json may also set {"pr_checks": {"ignore": ["glob", ...]}} to drop matching CI checks from the PR-badge rollup — commit-status contexts (policy-bot, external CI) included, matched by their context name, since asCheckRun folds the rollup's StatusContext rows (context/state) onto the CheckRun shape (name/status/conclusion); fleet once read only name, silently dropping every commit status, so a pending policy-bot left a blocked PR green and a failed external CI never turned it red (path.Match globs; lists from both files merge additively; opt-in, empty by default)
  • .fleet.json / .fleet.local.json may also set {"linear": {"team": "BRZ"}} and/or {"jira": {"project": "OPS"}} (or the plural "teams" / "projects" lists) to name the team(s) and project(s) this repo tracks. For Jira this is the gate that turns ticket features on; for Linear it is an override of the default (your own teams), and {"linear": {"enabled": false}} switches Linear off for the repo (Enabled *bool; a local enabled wins, and a local team/teams with no local enabled re-enables a committed false — naming your team is asking for Linear there). .fleet.local.json is usually the right home: team membership is personal and .fleet.json is committed. The keys merge differently, on purpose and identically for both trackers: a local team/project replaces the committed one (personal membership overriding a repo default is the point), while teams/projects lists are appended and deduped — two trackers with two sets of merge semantics would be a thing to look up rather than a thing to know. Linear falls back to team_id in a .linear.toml. There is deliberately no per-repo site for Jira: an Atlassian API token is scoped to an account rather than a site, so a repo pointing at a second Jira has no guarantee the same token reaches it
  • Worktree placement (worktree_path, issue #353): config.json sets it user-wide, .fleet.json / .fleet.local.json per repo (local replaces committed, repo beats global). A template over {{repo}} (repo folder name) and {{name}} (sanitized branch), resolved by workspace.ResolveWorktreePath: ~ is home, a relative path is resolved against the repo root, and unset is ../{{repo}}-{{name}}, the sibling layout fleet always produced. A template without {{name}} names a directory: the folder inside is {{name}} when the directory already carries {{repo}} ("../{{repo}}.worktrees" → fleet.worktrees/feat-x) and {{repo}}-{{name}} when it doesn't ("~/worktrees" → ~/worktrees/fleet-feat-x), so one shared directory can't collide two repos' branches of the same name. A path inside the repo is refused — it would sit untracked in the main checkout's git status and be walked by every recursive search from there; the w dialog's → preview shows that error before Enter. When the setting is set anywhere, that preview also names the file it came from (→ ../fleet.worktrees/feat-x (from .fleet.local.json), via WorktreePathSetting → GitWorktreeProvider.PathSource; nothing is added for the default) — three places can set it, and the preview is where "why is it going there?" gets asked. The source is the file that won: a .fleet.local.json that exists without the key falls through to .fleet.json. Because providers are built by ResolveProvider from a repo path alone and workspace must not import config, the global value is package state set once at startup (SetGlobalWorktreePath, from NewHome, fleet worktree, and live from the Settings → Behavior "Worktree location" row) — hand-editing config.json needs a restart; the resolved template rides GitWorktreeProvider.PathTemplate, which is what the dialogs' per-frame preview reads (ProviderPathTemplate, no disk access). git worktree add creates the missing parent directory itself. Placement only — existing worktrees are not moved.
  • .fleet.json / .fleet.local.json may also set {"copy_files": {"paths": ["path", "dir", "glob/*", ...]}} to copy gitignored files/dirs/globs from the source repo into each new worktree (filepath.Glob semantics, repo-relative only; lists from both files merge additively; opt-in, empty by default; applies to both git-worktree and shell providers; independent of copy_claude_settings)
  • Multi-agent: per-session agent (Claude, Codex, OpenCode, Copilot, or Antigravity), chosen at creation (A key picker or default_agent config used by a). Stored in SQLite agent column; internal/agent owns binary name + launch command (claude / codex resume <id> / codex fork <id> / opencode --session <id> / opencode --session <id> --fork / copilot --session-id=<id> / agy --conversation <id>). Capability gates live on agent.Type — SupportsEffort (not OpenCode), SupportsFork (not Copilot or Antigravity: launching it with the parent's id would take over the parent's conversation, so f, its menu row and the forkSessionMsg handler all refuse, and BuildLaunchCmd drops a fork id rather than resuming it), PreMintsSessionID (Copilot only). Every agent switch in fleet ends in default: = Claude, so a new agent needs an explicit case at each one or it silently launches claude and gets Claude's pane heuristics. The list of agents itself is agent.All (pickers, --agent validation and help via agent.Known/agent.NameList, default_agent).
  • Multi-account (Claude only, internal/claudeaccount): several Claude subscriptions, one per session, so a spent 5-hour window on one doesn't stall the fleet. The mechanism is one env var — CLAUDE_CONFIG_DIR (claudeaccount.ConfigDirEnvVar) pointing at a directory that holds that account's own claude.ai login — appended in Session.sessionEnv() (session.go), the single chokepoint already feeding Start/Restart/RespawnClaude via tmux -e. Each session therefore authenticates exactly as a plain claude in a terminal does: nothing is layered over anything, so claude.ai connectors, Remote Control and /api/oauth/usage all keep working.
  • Why not ANTHROPIC_AUTH_TOKEN (which fleet shipped first and then replaced): it sits at auth precedence 2 and displaces the claude.ai login, so every session lost connectors and Remote Control and printed a banner saying so. The claude setup-token credential behind it is inference-only, which forced three separate workarounds — it can't name its owner (so accounts were keyed account-<sha256(token)[:8]>, and rotating a token minted a second identity that orphaned every session pinned to the old one), it can't read /api/oauth/usage (so quota came from a hand-rolled probe that POSTed to /v1/messages and read rate-limit headers, spending real quota to measure quota), and it can't be verified (so a refused token scored as unknown and won every least_used comparison). All three are gone. Measured, not assumed: CLAUDE_CODE_OAUTH_TOKEN is worse still — against 2.1.221 with a Keychain login present it is ignored outright.
  • Two config dirs hold two independent logins. On macOS the Keychain service name is Claude Code-credentials plus, when CLAUDE_CONFIG_DIR is set, the first 8 hex of sha256(NFC(dir)) — derived by reading the shipped binary and confirmed against a live login (/tmp/cc-spike-a → Claude Code-credentials-5205b77d, pinned by TestKeychainServiceIsScopedToTheConfigDir). That suffix is the whole mechanism. Account.ConfigDir is therefore stored verbatim and the path is random (~/.config/fleet/accounts/<8hex>), never derived from the email or label — the Keychain item is keyed by the exact path, so deriving it from anything renameable would orphan the login.
  • Account dirs are provisioned on every launch, not just at add time (Provision): projects/, skills/, plugins/, agents/, commands/, ide/ are symlinked back to the real ~/.claude, settings.json is copied (so fleet's hooks ride along, and so a future per-account setting isn't silently global), and mcpServers + per-project hasTrustDialogAccepted are mirrored out of ~/.claude.json. Sharing projects/ is load-bearing: it holds the transcripts --resume replays and fleet reads for auto-naming, and it is what lets a session move between accounts and still resume the same conversation. Per-launch because the user's ~/.claude keeps moving; a dir that captured its state once would drift into a subtly different environment. Not shared: the credential (the point) and history.jsonl.
  • Account identity is read, never guessed: claude auth status reports email, orgId, orgName and subscriptionType for a real login. Email is the key and it is an actual address. Store.Upsert still matches on OrgUUID first (indexOfLocked), which now means "logging the same subscription in twice updates the existing account" rather than papering over a fingerprint rotation. A blank org never matches; a different org is a different subscription, never a correction.
  • Add an account via Ctrl+K → Manage Claude Accounts → a, which opens a fleetauth_ pane (deliberately not a fleet_ prefix, so tmux.ListSessions can't mistake a login pane for an agent session) running claude with a fresh CLAUDE_CONFIG_DIR; the user runs /login. Completion is detected by polling claude auth status (WaitForLogin), not by scraping the pane — the old flow regex-matched sk-ant-… off the screen, coupling fleet to Claude Code's wording and allowing a half-success (login worked, capture missed) that needed a paste fallback. There is no paste path any more; a retries (the footer advertised a p paste key for a while after the flow was deleted — there was never a handler). An abandoned login's dir is removed rather than left for Provision to keep refreshing. The dialog also owns the strategy: s cycles account_strategy through claudeaccount.Strategies, with the value stated above the list. It sits here as well as in Settings because the strategy governs the list below it, and because it is what makes the ★ legible — a marker that appears only under manual reads as a property of the account rather than of the mode. The dialog picks the next value itself before emitting accountStrategyMsg, so its row repaints on the keypress rather than a round-trip later. Cycling to manual with nothing pinned toasts a prompt to press ⏎ (manualNeedsDefault): Select falls through to the automatic modes when the pin names no configured account, so that state is not broken, it is silently not doing what the mode says.
  • Assignment (claudeaccount.Select, the one place strategy lives) via account_strategy config: least_used_weekly (default, most weekly headroom), least_used_5h (most 5-hour headroom), waterfall (configured order, skipping spent), manual (default_account, strict — it returns the chosen account even when spent, since quietly rotating away defeats the only reason to pick that mode). The least-used pair differ only in which window pctOf reads, via rankWindow → Usage.Pct(Window). Weekly is the default because the two windows fail on different timescales: a 5-hour bucket refills this afternoon, so losing that race costs an hour, while a weekly bucket spent on Tuesday is gone until the following week — and ranking on the fast window lets every account's slow window drain in lockstep, which is the state that takes the whole fleet down at once. The pre-split least_used survives as an alias, not a value: ParseStrategy resolves it to weekly (same as unset) and Strategies — the ordered set both pickers offer — deliberately omits it, so cycling can never land on it. Mapping it to the 5-hour variant instead was rejected: it would make the presence of the key change behaviour, so the same file would behave differently depending on whether it was ever written. StrategyLabel/StrategyLabels live in claudeaccount for the same reason Window.Name does — the Settings cycler and the accounts dialog both render them, and two copies of the strings is how they stop agreeing. Selection-only: the accounts list, move picker and header readout still show the 5-hour figure regardless of strategy. Sessions are pinned at creation: Claude's prompt cache is per-account, so re-picking on every restart would drop the very thing a restart preserves. Forks inherit the parent's account (forkSessionMsg.account) — a fork resumes the parent's conversation and must authenticate as its owner.
  • A missing login is evidence; every other poll failure is not. FetchUsage returns ErrNotLoggedIn for 401/403, the poll stamps Usage.LoggedOut, and Select drops those accounts via dropLoggedOut ahead of every strategy including manual. Without it an account with no login never gets a reading, so pctOf scores it at unknownPct (50) — which beats a healthy account at 59% and hands every new session the one account that cannot run, with no error anywhere. Categorically unlike spent, which Select still returns (soonest to reset) because a wait ends; a missing login doesn't, so emptying the candidate list is right and the caller falls back to the ambient login. LoggedOut is live state on Usage, never persisted — an account heals the moment it is logged in again (handleAccountLoggedIn replaces the usage entry outright, so the fix isn't invisible until the next poll). Shown as ✕ logged out in the accounts dialog and the header readout, which renders it even with no reading at all.
  • Restart heals a pin that can't run (healAccountBeforeRelaunch, called from restartSession and resumeSelected): if the pinned account was removed, is logged out, or is spent, the session is re-picked, persisted via UpdateAccount and announced in a toast — pinning protects a prompt cache, and there is no cache worth protecting on an account that can't answer. An unpollable account is left alone: fleet failing to reach Anthropic is not evidence against the login, and healing on it would rotate the whole fleet during an outage. A heal forces the full Restart() path, never RespawnClaude — respawn-pane -e layers over the environment tmux created the session with, so a move to the ambient login (which sets no variable) would inherit the old dir.
  • Manual move: . → "Move to Account…" (move_account → openAccountPicker), a row-anchored dropdown (internal/ui/account_picker.go) built on the context-menu overlay pattern. Shows each account's 5-hour figure — the header is deliberately quiet because it's always on screen, but here you're choosing because one is spent. The current account and any logged-out one render dimmed with the reason and are skipped by j/k. It always relaunches, and says so in the footer: the config dir is baked into the tmux environment at launch, so a move that only rewrote the record would relabel the row while the live process ran on the old account. Follows contextMenuTarget, not the cursor (TestPickedAccountFollowsTheTargetNotTheCursor).
  • Account at creation (A → SessionCreateDialog, internal/ui/session_create.go): an Account cycler row beside Agent, so a session starts on the right subscription instead of being created wrong and moved — the only manual control before this was "Move to Account…", which pins and relaunches an existing session. ↑↓ move between rows, ←→ cycle the focused row's value, in the Settings detail pane's idiom (renderDetail); tab therefore means "next row" rather than the "next agent" it meant while there was one row. Options are Auto first and preselected, then each account with its 5-hour figure. Auto rides sessionCreateMsg.account == "", which already means "let the strategy pick" — so nothing changes for anyone who just presses A ⏎, and no accountSet companion bool is needed (unlike forkSessionMsg, where "" is a live identity meaning the ambient login). Auto's label names the account account_strategy would land on, resolved through selectAccountFor, which resolveAccount now also calls: two hand-built SelectOpts would drift, and a label naming a different account than the one billed is the lie the account labelling exists to stop telling (TestAutoOptionNamesTheAccountResolveWouldPick). Rows are built by sessionCreateAccountRows, modelled on openAccountPicker minus its current clause, and the dialog is a pure function of what it was handed — it never reads the store, so it tests without one. Nil below two accounts: with one or none every session runs on the same credential, so the row would be a constant — the rule previewAccountLabel already applies to the preview footer, and it keeps A untouched for the majority. On a non-Claude agent the row goes inert, not hidden (accountRowActive): hiding it would change the box height mid-keystroke, so it dims to Claude only — with the account name removed, since "yuval@brizz.ai Claude only" reads as "this session runs on yuval@brizz.ai". The selection survives the round trip and enter sends account: "" there regardless. A blocked account is landed on, dimmed with its reason, and refused — a cycler can only honour "a disabled option is shown with its reason" by letting you reach one, so ⏎ is gated by submitBlocker, the one function the footer also reads (the statusReportForm shape), and the footer swaps to <reason> — ←→ pick another. It also drops its ↑↓ field half whenever the Agent row is the only one that can move, so no dead key is advertised. Finally, an explicit account skips resolveAccount and with it the per-origin allowlist, so handleSessionCreate re-checks it at the chokepoint — the same check resolveLaunchAccount makes for an explicit --account, because a policy holding on one surface and not the other is worse than not having one.
  • Quota comes from GET https://api.anthropic.com/api/oauth/usage — the cheap official route, available because a real login carries user:profile. Reading it consumes no message quota. The bearer is read out of that dir's Keychain item at poll time and never stored (accessToken, security find-generic-password -w). Values are already percent (0..100), unlike the rate-limit headers the old probe parsed, which were fractions — exactly one of the two ever needed scaling. Polled on the worker's heavy pass, throttled ≥180s per account — except across a window's own reset (Usage.StaleAfterReset), where the throttle is broken because the numbers have stopped describing the bucket they were read from: a spent account otherwise keeps reading spent for three minutes after it came back, with its countdown already at zero, which is exactly when its owner is watching. Bounded below by AttemptedAt, not simply "the reset is in the past" — a poll that fails at the boundary moves AttemptedAt past it, so the account backs off normally instead of retrying every tick against an endpoint that just refused. Failure is recorded rather than raised, so an unpolled account reads as unknown, not spent, and least_used degrades into waterfall order.
  • The CLI ranks on the same quota (claudeaccount.UsageForLaunch ← selectLaunchAccount): fleet worktree/fleet add with no --account under a least-used strategy feed Select the TUI's readings via ~/.config/fleet/account_usage.json (0600, no credential or error text), which the TUI's poll writes. A reading attempted within MinPollInterval is reused (Usage.PollDue, the TUI's throttle); otherwise all candidates are fetched in parallel under CLIFetchTimeout (3s). A reading older than UsageCacheMaxAge (2× the poll interval) stops ranking unless it shows the account spent. A quota failure never blocks a launch: stderr names each unread account and why. A re-login in the TUI replaces that account's entry with the login's own reading, or drops it (ResetCachedUsage), since the cache carries LoggedOut. security runs as /usr/bin/security because launchd may give no PATH.
  • GuardConflictingAuth matters more here than it did before. A config dir's login sits at the bottom of the precedence order, so an ambient ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY inherited from the user's shell silently overrides every account at once. tmux -e can add variables but not remove them, so a session can't scrub what it inherits — refusing loudly is the only honest answer. (fleet's own helper commands do scrub, via configDirEnv: fleet is often launched from a fleet session, and an inherited credential would make claude auth status report the wrong account.)
  • Nothing in fleet stores a credential any more. accounts.json (0600) holds emails, orgs and directory paths; the logins live in the Keychain. sanitizeForIssue (statusreport.go) still redacts sk-ant-* at the chokepoint, guarded by TestBuildStatusReportBody_NeverLeaksAccountToken — cheap insurance, not a load-bearing defence.
  • Header readout (internal/ui/accounts_header.go, Appearance cycler account_usage_style): per-account usage top-right, both windows every frame, 5-hour first, each carrying when that window resets — a weekly figure without its horizon is unactionable. Two styles: split (default) gives each window its own countdown (yuval 12%(2h) 34%(5d)), grouped pools them (yuval 12%/34% (2h/5d)), off hides the strip. It replaced a strip that moved on its own: the readout used to show one window at a time and swap every 6s off the wall clock, and pick one of six densities by measuring what the breadcrumb left over — so a corner of the screen changed on a timer and reshaped whenever the cursor moved to a longer session title. Nothing here reads the clock now except the countdowns (TestReadoutIsStableOverTime renders at three offsets and demands byte-identical output). Nothing names the windows — order does, which is why 5-hour leads in every style and state; the countdowns cannot stand in for it, since a weekly window about to roll over reads 3h exactly like a 5-hour one. The two styles are the same width by construction (four tokens plus five characters of glue either way), so neither is called "compact" and the fit ladder is style-independent — a narrower style would put the grouping back under the breadcrumb's control. That ladder is now two steps: drop the account names, then render nothing (it never falls back to the other style, for the same reason). A spent window is not special-cased into spent <countdown> any more — quotaStyle already paints anything at ExhaustedPct red, the same threshold Select stops handing the account out at, and the countdown sits beside it, so the state is legible without the chip changing shape and the other window's figure survives instead of being hidden. A reset that has already passed renders now rather than dropping the parenthetical (100%(now)): a countdown that vanishes at the moment it reaches zero leaves a red figure with no horizon in the one state where the horizon is the whole answer, and it is the chip changing shape on a timer. now is a claim that a fresh figure is one tick behind it, so it is gated on Err == nil && reset.After(FetchedAt) — neither the wall clock nor the reset time can promise that on their own. A failing poll advances AttemptedAt past the reset, which is what bounds the throttle break, so across an outage spanning a reset nothing re-polls and the strip would read 34%(now) 71%(now) for its whole duration; and a poll that succeeds while returning an already-past reset (a 5-hour block is anchored to its first message, so a lapsed one can report its old resets_at for hours) is answering about a window it has already left. Both fall back to "" — the bare figure this rendered before the countdown existed. An unknown reset drops as it always did. ✕ logged out still takes the whole chip (no numbers to show) and renders even with no reading at all. In grouped the countdown parenthetical is all or nothing — pooled countdowns make 12%/34% (5d) unreadable — while split drops each independently. Hidden below two accounts, or when even the nameless form would overflow and push the What's New badge off its corner. account_usage_style supersedes the legacy show_account_usage bool, of which only false migrates (→ off); the Settings cycler clears it on write.
  • Per-origin allowlist (allowed_accounts config, keyed origin:<key> — the same keyspace as collapsed_groups/snoozed_groups; empty = all allowed). Deliberately not .fleet.json, which is committed — account policy is personal. Chosen over a per-origin pin because it composes with rotation: a pin has no good answer when its account is spent, while an allowlist does. Edited from . on an origin header → "Allowed Accounts…" (internal/ui/allowed_accounts.go), a row-anchored checkbox dropdown on the account picker's overlay pattern. Origin rows only: the key is per-origin, so offering it from a session or worktree row would put an origin-wide rule behind a control that looks like it acts on the row you're standing on. Ticking every account deletes the key rather than storing the full list (config.SetAllowedAccounts) — the two read identically today, but a stored list silently locks out the next account added, with nothing on screen to explain it; a toggles all, so it doubles as "remove the restriction". Zero ticked is refused, not saved (same rule as SnoozeDialog's unparseable box): an empty list already means unrestricted in config, so saving it would do the opposite of what ticking nothing looks like it asks. A logged-out account stays tickable here — deliberately unlike the move picker, which can't move a session onto a dead login: this is policy, not availability, and "client work runs on the work subscription" stays true while that subscription is logged out. Rows are built from Store.List, so an email naming a removed account has no row and is dropped on save — opening and saving heals the stale-allowlist state resolveAccount refuses new sessions on. That heal is why the menu guard is asymmetric: only one account dims the row at Len() == 1 only when the origin has no stored allowlist. Removing an account never prunes the allowlists naming it (accountRemoveMsg clears default_account and nothing else), so removing down to one account can leave an origin pointing at an account that no longer exists — which resolveAccount answers by refusing every session there, with the one UI that could clear it dimmed and config.json as the only escape. Deliberately not fixed by pruning on removal: empty is unrestricted, so pruning to empty silently widens the policy, and AllowedConfigured's doc comment names "an account since removed" as precisely the case where falling back is "the one genuinely wrong answer". openAllowedAccounts mirrors the guard exactly, so a lit row can't dead-click and a dimmed one can't be reached another way. Sessions already pinned to a now-disallowed account are left alone; the allowlist governs selection, and the prompt cache it protects is per-account.
  • Codex status: hook-driven with Codex-specific pane checks — Codex hooks are incomplete (a wait/approval prompt and a permission approval fire no hook), so a definite pane state overrides a stale hook (codexPaneWaiting→waiting, codexPaneRunning→running); an at-rest pane lets the hook decide running/finished/idle, and with no hook at all it settles to idle (see the Codex branch in UpdateStatus, session.go). Same pipeline as Claude — fleet hook-handler is agent-neutral (hook_event_name/session_id/prompt match Claude). Hooks installed to ~/.codex/hooks.json (InjectCodexHooks, only when codex on PATH). Codex has no SessionEnd → dead from tmux pane-death. Claude's pane heuristics never run for Codex sessions — the pane checks are Codex-specific.
  • OpenCode status: driven entirely by a generated TS plugin (no pane scraping); same agent-neutral fleet hook-handler pipeline. Unlike Claude/Codex declarative hook JSON, OpenCode's hook mechanism is a JS/TS plugin, so fleet writes ~/.config/opencode/plugin/fleet-status.ts (InjectOpenCodePlugin, only when opencode on PATH; the resolved fleet binary path is baked in). One file serves OpenCode 1.x and 2.x through a single default export { id, server, setup }: 1.x (1.4+) calls server() for the event hook, 2.x calls setup(ctx) and reads ctx.event.subscribe(). Neither accepts the other's shape (2.x refuses the old named export const FleetStatus with "Plugin must export a default definition with an id and an effect or setup function."; 1.x refuses a default export without server()), and both read the same config dir, so picking a template by opencode --version would break whichever install fleet didn't probe. Events map to fleet statuses via spawnSync (synchronous so the final status flushes before OpenCode exits, and ordering is preserved). 1.x: session.status{busy}→running, session.idle→finished, question.asked/permission.asked→waiting, question.replied/question.rejected/permission.replied→running. 2.x: session.execution.started→running, session.execution.succeeded/.interrupted→finished, session.execution.failed→error, form.created/permission.asked→waiting, form.replied/form.cancelled/permission.replied→running (verified against OpenCode 1.19.0 and 2.0.28). Both prompt families are live and are not interchangeable: question.* (1.x) or form.* (2.x) is the AskUserQuestion tool prompt, permission.* is a tool-permission prompt (only fires if the user set permission: ask; OpenCode defaults to allow-all). Watching only one is the stuck-at-running bug — the branches are additive, never a swap. On 1.x the *.replied/*.rejected listeners are belt-and-braces (OpenCode publishes session.status{busy} right after a reply anyway); on 2.x they are load-bearing, since 2.x publishes no session.status and a busy period has exactly one started. Sub-agent sessions have their own ids and are ignored by a root latch (the first session id the plugin sees, kept on globalThis because 2.x re-imports the file when fleet rewrites it, and a module-level latch would start over and could take a sub-agent). The latch filters lifecycle events (busy/idle/error) only: a permission or question prompt from a sub-agent, or a 2.x MCP form owned by "global", still blocks the root's turn, so it is reported under the root (reportAs) — dropping it left the row reading running while the pane waited on the user. Since that merges several sessions' prompts into one row, open prompts are counted (on globalThis, like the latch): a reply reports running only when none is left open, busy is held back while one is (1.x re-announces busy after every reply), a reply with nothing open is dropped as stale (an interrupt can cancel a form after the turn already ended), and the turn's end clears the count. TestOpenCodePluginOverlappingPrompts runs the generated plugin under node to pin that sequence for both handlers. A 2.x session.execution.failed is followed by session.idle, as 1.x does, since nothing else ends that error. On 2.x the plugin only reports from a private server: 2.x runs plugins in a server rather than the TUI, and by default every TUI shares one background service that keeps the env of whichever client spawned it, so its FLEET_INSTANCE_ID can name the wrong pane. setup() stays inert unless the server is a private serve --stdio (opencode --standalone, any client with the background service turned off, opencode run --standalone, opencode acp). That gate is load-bearing on 1.x too: 1.19's newer core loader also calls setup() next to the server() hook, and only the missing --stdio keeps it quiet, so never swap the gate for anything a 1.x process can satisfy or 1.x reports every status twice. Status under 2.x defaults still needs either a version-aware launch with --standalone (1.x's strict yargs root exits on unknown flags, and 2.x's root no longer takes --fork/--model) or a 2.x TUI-entrypoint plugin, which runs in the pane's own process. No dir-trust seeding needed (OpenCode has no trust gate). No SessionEnd → dead from tmux pane-death. UpdateStatus routes OpenCode through applyHookStatus (shared with Codex); no pane heuristics run.
  • Copilot status (GitHub Copilot CLI, internal/session/copilot.go, internal/hooks/copilot_hooks.go): hooks live in fleet's own file, $COPILOT_HOME/hooks/fleet.json (Copilot loads every hooks/*.json, so install writes it whole and uninstall deletes it — never a merge into config.json, which carries // comments and is rewritten by Copilot itself). The file needs a top-level "version": 1. The worker's hook-repair pass rewrites it when the fleet binary it names is gone (RepairCopilotHooks, same rule as Claude's: missing only, never merely different). Copilot's payload is camelCase and carries no event name, so each entry's command appends --agent copilot --event <name> and handleHookHandler normalises onto Claude's names (userPromptSubmitted→UserPromptSubmit etc.) so prompt capture and PromptCount run unchanged; registering the PascalCase keys instead also works but registering both runs every hook twice. Subscribed: userPromptSubmitted, postToolUse/postToolUseFailure (→running: approving a permission fires no hook, the tool finishing is the first sign), notification (→waiting only for notification_type permission_prompt/elicitation_dialog), agentStop, sessionEnd. Never permissionRequest: Copilot treats a failing one as a DENY, so a moved fleet binary would refuse every tool call in every Copilot session on the machine — and it fires for auto-approved tools too, so it was never a waiting signal. Not sessionStart: it fires lazily, after the first prompt, and would flip the first turn to finished. Copilot runs hooks synchronously and for every Copilot session on the machine, so the handler returns before debuglog.Init when FLEET_INSTANCE_ID is unset (a line per tool call would flood the debug.log that bug reports paste) and skips the stale-file sweep on PostToolUse. Two gaps need out-of-band signals, both in updateCopilotStatus: a cancelled turn (Ctrl+C mid-turn, Esc at a permission prompt) fires no hook at all, so while the hook says running/waiting the worker reads $COPILOT_HOME/session-state/<id>/events.jsonl backwards (32KB, doubling while the window holds only bookkeeping, capped at 1MB — a system.message line alone measures 60–71KB) and a trailing abort (skipping hook.*/model.*/session.*/system.* bookkeeping) settles it to finished — assistant.turn_end alone is not an end, it also separates tool steps mid-turn; and /clear and /exit both send sessionEnd{reason:"user_exit"}, so sessionEnd is never dead — it maps to finished, and the pane decides: a hook has fired, pane_current_command is back at a shell (tmux.IsShellCommand) and the owner Copilot process is gone → dead (the pane alone misreads a live Copilot under a tcsh respawn, Ctrl+Z, or a split window — measured). Otherwise it was /clear — or /exit while another conversation is open, which Copilot switches to; the pane can't tell those apart, so the id stays on the closed conversation until the user types again. The reason still marks the hook as a SessionEnd, which keeps a dead session's crash dump from re-arming. A definite pane state (a │ ↑/↓ to navigate · enter to select / enter accept · ctrl+d decline menu → waiting — the box edge is part of the match, and footers are matched only in the last 3 non-blank lines (copilotFooterLines), so a reply quoting one can't pin the row, since /theme's picker shows the same footer words outside a box and other pickers (/resume, /model, /agent, /mcp) were checked not to match, the esc interrupt working footer → running) overrides a stale hook, Codex-style; fixtures captured from a live pane are in internal/session/testdata/copilot/. The conversation id is minted by fleet (launchWillResumeLocked, first launch): copilot --session-id=<uuid> creates the session when it doesn't exist and resumes it when it does, so one form covers every launch and r/suspend work before any hook fires. That id is authoritative (copilotHookAccepted): Claude's same-process rotation rule does not apply, because one Copilot process holds several conversations — /new starts a fresh one and keeps the old one open (both hold session-state/<id>/inuse.<pid>.lock; no sessionEnd, no session.shutdown), and the Sessions sidebar runs more side by side. What moves the session is the user typing: the hook handler records the conversation of the last userPromptSubmitted as prompt_session_id in the status file (kept across later events; written for Copilot hooks only, so a claude/codex run as a tool can't claim it), and a foreign id is adopted only when it equals that. This covers /new, /clear, /resume and a sidebar switch, survives fleet being closed meanwhile (the file still says where the user typed), and a backgrounded conversation finishing its turn can't pull the session back. Subagents fire userPromptSubmitted too, under their own id, along with their tool and stop hooks — but a subagent logs into its parent's events.jsonl and never gets a session-state/<id>/ of its own, while a real conversation always has one before its first hook runs (session.start precedes it). So isCopilotSubagent drops those hooks in the handler, before they can overwrite the user's prompt (auto-naming) or read as the conversation being typed in. First prompt is --interactive="$FLEET_INITIAL_PROMPT" (the = form; -i "--x" exits with "Invalid command format"). Y sends Enter alone for Copilot: its menus pre-highlight "1. Yes", and a typed letter can land in the "No, and tell Copilot…" text row. fleet send's delivery check also accepts Copilot's collapsed paste, [Paste #1 - 12 lines] (matched squashed as [Paste#).
  • Relaunch death rattle (all agents): r/respawn/suspend kill the old agent after clearHookState, and its shutdown can still fire a SessionEnd carrying the same conversation id the relaunch resumes. clearHookState keeps the old owner's pid as retiredPID and UpdateHookStatus drops any hook from it — the pid is the only thing that tells it apart. Claude recovered from this on its next SessionStart; Copilot fires none at launch, so its "hook fired + pane is a shell" rule would read it as a crash. A relaunch of an agent that never fired a hook has no pid to retire; for Copilot (which fires nothing at startup) a SessionEnd arriving before any other hook since the relaunch is that killed process's and is dropped, for 5s after the relaunch (relaunchQuietTo; the rattle lands within ~2s) — so only an /exit typed in those first seconds reads idle. The retired pid is honoured for 10s (retiredHookWindow), so a later agent the OS hands the same pid isn't silenced. RespawnClaude never SIGHUPs a pid whose pane is already at a shell — that Copilot exited, and its pid may be someone else's now. Copilot needs one more thing on relaunch (awaitRetiredAgent, shared with Antigravity): it holds a per-process lock on its conversation, and a busy Copilot takes ~1.8s to exit after the kill (it runs its sessionEnd hook on the way out), so a new one started at once opens on a "Session in use — Resume anyway?" menu. Restart waits (capped at 5s, off the Update loop) for the old pid to exit — including, within 5s of a Suspend, the agent the suspend killed (a Copilot that has had a turn keeps its lock ~0.4–0.9s after the kill, measured; resumeWaitPID, never on the signalling respawn path); RespawnClaude's respawn-pane -k kills and relaunches in one step, so for Copilot it first sends the old process SIGHUP itself. Both act only after ps confirms the pid is still a copilot binary, since it came from a hook and could have been recycled.
  • Copilot trust: a folder that isn't trusted opens on a "Do you trust the files in this folder?" menu, behind which no hook fires. EnsureCopilotDirTrust appends the realpath to trustedFolders in $COPILOT_HOME/config.json — not settings.json, which was verified not to work (Copilot migrates a settings entry into config.json and drops it when config.json already has the key). The file is JSONC that Copilot owns, so the file is re-serialized (values kept and written without HTML escaping, keys sorted, comments other than the // header dropped); it runs in the launch's tea.Cmd, never the Update loop, under its own mutex (not Codex's trustMu) plus Copilot's own flock(LOCK_EX) on config.json.trusted-folders.lock (measured in Copilot 1.0.91; never deleted), so parallel fleet wt processes and Copilot itself can't drop each other's entries. Best effort: the lock is tried for 2s, and a stuck holder or a filesystem that can't lock means seeding unlocked — a lost entry shows as the trust menu, a launch that hangs doesn't show at all. The same step writes the hooks file if it's missing or stale, since startup installs it only when copilot was on PATH then, and the comment stripper is string-aware ("https://github.com" would otherwise be cut). Copilot's own trust propagation covers only worktrees it creates itself, so fleet seeds per session. A seed Copilot later overwrites shows as waiting (the trust menu shares the permission prompt's footer), never a silent idle.
  • Antigravity (Google's Antigravity CLI, binary agy; internal/session/antigravity.go, internal/hooks/antigravity_hooks.go, handler normalizeAntigravityEvent). Everything below was measured against agy 1.5.14 on macOS and Ubuntu, where the docs were wrong or silent. Launch: agy --settings="$FLEET_AGY_SETTINGS" [--conversation <id>] [--model m] [--effort e] [--prompt-interactive="$FLEET_INITIAL_PROMPT"]. agy parses flags with Go's flag: an unknown flag and any stray positional exit 2 (unexpected argument … Prompts are read only from -p/--print, -i/--prompt-interactive), so -- "$P" is fatal and the prompt rides --prompt-interactive=. Trust rides --settings (session-only, never written to settings.json — verified), carried in the FLEET_AGY_SETTINGS tmux env var because it embeds the realpath'd project dir (agent.AntigravitySettings), so no trust seeding or file locking exists. --effort is a closed set (low…max): interactively agy warns and swaps in its default rather than exiting, so ValidEffort refuses at parse time. A minted --conversation <uuid> is silently ignored (new id), so ids come from hooks like Claude's; no fork flag (SupportsFork false). Hooks live under fleet's own key fleet-status in the shared ~/.gemini/config/hooks.json (hooks in settings.json are never loaded), merged with every other key kept. Shapes are not interchangeable: tool-less events take [{"type":"command","command":…}], tool events [{"matcher":…,"hooks":[…]}], and a nested entry without a matcher makes agy skip the whole file (pinned by TestAntigravityHooksPassTheRealValidator, which runs agy plugin validate). Never PreToolUse: a failing one blocks the tool call; PreInvocation/PostToolUse/Stop fail open. Not SessionStart either: agy's own /hooks manager writes it back null. That manager also writes hooks.json back from the snapshot its session loaded, erasing an entry installed later (reproduced) — RepairAntigravityHooks restores a missing entry on the 60s repair pass and leaves one the user switched off ("enabled": false) off. fleet hooks install|uninstall|status cover it (uninstall regardless of PATH). The handler also drops an agy hook with no FLEET_AGY_SETTINGS in its environment — every agy session fleet launches has it, so that is an agy -p a tool ran inside another agent's session. Commands use nonFleetSessionGuard, whose exec is load-bearing on Linux: Ubuntu's dash forks, so without it the handler's parent is sh and ownership by pid inverts. Handler: payload is camelCase (conversationId, lastUserInput, invocationNum, fullyIdle). Subagents fire every hook under their own id with lastUserInput:"" — dropped. PreInvocation with invocationNum 0 is UserPromptSubmit, except a continuation (parent resuming after a subagent reports, same input, after a Stop{fullyIdle:false} = hooks.EventBackgroundWait). Status is pane-led (updatePaneLedStatus, as Codex): no hook fires on a permission prompt, an Esc interrupt, a subagent's approval, or /exit. Waiting = a ↑/↓ Navigate hint line directly above an esc to cancel status bar (command/create/edit/ask_question), a subagent's ┃ … ctrl+k approve banner above the input box, the Alt+J ⚠ Approval Required view, or the trust / sign-in menus by wording; its own pickers (/hooks, /model) have no esc to cancel under the hint and stay unmatched. Running = esc to cancel status bar, or live subagents (status bar N subagent(s), dropped at ≤50 cols, or the left-aligned ● Agent(…) dock rows, which survive). An at-rest pane under a running hook settles to finished after the two-frame confirmation (settleInterruptedAntigravityTurn; a failed capture resets it rather than counting as at rest) — this also clears a BackgroundWait whose fullyIdle:false lied (agy sent it as a turn's final Stop with every subagent done). A one-shot fleet status gets the second frame from Observer.secondLook (agy only, only while that confirmation is half-built, ≤400ms), or it would report an interrupted turn as running until the next one. Dead = pane at a shell and owner pid gone (Ctrl+Z shows a shell over a live agy). Ownership: a new conversation id (/clear, /resume) is adopted only from the owner's own process (antigravityHookAccepted). Y sends Enter for agy's own prompts and Ctrl+K for a subagent banner (session.AntigravityApproveKey). Relaunch waits for the old pid (awaitRetiredAgent; a busy agy took 3.3s to exit, and two processes on one conversation get a "Conversation already open" warning). Titles: ~/.gemini/antigravity-cli/annotations/<id>.pbtxt (title:"…", auto-generated and /rename). Skills: ~/.gemini/config/skills, detected by binary only (~/.gemini is also gemini-cli's). The Linux installer leaves ~/.local/bin off PATH, so MissingBinaryMessage names it.
  • Codex trust: dir-trust pre-seeded to ~/.codex/config.toml ([projects."<path>"] trust_level="trusted", via EnsureCodexDirTrust) before launch; hook-trust is a one-time global TUI prompt the user accepts on first Codex launch (persists in config.toml [hooks.state]).
  • Session resume: captures the agent's session_id from hooks (Copilot's is minted by fleet), uses claude --resume <id> / codex resume <id> / opencode --session <id> / copilot --session-id=<id> / agy --conversation <id> on restart
  • Editor: config.editor > $EDITOR > "code" (VS Code). internal/editor resolves the name to a command: CLI launcher on PATH if there is one, else open -a <App> against the installed bundle. That fallback is what makes JetBrains IDEs (GoLand, PyCharm, IntelliJ, …) work — Toolbox doesn't install goland/pycharm shims unless asked, so PATH-only lookup failed with "executable not found". Bundles are prefix-matched (PyCharm Community Edition.app → pycharm) across /Applications, ~/Applications, and ~/Applications/JetBrains Toolbox, scanned once per launch. The Settings editor cycler offers only editors this machine can actually launch (editor.Available()), so a preset can't be a dead option. Flags (code -n) are a CLI-only contract: a spec carrying them with no launcher on PATH errors rather than silently dropping them.
  • Themes: fleet-pink (default, flagship brand accent #dc88c0), tokyo-night, catppuccin-mocha, rose-pine, nord, gruvbox — configurable via settings (S key)
  • Settings dialog: S key opens a master-detail overlay — category rail (Appearance / Behavior) on the left, that category's settings on the right; tab switches panes, j/k move, ←→/h/l cycle a value, auto-saves on esc. The Appearance category renders a live mock-sidebar preview (synthetic data via RenderSidebarPreview → the real RenderSidebar, so it can't drift) and holds: Theme, Status style (icon/bar), Agent icons, Slot badges, Account usage (split/grouped/off), PR badges, Dirty marker, Status pills, Header counts, Chevron style (triangle/plusminus), Density (normal/compact). Behavior holds editor, tick, auto-name, auto-update, copy .claude, worktree location (worktree_path presets: beside repo / <repo>.worktrees/ / ~/worktrees/; any other template reads Custom and stays in the ring so an arrow can't overwrite it), confirm before restart, drawer height (rows, capped at the 14-row body max), origin forget removes worktrees, enter mode, telemetry, default agent, idle-session suspend (off/light/balanced/aggressive).
  • Display toggles: each Appearance toggle is a *bool/string config field with a default-on getter (config.go) feeding a package global in styles.go (ShowAgentGlyphs, ShowStatusPills, ShowPRBadges, ShowDirtyIndicator, ShowSlotBadges, ShowHeaderCounts, ChevronStyle, SidebarDensity) — the same pattern as StatusIndicatorMode. Globals are synced from config via ApplyDisplayConfig(cfg) in NewHome (startup) and after each Appearance change; the sidebar render* funcs read them at render time.
  • First-run onboarding: on first launch, after the analytics consent prompt, a one-time theme picker (internal/ui/onboarding.go, gated by display_onboarding_seen config flag) shows the theme cycler beside an annotated sample sidebar that teaches how to read status dots, agent glyphs, branch, worktree, dirty *, and PR badge. enter keeps the previewed theme; s/esc reverts and skips. Either way it's marked seen.
  • Telemetry (internal/analytics): three modes via telemetry_mode config (full/minimal/off; read through config.GetTelemetryMode, which migrates the legacy telemetry bool — true→full, false→minimal). full = usage events tagged with git name/email (PostHog person profile; distinct_id = git email). minimal ("Basic" in the UI) = every event full sends, anonymously: distinct_id is the device hash, never the git email, and there is no people profile — identify and SetUserProperties no-op (gated on Client.mode), and every event sets $process_person_profile=false so the device still counts as a unique user (DAU). It used to send only app_started + app_active, which left most new users unobservable at exactly the moment they left. What moved is who an event is attributed to, not the privacy line: no property may carry a file path, prompt, code, repo/branch name, email or error string — reasons are short enums, and sanitizeProperties still strips the blocklisted keys. editor_opened.editor passes through a sanitizer in internal/ui/analytics_props.go (editorName, the command's base name). error_occurred.category is a snake_case enum named at each Home.setError(category, err) call site, and the guard globs the package's non-test files rather than listing them — setError is a method on Home, so any new dialog file can call it, and an enumerated scan set would let the next one ship unchecked (the len(seen) floor can't notice: today's callers clear it alone). It used to be derived from the message — the text before the first :, kept only when it read as fleet's own prose — which had to refuse anything carrying a digit or a punctuation mark, since a path, a branch name or a wrapped git error is made of exactly those. That refusal was doing its job and also swallowed most real failures into other, because fleet's messages say restart failed: %w and slot %d was stale: a user's whole first-day error history could read other and say nothing about what they hit. A literal at the call site is both accurate and safe by construction — no error text reaches the backend by any route, so the privacy line no longer rests on a regex being strict enough, and rewording a message can't silently retag it. The category is a parameter, not a defaulted second helper, so the compiler asks for it: a variant taking only the error would be the other this replaced, quietly reachable again. TestErrorCategoriesAreSnakeCaseEnums pins that every one is a string literal, snake_case, and not other (and fails if the scan stops finding call sites). Categories are what a funnel is grouped by — renaming one splits its history in two. The device hash is SHA256(IOPlatformUUID) on macOS and, on Linux, an HMAC-SHA256 keyed by /etc/machine-id over a fleet constant (machineIDHash) — never the ID or a plain hash of it, which machine-id(5) forbids because every app hashing it alike would share one value. A readable machine ID overrides the device_id cache, replacing the hostname + arch hash earlier Linux builds wrote (reproducible by anyone who can guess the hostname); that fallback now runs only where no machine ID is readable. off = disabled client, nothing sent. session_errored is sent from internal/session once per move into StatusError (newFailure): never from a session already in error, and never from StatusStarting, where a liveness check that lands mid-launch sees a tmux session that doesn't exist yet — the launch reports its own start_failed/restart_failed/respawn_failed. Beside the reason enum it carries what the death itself knows and reason cannot. exit_reason on a hook death: Claude Code's SessionEnd reason (clear/logout/prompt_input_exit/other), threaded status file → watcher → HookStatus → Session.hookReason, and snapshotted in the same RLock as hookStatus rather than re-read later. hookStatus is what selects the death branch, and the hook path runs CapturePane plus (rarely) a transcript walk in between; UpdateHookStatus writes from the UI goroutine as well as the worker, so a fresh read would pair a stale dead with a newer hook's reason — and /clear fires SessionEnd then SessionStart back to back, so the reading lost would be exactly the rotation this names. SessionEnd fires on /clear and /logout too, so without it hook_dead cannot tell a conversation rotation from a session that actually died — which is most of what hook_dead counts. Stored unconditionally alongside hookStatus, so it describes the hook being held rather than outliving it. exit_code/exit_signal on a dead pane: tmux's own #{pane_dead_status}/#{pane_dead_signal} via exitProps, which separates a clean /exit from a SIGKILL the machine ran out of memory for. pane_dead only — tmux_gone passes nil and never asks, because a gone session has no pane to report on (PaneDeadInfo would return ok=false every time) and the question is an uncached list-panes capped at listPanesTimeout (2s). Affordable once, ruinous in the case the property exists to explain: an OOM-killed tmux server takes every session down at once, so one heavy pass would spend it per session against a 90s workerStallThreshold. It also costs a tmux call on the branch that does ask, so it runs only on the transition (behind newFailure). TestSessionErroredCarriesThePanesExitCode counts the calls, since on tmux_gone "didn't ask" and "asked and got nothing" produce the same event and only the count tells them apart. Every value is an enum or a small integer tmux and Claude Code choose; an empty one is dropped, so the event is unchanged for a caller with nothing to add. startup_failed{tmux_missing} is sent from main before the TUI exists, on a client it inits itself, and only for a user who has answered the consent prompt — GetTelemetryMode defaults to full, which is not an answer. First-run consent prompt (internal/ui/consent.go): accept → full, decline → minimal (the dialog's Basic line reads "anonymous usage — what's used, never who"); off is Settings-only (Behavior category, 3-way cycler). Env FLEET_TELEMETRY_DISABLED/DO_NOT_TRACK force off regardless of mode. analytics.Heartbeat() (fired on the UI tick, rate-limited to once per calendar day in-memory) keeps DAU accurate for long-running instances that rarely restart; it runs in both full and minimal. SyncEnabled tears down + re-inits the live client when the mode changes in Settings — detaching the old client synchronously (so Init installs the new one) but flushing it on a goroutine, since Settings-close runs on the Update() thread. Backend is PostHog via the posthog-go SDK (built in newSink, analytics.go), which owns its own batching worker; the project (capture) API key is embedded like the old ingest token — write-only, ingest-only — with FLEET_POSTHOG_KEY/FLEET_POSTHOG_HOST env overrides. A build with the key stripped (projectAPIKey blank) creates a disabled client and sends nothing. The SDK's Enqueue blocks, so Client fronts it with a drop-on-full queue (queueSize 256) drained by a background goroutine — that's what keeps Track/Gauge safe to call from Update(); a full queue drops the event rather than stalling the UI. Quit flushes via Shutdown (bounded by shutdownTimeout, 2s). The SDK's own Debugf/Logf are dropped, not forwarded (phLogger): they log the serialized message, whose distinct_id is the git email in full mode, and debug.log is what the bug-report flow pastes into a public issue — only Warnf/Errorf (counts + error strings, no payloads) reach the log, at Warn so broken telemetry is visible without FLEET_DEBUG.
  • First-run action trace (internal/ui/firstrun_trace.go, onboarding_first_run_trace): the ordered list of what a newcomer did between their first launch and their first quit — one event per install, never again. Most newcomers leave inside their first few minutes and the funnel can't say why (the launchpad, a session that broke, never finding Enter, or simply not wanting it), and a TUI has no session replay, so a trace of what they pressed and what fleet showed them is the nearest thing: ["0:consent_full","4:theme_keep","6:launchpad_shown","23:launchpad_enter","36:attach","40:detach_bail","145:quit"]. An entry is a second offset plus an enum from a fixed table, and that is the whole privacy contract — never a path, title, prompt, repo or branch name, error string, or typed character. It holds structurally rather than by discipline: the key hook sits in handleKey below the modal / launchpad / focus / filter / drawer branches (where normalizeKey sits, and for the same reason — everything that owns text has already returned, and forwardKeyToPane is never reached), record refuses any token outside ^[a-z_]+(_x[0-9]+)?$, and TestFirstRunTraceEmitsOnlyEnums parses every call site and both lookup tables, failing on an argument that is not a vocabulary constant or one of traceDialog/traceCommand/traceMenu. ActionLog is deliberately untouched — it carries detail and serves bug reports, which stay on the machine until the user files one; h.logAction is the single funnel feeding both, and traceForAction maps only the actions with a vocabulary entry, so an unmapped one ("open editor", "ticket jump", "move account") records nothing rather than spelling its own action name. The two free-text prefixes are the exception and are safe for the same reason: "command: "/"context menu: " carry a dispatchCommand id, itself an enum. Consecutive nav keys collapse into one counted entry (nav_x12) stamped when the run began, so a scroll costs one slot of the 300-entry cap; past it the oldest are dropped and counted in entries_dropped. ended is the half that matters: newcomers close the terminal rather than quitting (we see launches with no app_quit), so a trace living only in memory would miss exactly the runs worth reading — it is persisted to ~/.config/fleet/first_run_trace.json on a ≥2s debounce and the next launch sends it as unclean, from fireStartupAnalytics: the one place per launch that has a client to send with, since on a first launch Init does not happen until the consent prompt is answered. That write is synchronous on the Update loop — the one exception to the no-blocking-I/O rule, earned by being a few KB to a local file, at most every two seconds, during one install's first run; a goroutine would buy a write-ordering problem and a test that has to wait for it. A clean ending sends from the quit path beside onboarding_first_quit. One-shot via MilestoneFirstRunTrace (analytics.MilestoneReached is the read-only half — asking with MarkOnboardingMilestone would answer the question by marking it): a launch is either the recorder or the reporter, never both, and that is enforced at both ends — firstRunTraceShouldRecord leaves h.firstRun nil at NewHome whenever a leftover is waiting, and sendUncleanFirstRunTrace returns early whenever h.firstRun is live. The second half is not belt-and-braces: fireStartupAnalytics runs from the consentResultMsg handler nine lines after it records consent_full, which is the recorder's first record and so writes the file immediately (the debounce has no previous write to measure against) — without the guard the reporter reads that file straight back and the install's only event is ended=unclean trace=["0:consent_full"], with everything after it unrecorded. A clean quit can also beat Init: someone who reads the consent prompt and quits never initializes a client, and Track drops what it can't send, so emitFirstRunTrace parks the event with analytics.QueuePending (analytics.Initialized is the predicate) and the FlushPending already beside Init sends it next launch — still ended=clean, and still only once the user has answered consent. Recording stops the moment the milestone is marked, telemetry off still marks and deletes so an install that never reports is one-shot too, and h.firstRun is nil for every run past the first, so a regular pays one nil check per key.
  • Report dialog (!): a type picker first (Wrong status / Bug / Feature), then a form sized to the kind — each files with its own label (bug / bug / enhancement) and its own body, so a feature request carries no debug log and a status complaint can't land as an undiagnosable generic bug (the #157 outcome). The picker is a stage of the existing BugReportDialog, not a new dialog, so it inherits every registration (modalOpen, routeToModal, renderBody, SetSize). Esc on a form returns to the picker; Esc on the picker closes.
  • Wrong-status reports (internal/ui/statusreport.go): the capture fires at the ! keypress, not at submit — status is a moving target, and by the time a description is typed the session may have self-corrected, so re-reading then would freeze a state nobody is complaining about. openBugReport (app.go) shows the dialog and returns the capture tea.Cmd; it lands via reportSnapshotMsg → SetSnapshot (ignored unless the arriving capture's session id matches the form's). The shown status and title are likewise read once at keypress. The form adds an expected-status cycler (running/waiting/finished/idle/error — not starting, transient, nor suspended, user-initiated) that starts unset and refuses submit, same rule as SnoozeDialog's unparseable box; the footer names whichever field is missing. Body is two tiers: the signals table (hook status/event/age, pane_detected vs tui_shows, worker stalled, claude_log.advanced_past_hook) always ships and holds no user content; the screen excerpt (last 40 pane lines) plus the session-filtered debug log ship behind ctrl+p, on by default, previewed in the dialog above the toggle so the default is visible rather than silent. Switching it off hides the excerpt from the preview too (a preview that outlives its checkbox is the ambiguity previewing was meant to remove) and drops the global debug log and config.json from the shared diagnostics block (FormatEnvironmentMarkdown(includeLogs)) — otherwise the toggle would remove one log and smuggle a wider one back in, and config carries default_project_path, confidential in its own right when client names live in directory names.
  • Status-report body is built by allowlisted field reads off the snapshot map (metaSub/metaString), never json.Marshal of it: snapshot.json embeds hook.file_contents.user_prompt, the reporter's verbatim prompt, which the dialog never shows them. TestBuildStatusReportBody_NeverLeaksUserPrompt guards it. Governing rule: nothing ships that the dialog didn't show or the checkbox didn't name.
  • captureStatusSnapshot(..., persist, copyTranscript bool): Shift+D passes true, true; the ! path passes false, false. persist=false touches the filesystem nowhere — no dir, no snapshot.json, and crucially no writeGoroutineDump (runtime.Stack(all=true) pauses every goroutine, which must not sit on a hot interactive key). ! fires a capture on every press, before a report kind is chosen, so persisting would fill ~/.config/fleet/snapshots/ with cancelled dialogs and feature requests and break the invariant the debug-status skill leans on: the newest dir there is a deliberate D capture. Nothing is lost — the issue body is built from the returned values, never read back off disk, and the two files that exist only on disk (pane_raw.txt, goroutines.txt) are never published anyway.
  • Async capture is matched by session id, not visibility (snapshotResult.sessionID vs statusReportForm.sessionID). ! on A, esc, ! on B are both visible status forms, so an id-blind guard lets A's slow capture land in B's form: the issue would be headed with B's title and status while every signal, the excerpt and the log came from A — publishing A's screen, which that dialog never previewed.
  • Submit gating runs through one function, submitBlocker, consulted by both the Enter handler and the footer so the key can't act on a state the footer calls unready. It blocks while the capture is in flight (!captured && err == nil) — submitting then would emit "the capture failed or the session had no live tmux pane", a false cause, on exactly the undiagnosable report this flow exists to prevent. A capture that genuinely failed still submits: there the line is true.
  • Pane excerpts and titles truncate with ansi.Truncate, never the byte-based truncate in bugreport.go. Pane lines are dense with 3-byte box-drawing runes (│ ╭ ─ ❯), so byte slicing cuts at roughly a third of the intended columns and can split a rune — the excerpt the reporter is asked to approve wouldn't match their screen, and invalid UTF-8 can reach lipgloss.
  • sanitizeHome (statusreport.go) is the single home→~ rewrite for everything bound for a public issue, including issue titles. A body that sanitizes while its title publishes /Users/<name>/… verbatim leaks on the one line GitHub shows in search results and notification mail.
  • Error history: ring buffer (max 50) of errors that flash for 5s — persists for bug reporting
  • Action log: ring buffer (max 100) of user actions (attach, delete, restart, editor, approve, etc.) for "steps to reproduce"
  • Diagnostics: app version, OS version (macOS sw_vers; Linux distro PRETTY_NAME from /etc/os-release + kernel), tmux/claude/codex/gh versions, config, last 100 lines of debug.log; home dir sanitized to ~
  • Auto-naming: sessions titled from the agent's own session title (session.ReadAgentSessionName dispatches per agent); falls back to fleet's prompt heuristic (filler stripping, word-boundary truncation) only when the agent has written no title yet
  • Agent titles: Claude's come from the conversation JSONL (ReadClaudeSessionName). Codex's come from its state DB (ReadCodexSessionName) — /rename inside Codex runs UPDATE threads SET title, and the rollout JSONL carries no title at all, so SQLite is the only source. It's read read-only at $CODEX_HOME/state_<N>.sqlite (highest N wins; Codex bumps the suffix with its schema). Codex seeds threads.title with the raw, untruncated first user message, so a title still equal to first_user_message is not a rename and is ignored — adopting it would swap fleet's short heuristic title for a multi-thousand-char prompt. Antigravity's come from annotations/<id>.pbtxt (ReadAntigravitySessionName, id must be a UUID since it becomes a path). Copilot's come from $COPILOT_HOME/session-state/<id>/workspace.yaml (ReadCopilotSessionName): its name is model-generated after the first turn (like Claude's ai-title) and replaced on /rename (user_named: true), absent before that. OpenCode titles its sessions too; fleet doesn't read them yet.
  • Title precedence: manual R-key rename (ManuallyRenamed) > the agent's own title (Claude custom-title from an in-session /rename, else Claude ai-title — auto, model-generated, evolves with the work; or a Codex /rename) > fleet prompt heuristic
  • Auto-naming pipeline: worker cycle re-reads the agent's title each cycle until one appears (agentNameFreshPollWindow, so prompt pickup within ~2s), then ~every 30s (agentNameRecheckInterval) to follow ai-title/custom-title//rename drift; heuristic fallback uses UserPromptSubmit hook → status file → HookWatcher → Session.FirstPrompt → naming.GenerateTitle
  • Manual rename (R key) sets ManuallyRenamed flag, prevents auto-rename
  • Chrome tab control: p opens PR in Chrome via extension (reuses existing tab), falls back to open <url> if unavailable
  • Chrome extension architecture: TUI →[unix socket]→ native host (fleet chrome-host) →[stdio]→ Chrome service worker
  • Native messaging host: fleet chrome-host subcommand (also auto-detected when Chrome passes chrome-extension://... arg)
  • Unix socket: ~/.config/fleet/chrome.sock (created by native host, mode 0600)
  • NMH manifest: auto-installed to ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.brizzai.fleet.tabcontrol.json on TUI startup
  • Chrome extension ID: haphpcoecelhofejcklinnlbfijgdnih (stable via key in manifest.json)
  • Extension commands: open_or_focus, close_tab, create_tab_group, ping
  • Service worker reconnects to native host on disconnect (2s delay)
  • Claude Code + OpenAI Codex + OpenCode + GitHub Copilot CLI + Antigravity CLI, macOS + Linux (see docs/linux.md for the platform split)