---
title: "herdr-jump: waiting agents, one key away"
canonical: "https://mrbogomips.github.io/herdr-tools/herdr-jump/"
author: "MrBogomips"
published: "2026-11-30T17:33:20.000Z"
modified: "2026-11-30T17:33:20.000Z"
lang: "en"
license: "CC-BY-4.0"
code-license: "MIT"
---

Companion for macOS · v0.13.0 · Hammerspoon · Herdr 0.9.5 or newer · any terminal · no plugin needed

Reach your Herdr agents from any macOS app with a single shortcut. One key brings back your
terminal, another takes you to the agent that needs you, and a menu bar icon counts how many are
waiting. All it needs is a running Herdr server: no plugin and nothing to configure inside Herdr.
Read [what the installer does](https://mrbogomips.github.io/herdr-tools/herdr-jump/#one-line-to-install-the-same-line-to-update), or start with the
[use cases](https://mrbogomips.github.io/herdr-tools/herdr-jump/#run-five-agents-serve-them-in-turn).

```sh
curl -fsSL https://raw.githubusercontent.com/MrBogomips/herdr-tools/main/herdr-jump/install.sh | sh
```

The agents picker: two blocked agents with orange pause icons at the top, with shortcuts ⌘1 and ⌘2, followed by two finished agents with green check marks, ⌘3 and ⌘4, each with an outlined bookmark after its title. Next is an idle agent with a pink bookmark, bookmarked since 16:19, then a working agent coordinating a release with an outlined bookmark and its three sub-sessions on compact indented lines below it: a finished one with ⌘5, an idle one with a yellow bookmark, and a working one. Below that is a working agent marked with a teal bookmark. A footer line explains the icons, the three bookmark colours, the active sort order and the arrow keys.

## Run five agents. Serve them in turn.

Multiple agents soon queue up for your attention: a permission prompt here, a finished review there.
herdr-jump lines them up first come, first served, shows how long each one has waited, and jumps to
its pane when you press Enter.

The menu bar icon turns solid and shows a count. Press ⌃⌥⌘A to open the picker with
that agent at the top; press Enter to jump to its pane, bringing the terminal window and tab to
the front.

The picker queues finished agents oldest first, showing how long each has waited ("done 25m ·
since 10:40"). Once you look at an agent, it drops out of the count.

Press Tab to sort newest first: blocked agents stay at the top, followed by the agent
that finished most recently. Press Tab again to sort by name. Your choice is remembered.

The other agents of a tab appear indented beneath its first one. Finished sub-sessions stay
quiet and out of the count; any sub-session waiting on a permission still alerts you.

Click an agent's bookmark, or press Space, to remember it: to review, to answer, to
close later. Click again for yellow, then teal, to tell your bookmarks apart. A bookmark never
changes the agent's status and stays until you clear it.

⌃⌥⌘I brings your terminal to the front, restoring the window you last used; press it
again from the terminal to switch back to the previous app.

## Two keys, from any app

| Key                                                    | What happens                                                                                                                                                                                                                  |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ⌃⌥⌘A                                                   | Opens the agents picker, ordered by urgency: blocked, done, unknown, idle, working, with the oldest change first within each status. Type to filter by title or folder, and press Enter to jump.                              |
| ⌘1…⌘9 in the picker                                    | Jumps to a waiting agent (blocked or done). Other agents have no shortcut, keeping these keys reserved for the ones that need you.                                                                                            |
| ⌃⌥⌘I                                                   | Activates the terminal running Herdr, preserving its focused pane. Pressed from the terminal, switches back to the previous app.                                                                                              |
| ⌥↑ ⌥↓ in the picker                                    | Moves across masters and agents without sub-sessions only; sub-sessions remain visible but are skipped.                                                                                                                       |
| ⇧↑ ⇧↓ in the picker                                    | Moves across waiting agents only (blocked or done), including sub-sessions and agents beyond the ninth.                                                                                                                       |
| Space (filter empty), ⌘R or the bookmark in the picker | Bookmarks any agent in pink, whatever its status, then cycles the bookmark through yellow and teal before clearing it. A bookmark never changes the status; while idle, a bookmarked agent ranks above the other idle agents. |
| Tab in the picker                                      | Cycles the sort order: FIFO (default), LIFO, then by name. Any filter text you typed is kept.                                                                                                                                 |

Both global shortcuts can be changed; see [Configure](https://mrbogomips.github.io/herdr-tools/herdr-jump/#configure).

## Whatever terminal runs Herdr

herdr-jump detects the terminal running the Herdr client automatically, walking up from the client
process to the app that launched it.

| Terminal                                           | What a jump brings forward                |
| -------------------------------------------------- | ----------------------------------------- |
| iTerm2                                             | The window, tab and session running Herdr |
| Terminal                                           | The window and tab running Herdr          |
| Ghostty, WezTerm, kitty, Alacritty, Warp, VS Code… | The app, showing its last-used window     |

Running Herdr inside tmux or over ssh hides the host terminal; in that case, the shortcuts bring
forward `terminalBundleID` (iTerm2 when installed, otherwise Terminal). **Diagnostics** in the menu
shows what was found and why.

## A glance instead of a switch

![The menu bar icon in three states: two outlined agents when nothing is waiting, two solid agents with a count when some are waiting, and outlined with a question mark when Herdr cannot be read](https://mrbogomips.github.io/herdr-tools/_astro/menubar.D5soNQgc_1fyViP.svg "Nothing waiting · two agents waiting · Herdr cannot be read.")

Click the menu bar icon to open the same agent list as a menu, along with **Sort by**, **Legend**
and **Diagnostics** (which displays the `herdr` binary, socket and terminal that herdr-jump found,
ready to copy).

![The menu bar drop-down showing fictional agents: two blocked, two done, and an idle agent bookmarked; a working agent coordinating a release with its three sub-sessions indented below it (including an idle one bookmarked); and another working agent still bookmarked. Each entry shows its status icon and wait time, and bookmarked agents end with bookmarked and their bookmark colour. At the bottom are the Sort by, Legend and Diagnostics submenus.](https://mrbogomips.github.io/herdr-tools/_astro/menu.CGpVFR8t_1JnNxK.png)

## Symbols

A filled icon means an agent is waiting for you; an outlined icon means it is not.

| Icon                   | Colour | Status                                           |
| ---------------------- | ------ | ------------------------------------------------ |
| Disc with pause bars   | Orange | `blocked`: waiting on a permission or a question |
| Disc with a check mark | Green  | `done`: finished, not seen yet                   |
| Ring with `?`          | Purple | `unknown`: listed, never counted                 |
| Empty ring             | Grey   | `idle`, or `done` and already seen               |
| Half-filled ring       | Blue   | `working`                                        |

Wait times appear as `12m`, `1h 5m` or `2d 3h`, alongside the start time for waiting agents
(`since 09:41`). The queue order comes from Herdr's own change counter, so it is exact.

## Sub-sessions

A declared parent comes first. A tool that starts an agent in a pane can name the agent's master by
writing a token on that pane with the master's pane id, as session-hub does for each child it starts
in Herdr:

```sh
herdr pane report-metadata <child pane> --source <tool> --token parent_pane=<master pane>
```

The agent then belongs to the agent whose pane the token names, wherever its own pane is; if that
agent is a sub-session itself, the child goes under its master, so nesting stays one level deep.
Herdr drops the tokens when its server restarts, together with the pane ids.

Without a declared parent, each tab is treated as a family. Its first unnamed agent, in pane layout order (top left first), is
the master, and every other agent in the tab is one of its sub-sessions, however its pane was opened:

- An agent started with `herdr agent start <name>`, as session-hub does, gets a Herdr name, while
  its master has none. A named agent is never a master, so a named helper in the first pane still
  belongs to the unnamed agent next to it.
- In a tab of named agents only (helpers in tabs of their own), each helper belongs to the only
  master in the same workspace whose folder contains the helper's folder; otherwise it stays at the
  top level.

| Context         | Behaviour                                                                           |
| --------------- | ----------------------------------------------------------------------------------- |
| Picker and menu | Listed directly under its master, indented (on a single compact line in the picker) |
| Master's row    | Shows `+4 sub`, followed by how many are blocked and done                           |
| `done`          | Quiet: listed, but not counted                                                      |
| `blocked`       | Counted, like any other agent                                                       |

## One line to install, the same line to update

Requirements: macOS, Herdr 0.9.5 or newer in a terminal, and Homebrew if
[Hammerspoon](https://www.hammerspoon.org) is not installed yet.

```sh
curl -fsSL https://raw.githubusercontent.com/MrBogomips/herdr-tools/main/herdr-jump/install.sh | sh
```

The script runs without prompts and prints each step:

- installs Hammerspoon via Homebrew if it is not already installed;
- downloads `HerdrJump.spoon` into Hammerspoon's `Spoons` folder (under `~/.hammerspoon`, or the
  folder set by `MJConfigFile`), replacing any previous copy;
- creates `init.lua` if none exists, or appends the HerdrJump configuration to your existing file
  using the `herdr` binary and Herdr socket from your shell;
- starts Hammerspoon, or reloads it if it is already running.

To inspect what herdr-jump needs and detects on your Mac without changing anything:

```sh
curl -fsSL https://raw.githubusercontent.com/MrBogomips/herdr-tools/main/herdr-jump/install.sh | sh -s -- --check
```

To inspect the script first, or to install from a specific branch or release tag:

```sh
curl -fsSL https://raw.githubusercontent.com/MrBogomips/herdr-tools/main/herdr-jump/install.sh -o install.sh
less install.sh
sh install.sh --ref <branch-or-tag>
```

:::note
macOS prompts for **Accessibility** permission for Hammerspoon (for global hotkeys) and, on the
first jump, **Automation: Hammerspoon → iTerm2** (or **→ Terminal**) so it can select the Herdr
tab.
:::

herdr-jump is standalone and requires only a running Herdr server: no Herdr plugin (from
herdr-tools or elsewhere) and no changes to your config, spaces or tabs. It queries the server
through the `herdr` command bundled with Herdr (`herdr agent list` and `herdr pane list`, followed
by `herdr agent focus` when you jump), so it works with any Herdr setup, with or without plugins.

Because it runs in Hammerspoon outside Herdr rather than as a Herdr plugin, it is not listed in the
plugin marketplace.

## Configure

Set these options in Hammerspoon's `init.lua` before calling `start()`:

```lua
hs.loadSpoon("HerdrJump")
spoon.HerdrJump.pollSeconds = 10
spoon.HerdrJump:bindHotkeys({
  terminal = { { "ctrl", "alt", "cmd" }, "t" },
  agents = { { "ctrl", "alt", "cmd" }, "space" },
})
spoon.HerdrJump:start()
```

| Setting            | Default                      | Meaning                                                                                                                                          |
| ------------------ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `herdrBin`         | auto-detected                | Path to the `herdr` binary. When unset, herdr-jump searches Homebrew, Herdr's installer (`~/.local/bin`), cargo, Nix, MacPorts and mise folders. |
| `socketPath`       | `~/.config/herdr/herdr.sock` | Path to the Herdr server socket (`herdr status server` prints yours).                                                                            |
| `terminalBundleID` | iTerm2, otherwise Terminal   | Terminal to bring forward when a Herdr client does not expose its own terminal.                                                                  |
| `pollSeconds`      | `5`                          | How often, in seconds, the agent list is read.                                                                                                   |
| `showMenubar`      | `true`                       | Whether to show the menu bar icon and waiting count.                                                                                             |
| `defaultOrder`     | `"fifo"`                     | Initial sort order (`"fifo"`, `"lifo"` or `"name"`) until you choose another.                                                                    |
| `groupChildren`    | `true`                       | Groups sub-sessions under their master; set to `false` for a flat list.                                                                          |

## Good to know

- Only agents running inside Herdr are listed; agents in plain terminal tabs or in tmux are not.
- If Herdr clients are running in several terminals, a jump brings forward the first one found.
- For terminals other than iTerm2 and Terminal, jumping brings the app to the front without
  selecting a specific tab.
- The menu bar count can lag by up to `pollSeconds`; the picker queries Herdr fresh whenever it
  opens.
- Two independent agents split side by side in one tab are listed as master and sub-session, and
  the second one is not counted when it is done; keep them in separate tabs to list them apart.

[Install](https://mrbogomips.github.io/herdr-tools/install/#herdr-jump) · [Full README on GitHub](https://github.com/MrBogomips/herdr-tools/tree/main/herdr-jump)
