A herdr plugin for people who run a crew of coding agents through firstmate: it turns firstmate's long replies into answerable cards, and teaches you herdr's shortcuts.
Talking to one agent that runs the crew is great, until the replies get long. You read half of one, start typing an answer, and lose track of what it actually asked. captain-cards splits the last reply into:
- TL;DR — what changed and what is needed, in two sentences.
- Decisions (
D1,D2…) — each with its options as keys (a,b…) or a free answer (w). - Run by you (
C1…) — commands only you can run (prod access, credentials).xopens a shell next to firstmate with the command typed, never run; reopen the cards after running it and its output is attached to your answer. Read-only commands are green, commands that change something are orange. - FYI — news, folded away.
Enter sends every answer back to firstmate as one message. Choices and drafts are saved, so closing the popup never loses anything.
The popup is keyboard first, and the mouse does the same things.
| Screen | Key | What |
|---|---|---|
| Decisions | 1 |
Every decision, with a ✓ once answered |
| Run | 2 |
Commands only you can run |
| FYI | 3 |
The news lines, in full |
| Full reply | 4 |
The whole reply, scrollable |
| Shortcuts | t |
The herdr shortcut trainer, then back to the cards |
- Nothing is cut. On a wide popup the left column lists every card with its full question, command and answer wrapped, and the selected card shows in full on the right. On a narrow popup the cards stack in one scrolling column. A scrollbar shows when there is more below.
- Keys:
tab/j/downnext card (decisions flow into run),shift+tab/k/upprevious,a-hpick,wwrite,x/Xsplit,ycopy,oattach output,pgup/pgdnscroll,?help,entersend,escclose. The footer always lists the keys of the screen you are on. - Mouse: click a card to select it, an option to answer (click again to undo), a tab to
switch screen,
x/y/o/wbuttons to act, and? help,⏎ send,esc closein the top bar. The wheel scrolls the pane under the pointer.
When firstmate settles, the event hook (it runs on pane.agent_status_changed) counts the
decisions and commands you have not answered yet and:
- shows a toast with the count and the first open question, with herdr's needs-attention sound;
- marks the firstmate pane durably through herdr's metadata API (
herdr pane report-metadata): its row in the agent sidebar readsclaude · 2 decisions · 1 command, its state label reads2 decisions · 1 command waiting, and a$waitingtoken is set on the pane and on its workspace. The mark is cleared as soon as you send your answers, or when the next reply asks nothing.
herdr has no native plugin badge, so these are the surfaces it offers plugins. The sidebar
name works with no config. To see the count in the tab bar of every tab, add this to
~/.config/herdr/config.toml:
[ui]
tab_bar_right = [
{ type = "command", command = "captain-cards status", interval_seconds = 5, timeout_seconds = 2 },
]captain-cards status prints firstmate waits: 2 decisions and nothing when nothing waits, so
the entry disappears once you answered. To show it on Space rows instead, add the $waiting
token to [ui.sidebar.spaces] rows (and [ui.sidebar.agents] for the agent rows). herdr-app
has no such surface, so there you only get the banner.
| Key | What |
|---|---|
prefix+m (herdr) / cmd+shift+m (herdr-app) |
Reply cards for firstmate's last reply |
prefix+t (herdr), or t inside the cards |
Shortcut trainer: cheat sheet of your herdr keys (defaults + your config.toml, with custom commands that shadow a default flagged), and a flashcard quiz that brings back the keys you miss |
It also shows one herdr tip a day, and a toast and a waiting mark when firstmate settles with a decision or a command for you.
Needs Go 1.24+ (the build runs go install, so ~/go/bin must be on PATH) and a firstmate
primary running on Claude Code.
herdr plugin install simlf/captain-cardsBind the keys in ~/.config/herdr/config.toml:
[[keys.command]]
key = "prefix+m"
type = "plugin_action"
command = "captain-cards.cards"
description = "firstmate reply cards"
[[keys.command]]
key = "prefix+t"
type = "plugin_action"
command = "captain-cards.keys"
description = "herdr shortcuts trainer"captain-cards also works inside herdr-app. Add to ~/.config/herdr-app/keys.json, under
global:
"cmd-shift-m": {"command": "pane.split", "args": {"direction": "down",
"argv": ["zsh", "-lc", "exec \"$HOME/go/bin/captain-cards\" cards"]}}Press it with the firstmate pane focused: the cards open below it, take the other terminal in
the tab as firstmate, and use that terminal's folder as the firstmate home. Answers go through
hc send; run cards open a shell in the same tab with the command typed.
Cards work on any reply (one card per paragraph), but they are much better when firstmate ends
its replies with a small block. Put docs/firstmate-rule.md in your
firstmate home as CLAUDE.local.md (Claude Code reads it next to firstmate's CLAUDE.md):
```captain-cards
tldr: eslint 9 done, ingress needs a pick
decide: ingress-plan | Caddy or Traefik? | Caddy ; Traefik | Traefik reads docker labels
run: api-worker | read | check the service is up | systemctl status api | grep active
fyi: web-cache | PR #41 merged
```
| Variable | Default |
|---|---|
CAPTAIN_CARDS_HOME |
~/code/firstmate on herdr; the captain terminal's folder on herdr-app |
CAPTAIN_CARDS_SESSION |
read this Claude Code session log instead of the captain's |
CAPTAIN_CARDS_STATE |
~/.local/state/captain-cards |
captain-cards show prints the parsed cards of the last reply; captain-cards status prints
what is waiting on you; captain-cards keys --list
prints the cheat sheet.
- pr-deck — the board of your open PRs, grouped by topic,
with eng → prod merge order. captain-cards answers firstmate; pr-deck shows what to merge and
when. Both run as herdr popups (
prefix+dfor pr-deck) and read the same Claude Code transcripts. Planned: a landing tab in the cards that takes pr-deck's ready-to-merge order, runs a PR'sVerify-after-merge:check after the merge and offers a rollback when it fails.
MIT