@@ -10,12 +10,12 @@ existing tmux state so you can write better prompts and system instructions.
1010Every recipe uses the same structure:
1111
1212- ** Situation** -- the developer's world before the agent acts
13+ - ** Prompt** -- the natural-language sentence that triggers the recipe
1314- ** Discover** -- what the agent inspects and why
1415- ** Decide** -- the judgment call that changes the plan
1516- ** Act** -- the minimum safe action sequence
1617- ** The non-obvious part** -- the lesson you would miss from reading tool docs
1718 alone
18- - ** Prompt** -- a natural-language sentence that triggers this recipe
1919
2020---
2121
@@ -27,6 +27,12 @@ Every recipe uses the same structure:
2727Playwright e2e tests. The agent does not know which pane has the server,
2828or what port it chose.
2929
30+ ``` {admonition} Prompt
31+ :class: prompt
32+
33+ Run the Playwright tests against my dev server in the myapp session.
34+ ```
35+
3036### Discover
3137
3238``` {admonition} Agent reasoning
@@ -77,9 +83,6 @@ working directory. If the agent had used {toolref}`list-panes` to find a pane
7783running ` node ` , it would know a process exists but not whether it is ready or
7884what URL it chose.
7985
80- ** Prompt:** "Run the Playwright tests against my dev server in the myapp
81- session."
82-
8386---
8487
8588## Start a service and wait for it before running dependent work
@@ -88,6 +91,12 @@ session."
8891no server running yet. They want to run integration tests, but the test
8992suite needs a live API server.
9093
94+ ``` {admonition} Prompt
95+ :class: prompt
96+
97+ Start the API server in my backend session and run the integration tests once it's ready.
98+ ```
99+
91100### Discover
92101
93102``` {admonition} Agent reasoning
@@ -138,9 +147,6 @@ seconds or 20 -- the agent adapts. The anti-pattern is polling with repeated
138147handles the polling internally with configurable ` timeout ` (default 8s) and
139148` interval ` (default 50ms).
140149
141- ** Prompt:** "Start the API server in my backend session and run the
142- integration tests once it's ready."
143-
144150---
145151
146152## Find the failing pane without opening random terminals
@@ -149,6 +155,12 @@ integration tests once it's ready."
149155session -- linting, unit tests, integration tests, type checking. One of
150156them failed, but they stepped away and do not remember which pane.
151157
158+ ``` {admonition} Prompt
159+ :class: prompt
160+
161+ Check my ci session -- which jobs failed?
162+ ```
163+
152164### Discover
153165
154166``` {admonition} Agent reasoning
@@ -192,15 +204,35 @@ makes 20+ round trips for the same information. The `regex: true` parameter
192204is required here because the ` | ` in the pattern is a regex alternation, not
193205literal text.
194206
195- ** Prompt:** "Check my ci session -- which jobs failed?"
196-
197207---
198208
199209## Interrupt a stuck process and recover the pane
200210
201211** Situation.** A long-running build is hanging. The developer wants to
202212interrupt it, verify the pane is responsive, and re-run the command.
203213
214+ ``` {admonition} Prompt
215+ :class: prompt
216+
217+ The build in pane %2 is stuck. Kill it and restart.
218+ ```
219+
220+ Or with less specificity — the agent will discover the target:
221+
222+ ``` {admonition} Prompt
223+ :class: prompt
224+
225+ The build in one of my panes is stuck. Kill it and restart.
226+ ```
227+
228+ Or if you've built muscle memory in your chats:
229+
230+ ``` {admonition} Prompt
231+ :class: prompt
232+
233+ The build is stuck. Kill it and restart.
234+ ```
235+
204236### Discover
205237
206238``` {admonition} Agent reasoning
@@ -257,8 +289,6 @@ destroy. Skipping
257289straight to {toolref}` kill-pane ` loses the pane's scrollback history and any
258290partially written output that might explain * why* it hung.
259291
260- ** Prompt:** "The build in pane %2 is stuck. Kill it and restart."
261-
262292---
263293
264294## Re-run a command without mixing old and new output
@@ -267,6 +297,12 @@ partially written output that might explain *why* it hung.
267297candidate pane already has old test output in scrollback. They want only
268298fresh results.
269299
300+ ``` {admonition} Prompt
301+ :class: prompt
302+
303+ Run `pytest` in the test pane and show me only the fresh output.
304+ ```
305+
270306### Discover
271307
272308The agent calls {tooliconl}` list-panes ` to find the pane by title, cwd, or
@@ -299,9 +335,6 @@ partial state. The {toolref}`wait-for-text` call after {toolref}`send-keys`
299335naturally provides the needed delay, so the sequence clear-send-wait-capture
300336is safe.
301337
302- ** Prompt:** "Run ` pytest ` in the test pane and show me only the fresh
303- output."
304-
305338---
306339
307340## Build a workspace the agent can revisit later
@@ -310,6 +343,12 @@ output."
310343quick split, but a layout that later prompts can refer to by role ("the
311344server pane", "the test pane").
312345
346+ ``` {admonition} Prompt
347+ :class: prompt
348+
349+ Set up a tmux workspace for myproject with editor, server, and test panes.
350+ ```
351+
313352### Discover
314353
315354``` {admonition} Agent reasoning
@@ -361,9 +400,6 @@ figure out which one is which. But note: pane IDs are ephemeral across tmux
361400server restarts, so the agent should always re-discover by metadata (session
362401name, pane title, cwd) rather than trusting remembered ` %N ` values.
363402
364- ** Prompt:** "Set up a tmux workspace for myproject with editor, server, and
365- test panes."
366-
367403---
368404
369405## What to read next
0 commit comments