﻿---
title: Watching
description: Watching a swarm: the agents pane, each worker's activity, the stuck signal and the ladder it starts, what the swarm used, the map, and what changed since you last looked.
url: https://docs-v3-preview.elastic.dev/goals/swarms/watching
---

# Watching
<note>
  New goals go through the [wizard](https://docs-v3-preview.elastic.dev/goals/first-goal), whose [Go](https://docs-v3-preview.elastic.dev/goals/go) step starts their swarm; this page is the
  reference for the swarm machinery Go runs.
</note>

A running swarm has several agents at work at once, each in a tab of its own. You do not have to open those tabs to
know how it goes: the agents pane shows what every agent is doing, for how long and whether it looks stuck, the map
shows the whole swarm at a glance, and "since you last looked" says what changed while you were away. heed watches the
workers for you too: one that looks stuck is nudged, then helped, on its own.

## The agents pane

`W` on a goal (`:goal.agents`) opens its swarm's agents; `W` again goes back to the overview.
![The agents pane: the workers on the left, the one under the cursor in the middle, what changed and what needs you on the right](https://docs-v3-preview.elastic.dev/images/shots/goals/swarm-agents-scene.png)
![The agents list: four workers with their state, their progress against the estimate, and 2.2 stuck while it waits for an answer](https://docs-v3-preview.elastic.dev/images/shots/goals/swarm-agents.png)

| Where  | What it shows                                                                                                                                                                                                                                                                          |
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Left   | Every task a worker ran on: its state (working, asking, stuck, or where its PR is), what it is doing now and since when, and its time on the task against its estimate. The bar turns amber over the estimate or when it looks stuck                                                   |
| Middle | The worker under the cursor: what it does now and what it blocks, its time on the task, its stuck signal; its progress notes (`heed swarm note`) and heed's stuck episodes; its activity, newest first: tool calls (failures in red), files changed, and what was said to it and by it |
| Right  | What changed since you last looked, and Needs you: this swarm's questions that are yours, the selected worker's first, each with what every choice would change                                                                                                                        |

The cursor starts on the worker that most needs a look: a stuck one, else the first at work.

| Key      | Does                                                                                                                |
|----------|---------------------------------------------------------------------------------------------------------------------|
| `j` `k`  | Move between workers                                                                                                |
| `s`, `↩` | The worker's tab (its whole transcript)                                                                             |
| `p`      | Pause or resume its task                                                                                            |
| `t`      | Hand its task to another agent                                                                                      |
| `1`…`9`  | Answer the first question in Needs you with that option                                                             |
| `i`      | Type an answer to it                                                                                                |
| `c`      | Ask the controller                                                                                                  |
| `F`      | Once the swarm is done: a follow-up swarm ([The summary](https://docs-v3-preview.elastic.dev/goals/swarms/summary)) |

A click selects a worker, a double click opens its tab, a right click has the task's menu. The menu bar's Goals menu
has the same under **A swarm's agents**.

## Activity

heed keeps two kinds of activity for every worker, in its event log next to everything else it records:
- **Tool calls**, from the agent's `PostToolUse` hook (and, for Claude Code, `PostToolUseFailure` for a call that
  failed; one you stopped with Esc is not counted as a failure): the tool, its most telling argument cut to 80 characters
  (`Bash(dotnet build)`, `Edit(src/Links/LinkPass.cs)`), and whether it failed. A failure keeps a digest of its error:
  its telling line with numbers, hashes and quotes evened out, so the same error twice has the same digest. The tool's
  whole input and output are never kept. At most one call every two seconds is kept (a failure always is); the ones
  in between are counted on the next one.
- **File changes**, from the worker's worktree: `git status` and `git diff --stat` once a minute while it works (every
  three minutes for a worker on a host, over its shared ssh connection, and only while it answers), and a row only
  when something changed (files, lines, or a new commit).

Activity is kept 14 days and at most 4 MB of it; the oldest goes first. Measured on a fixture of one busy worker-hour
(every hook payload of the hour, and a worktree read a minute):

|                                     | One busy worker-hour                  |
|-------------------------------------|---------------------------------------|
| Tool calls the agent made           | 463 (225 KB of hook payload)          |
| Kept, after the two-second throttle | 366, 13 of them failures              |
| File changes kept (of 60 reads)     | 27                                    |
| Rows                                | 393, 97 bytes each on average (38 KB) |
| Database growth, indexes included   | 140 KB                                |

So the cap holds about 110 such hours, some 15 MB of database. The test that measures this runs with the rest of
heed's tests, so the numbers stay true.

## When a worker is stuck

A worker looks stuck when any of these holds:

| Signal                                                        | Default | Starts the ladder |
|---------------------------------------------------------------|---------|-------------------|
| The same error, so many times in a row                        | 3×      | Yes               |
| No tool call and no file change for                           | 10 min  | Yes               |
| Its screen reads waiting or stuck while its hooks say working |         | Yes               |
| Time on the task over its estimate                            | 1.5×    | No: amber only    |

Who reads the screen depends on your decider. With [Hunch](/configuration/inference#hunch) chosen and its model
downloaded, Hunch reads the last 20 lines of each working worker's pane as *working*, *waiting for input*, *stuck:
looping or erroring* or *done*: at most once a minute per worker, only when its screen changed, and never on the main
thread. Waiting and stuck are signals; working and done are not, and a reading Hunch is less than 50% sure of leaves
it to heed's guess. Otherwise heed guesses from the screen as it always has: a permission or question prompt on a pane
whose hooks say working reads waiting. The agents pane's stuck signal says which one read it: *its screen reads stuck
(Hunch)*, *its screen reads waiting (heed's guess)*, and under it Hunch's newest reading with its confidence.
`:hunch.screen` has Hunch read the worker under the cursor now.
Waiting for an answer is not being stuck: while a question of its own waits, its quiet does not count (the question
has its own ladder). Two more settings belong to that ladder: how long a question may wait on a peer before it moves
on (8 min), and how long one may wait on you before heed reminds you (15 min). A reminder is a steering row, and
Needs you notifies again, once.
When a worker is stuck, heed climbs the ladder for it, and every step is a steering row:
1. **Try another way.** heed tells the worker what it saw and to note what it tried, then take a different approach.
   The nudge is a message like any other: typed into its pane once its agent is idle and you are not typing there.
2. **Ask.** Still stuck ten minutes later, heed asks on its behalf how it should go on ("try a different approach" or
   "stop and wait for the owner"). Getting a worker unstuck is a reversible choice, so the question goes to a peer at
   work nearby, then the controller, then you, as any question climbs ([Steering](/goals/swarms/steering#the-ladder)). The answer
   is typed into the worker's pane.
3. **Over.** Once it moves again (or its worker ends), the episode ends.

![A stuck worker in the agents pane](https://docs-v3-preview.elastic.dev/images/shots/goals/swarm-stuck.png)
![A worker Hunch reads as stuck, the signal naming Hunch](https://docs-v3-preview.elastic.dev/images/shots/goals/swarm-stuck-hunch.png)
![The steering log of an automatic escalation](https://docs-v3-preview.elastic.dev/images/shots/goals/swarm-escalation.png)
`:swarm.stuck <estimate|errors|quiet|peer|you> <value>` changes a setting for the goal's swarm (`0` turns one off;
the estimate is a ratio), and is a steering row. A follow-up swarm starts with the same settings.

## What it used

Each worker's hooks report its tokens and cost (estimated from `[usage.prices]` when the agent reports none). heed
keeps them on the worker's record as it works, every cent or ten thousand tokens, not only when it ends, so the swarm's
dollars count work in progress, a restart loses nothing, and reaching the dollar limit pauses it as before
([Running](/goals/swarms/running#at-a-limit)). The agents pane's header and the map show the swarm's spend and tokens against its
limits.

## The map

`V` on a goal (`:goal.map`) draws its swarm as a map: the goal and its lead on the left, the plan's phases as columns,
each task a card coloured by its state (done, working, asking, blocked, stuck, waiting), and an edge for every task it
waits for. A task that waits for nothing hangs off the goal. A small plan is drawn larger to fill the pane; a large one
is never shrunk below its own size, so its cards stay readable: it scrolls both ways, and moving the cursor with the
map's keys keeps its card in view.
A dot on a dotted path is something on its way: a message, an answer or a question heed has not handed to its agent
yet (it hands things over only when the agent is idle and you are not typing to it, see
[Steering](https://docs-v3-preview.elastic.dev/goals/swarms/steering)), and each question that waits for you, on its way to the goal and its lead. The dot sits next
to the card it goes to and says what it is (`msg`, `ask`, `answer`, with a count when several go the same way). The
goal's card stands for the lead, you, the controller and heed alike. While the window is open the dot pulses gently.
![The map: the goal and its lead on the left, the tasks in two columns by phase, and the ask and msg dots on the lines between them](https://docs-v3-preview.elastic.dev/images/shots/goals/swarm-map.png)

| Key      | Does                                       |
|----------|--------------------------------------------|
| `h` `l`  | Between columns: the goal, then each phase |
| `j` `k`  | Between the cards of a column              |
| `s`, `↩` | The card's worker, in its tab              |
| `p`      | Pause or resume its task                   |
| `t`      | Hand its task to another agent             |
| `e`      | Edit the task, in the plan                 |

Over the map, the swarm's numbers in a line (agents, tasks done, time, spend, its lead); under it, the map's keys, each
one clickable. What changed since you last looked and the questions that are yours are on the agents pane (`W`), so
the graph has the whole width. The status bar lists the map's own keys; a goal's list keys (`a` archive, `n` new) are not offered there, as they do
not work there.

## Since you last looked

Opening a swarm's agents or its map shows what changed since you last opened them: tasks started and merged, workers
that got stuck and moved again, PRs moved, a limit reached, questions asked, the answers you and the controller gave,
and plan versions made. With model calls on, a cheap model puts it in two or three sentences (cached until something
new happens); without them, heed's own list of what happened is the text.
![Since you last looked](https://docs-v3-preview.elastic.dev/images/shots/goals/swarm-since.png)

## Not yet

- No hook reports "stuck", so Hunch learns working, waiting and done from your screen snapshots, and judges stuck from
  its checkpoint alone. Before it has learned from your snapshots, the checkpoint is rarely 50% sure of a pane, so
  heed's guess usually stands until it has.
- Codex and other agents report failures only as far as their tool output says so.