Shepi
Guide · Macros

Macros: one key, a whole sequence.

A macro types into the pane you're in, the way you would, and waits for each menu before the next step. Switch an agent's model, restart a dev server, run the same three commands: write it once, press one key from then on.

You don't have to write them: your agent can

Ask the agent in any pane, in your own words. It makes the macro, tests it and gives it a key, and it can change or remove any of your macros later.

Make a macro that switches you to Sonnet

Or: “Change my restart macro to clear the screen first”, “Give my test macro the key ⌥⌘T”, “Remove the macros I don't use”.

What a macro looks like

A macro is what you would do by hand, written down: one action per line, run from top to bottom. This one switches Claude Code to another model. Each line, and what it does:

type "/model"
Type /model
press enter
Press Return: the model menu opens
wait for "Select model"
Wait until the menu shows “Select model”
select "Sonnet"
Move to the row that says Sonnet, wherever it is in the list
press enter
Press Return to choose it
check "Set model to Sonnet"
Make sure it worked; if not, stop and say so

That's all a macro is. Shepi does each line in turn, in the pane you're in, as if you were typing.

Five are already there

A new Shepi comes with five macros for Claude Code, each on its own shortcut, so there is something to press before you have written anything. Each one changes it for that session only.

  • Effort — medium ⇧⌘M, high ⇧⌘H, xhigh ⇧⌘X
  • Model — Opus ⇧⌘O, Fable ⇧⌘F

They are yours from the moment you install Shepi: open one to read its steps, rewrite it, give it another key or no key at all, or delete it with its trash button in Settings › Macros. Changed or deleted, it stays that way.

Find things by their words, and make sure it worked

Programs change their menus in updates: a row moves, a new one appears. A macro that counts rows would then pick the wrong one. So a macro works the way you would: it looks before each key, finds a row by what it says, and checks the result.

  • After every key, the screen settles before the next step, so keys never land while a menu is still opening.
  • wait for and check only count text that appears after the step before. Words already on the screen, in an old message for example, never fool them.
  • select "Sonnet" moves the highlighted row to the one that says Sonnet, up or down, and presses nothing else.
  • check "…" makes sure the step before worked. If the text doesn't appear, the macro stops and says it didn't work, instead of carrying on.
  • on stop press esc closes what the macro opened if it stops for any reason, so nothing is left half done.
  • A choice with no words to find — a row of levels side by side, like Claude Code's effort picker — is counted to instead, and the line after it is always a check: if that picker has changed, the macro stops rather than setting a level you didn't ask for.
Look up

Running a macro

A macro types into the pane that is focused when it starts, on this Mac or another machine, and stays on that pane even if you move. It can run in a pane that isn't on screen, so your agent can try a macro beside you before you use it. While it runs, the status line says "Running …", anything you type still goes in as usual, and esc stops it. When it finishes, nothing is announced: the pane shows the result. It never types into a machine that is offline. Each macro has a short id beside its name in the editor, with Copy; an agent can run a macro by its id even when two share a name.

Keys and Only for

  • Keys: a shortcut with ⌘, or ⌃ with ⌥, like ⌥⌘1, pressed once from anywhere. Shepi offers a free one from the macro's name, and refuses a key that Herdr, Shepi or macOS already uses, or another macro has. If Herdr later starts using a macro's key, Herdr wins and the macro tells you to pick another.
  • Only for: limit a macro to one agent, like Claude Code, or to a plain shell. In other panes its key does nothing but say so.

When a macro stops

"… didn't appear"A wait for timed out: the menu took longer, or its text is different. Check the text by hand; add up to 10 s if it is just slow.
"… isn't in the list"A select found no row with those words: the program renamed it. Open the menu by hand and change the words.
"there's no list to choose from"A select found no highlighted row: the menu didn't open, or isn't open yet. Add a wait for before it.
"… so it didn't work"A check didn't see its text: the step before didn't do what it should. The macro stopped instead of carrying on.
"the shell didn't come back"A wait for the shell timed out: the program is still running, or asked something before quitting. Look at the pane; add up to 15 s if it is just slow to quit.
"stopped with Esc"You pressed esc. Nothing more was typed.
"isn't in a repository", "nothing is selected"A value the macro uses has nothing in this pane. Nothing was typed; run it where the value exists.
"… is offline"The machine is not connected; reconnect it from the sidebar.
"is for Claude Code"The macro is limited to another kind of pane (Only for).

Every stop names its step, and the editor keeps it under that line until a run gets past it. A line in red in the editor says what is wrong with it; nothing runs until every line is valid.

In Herdr's terminal UI too

If you also use Herdr's own terminal UI, Copy for Herdr's config in the editor's More section copies the macro as a Herdr custom command. Paste it into your Herdr config yourself; Shepi never edits that file.