Sound packs for the moments that need you: a prompt sent, a permission prompt, a long job done, a subagent back, a failed test, a git push, a compaction. Packs…

A Claude Code mod that plays a short sound at the moments that need you, and at no other time: Claude asks for your OK, a long job finishes, a test fails, a push goes through. Pick a Terran SCV, a Protoss zealot, an Age of Empires monk or Turkish villager, a Kirov airship, a Diablo II necromancer, Duke Nukem, Pickle Rick, Caleb from Blood, or the NASA radio. Part of claude-plugins.
Watch the teaser with sound (28 seconds).
Watch it with sound (33 seconds, a famous line from a different pack at each moment: peon, terran, protoss, red-alert, rick-and-morty, duke, aoe).
| Moment | When |
|---|---|
ordered | You send a prompt (an order given); every prompt by default, /sounds rest adds a wait |
needsYou | Claude waits for you: a permission prompt, a question for you or a plan to approve |
longDone | A turn that took 60 seconds or more is answered |
subagentStart | A subagent starts (a villager is created, from the aoe pack, whatever your pack) |
subagent | A subagent finishes |
failed | A test, build, lint or type check fails (a step such as npm test, pytest, tsc or scripts/check-x.sh exits with an error; text inside a heredoc never counts) |
pushed | git push goes through |
compacted | The conversation is compacted |
mcp | An MCP tool runs, at most every 5 minutes. Off until you turn it on (/sounds mcp aoe fires a trebuchet) |
At most one sound every 2.5 seconds across all your terminals, so a handful of subagents finishing together give one sound, not a choir. The same clip never plays twice in a row for a moment. A pack may leave a moment silent.
Hear the packs (41 seconds).
| Pack | What it sounds like | Source |
|---|---|---|
aoe | "Wololo", the horn, the villager's "Yes", and the taunts: "Start the game already!", "What age are you in?", "You played two hours to die like this?" at a failed test, "Raiding party!" on a push | Age of Empires II, under Microsoft's Game Content Usage Rules |
aoe-turk | The Turks: the villager (male and female), "Allah Allah!" and swords on a push, the victory fanfare after a long job; "Emrin?" (your order?), "Tamam" (OK), "Hazir" (ready), "Saldir!" (attack!) on a push, the job names when a subagent returns | Age of Empires II, under Microsoft's Game Content Usage Rules, via the openpeon pack by Yusuf Kinatas |
terran (default) | "SCV good to go, sir", "You want a piece of me, boy?", "Nuclear launch detected", "In the pipe, five by five" | StarCraft, Blizzard Entertainment |
protoss | "En Taro Adun", "You must construct additional pylons", "My life for Aiur!", "Power overwhelming" | StarCraft, Blizzard Entertainment |
red-alert | "Kirov reporting", "For mother Russia", "Your mind is clear", "Kaboom" | Command & Conquer: Red Alert 2, Electronic Arts |
peon | "Work work", "Zug zug", "Something need doing?", "Me not that kind of orc" | Warcraft III: Reign of Chaos, Blizzard Entertainment |
necromancer | "Raise skeleton" when a subagent returns, "Not enough mana", "I can't carry any more" at compaction | Diablo II: Lord of Destruction, Blizzard Entertainment |
diablo | The level up chime, the quest done fanfare, gold dropping, a town portal opening, an item breaking | Diablo II: Lord of Destruction, Blizzard Entertainment |
rick-and-morty | "Wubba lubba dub dub", "Show me what you got!", "I'm Pickle Rick!" on a push, the butter robot's "What is my purpose?" when a subagent returns, "Oh jeeze" at a failed test | Rick and Morty, Warner Bros. Discovery (Adult Swim), via the family-friendly openpeon pack by Mr3zee |
rick-and-morty-uncut | The swearing lines: "You son of a bitch, I'm in!", "Oh fuck me!", "Everybody fuck off!" on a push. Explicit language, never the default | Rick and Morty, Warner Bros. Discovery (Adult Swim), via the mature openpeon pack by Mr3zee |
meeseeks | Mr. Meeseeks: "Can do!", "I'm Mr. Meeseeks, look at me!" when a subagent returns, "All done!", "I can't take it anymore!" at a failed test | Rick and Morty, Warner Bros. Discovery (Adult Swim), via the openpeon pack by kasperhendriks |
duke | "Come get some", "Hail to the king, baby", "Groovy", "Ooh, that's gotta hurt" | Duke Nukem 3D, Gearbox Software |
blood | Caleb: "Let's go", "I won", "Boomstick", "Pathetic", the laugh | Blood (Monolith Productions, 1997) |
lich | The Lich and Kel'Thuzad: "As the master commands", "Thy bidding, master?", "Kneel before my Frost Nova!" on a push, "The Scourge will consume all!" at compaction | Warcraft III, Blizzard Entertainment, via the openpeon pack |
cabal | CABAL, the Nod AI: "Establishing battlefield control", "Primary objective achieved", "Reinforcements have arrived" when a subagent returns, "Construct more power plants" at compaction | Command & Conquer: Tiberian Sun, Electronic Arts, via the openpeon pack |
yuri | "Your thoughts are mine", "I foresaw this need", "Another pawn joins us" when a subagent returns, "I did not foresee this" at a failed test | Red Alert 2: Yuri's Revenge, Electronic Arts, via the openpeon pack |
abathur | The Zerg evolution master, in his own long winded way: evolution done for a long job, a help call when Claude waits | StarCraft II, Blizzard Entertainment, via the openpeon pack |
tauren | "Peace and patience, friend", "Fate smiles upon you", "For the Horde!" on a push, "My inventory is full" at compaction | World of Warcraft, Blizzard Entertainment, via the openpeon pack |
engineer | "Teleporter comin' right up", "Done and done", "You just ain't doin' it right" at a failed test, "Yeehaw!" on a push | Team Fortress 2, Valve, via the openpeon pack |
counterstrike | The radio calls: "Roger that", "Need backup!", "Area clear!", "Enemy spotted!", "Lock and load!" on a push | Counter-Strike, Valve, via the openpeon pack |
stronghold | The AI lords, a different one each time: Richard's "The lion roars", the Rat's "Plans worked perfectly", the Abbot's "My troops fail me", the Sheriff's "Not Father Christmas" | Stronghold Crusader, FireFly Studios, via the openpeon packs of the lords (for example the Abbot) |
sheogorath | The Prince of Madness: "Good choice", "I've been waiting for you", "Cheese for everyone", "Boring, boring, boring" at a failed test | The Elder Scrolls IV: Oblivion, Bethesda (ZeniMax), via the openpeon pack |
lebowski | The clean lines: "The Dude abides", "Phone's ringing, Dude", "That rug really tied the room together", "Over the line!", "Mark it zero!" | The Big Lebowski (1998), Universal Pictures, via the openpeon pack |
nasa | "The Eagle has landed", "And the liftoff!", "Okay Houston, we have had a problem here", a Quindar beep | NASA recordings on Wikimedia Commons, public domain |
air-traffic | Tower radio calls: "Taxi in position and hold" or "Contact tower" when a prompt is sent, "Hold short of runway one for me" when Claude needs you, "You are cleared to land" after a long job, "What's that?" at a failed test, "Cleared for takeoff" on a push | X-Plane 5 (Laminar Research) and stock ATC radio clips on 101soundboards |
Each pack's folder under sounds/ has a CREDITS.md with the source of every clip and who holds its rights. The game clips are the original files as shared on 101soundboards and in openpeon packs, unchanged except that WAV and Ogg originals are stored as M4A (smaller, and macOS afplay stops Ogg clips after about a second), and the short intro 101soundboards puts before some clips is cut where the site's own player skips it. They belong to their publishers: this plugin is free fan use, not licensed, not endorsed by any of them, and never sold. If you hold the rights to a pack and want it gone, open an issue and it goes. The game and show logos in the banner and films are trademarks of their owners, shown only to name the pack's source, on the same terms.
| Command | Effect |
|---|---|
/sounds | This terminal's pack, this project's pack, the default for new terminals and the settings, then what every moment plays, every command, and every pack at the bottom |
/sounds <pack> | Switch this terminal only |
/sounds default <pack> | Every terminal plays this pack: the open ones (in both accounts) from their next sound, and every new one. Project packs stay, and a terminal's own /sounds <pack> afterwards still wins there |
/sounds project <pack> | Every terminal in this folder, or a folder inside it, plays this pack, now and in every later session, in both accounts. One pack per project tells you by ear which one needs you |
/sounds project off, /sounds project | Take this folder's pack back, or see this project's pack and every project pack |
/sounds project clear | Remove every project pack at once; the answer lists what it removed |
/sounds <moment> <pack> | One moment plays another pack's clips, e.g. /sounds pushed aoe-turk: each push plays one of that pack's push clips |
/sounds <moment> <pack> <clip> | Always the same clip, e.g. /sounds pushed aoe-turk allah-allah |
/sounds <moment> <pack> <pack> | Mix two or more packs' clips for that moment |
/sounds <moment> random | Each time a clip from any pack |
/sounds <moment> off, /sounds <moment> reset | Silence one moment, or give it back to the terminal's pack |
/sounds <moment> | What that moment plays now and the names of its clips |
/sounds test [pack] [moment] | Play every sound of a pack once, or only one moment of it (/sounds test aoe-turk pushed), whatever the settings |
/sounds off, /sounds on | Mute or unmute every terminal at once, open or new, in both accounts (Terminal, VS Code, any profile) |
/sounds away, /sounds always | Play only while no terminal or editor is the front app, or always (the default). The prompt answer still plays in away mode: you are at the keyboard |
/sounds night off, /sounds night on | Quiet hours: no clips from 23:00 to 07:00. Off by default |
/sounds rest <minutes> | How long after this terminal's last prompt sound the next prompt plays one; 0 (the default) plays every prompt |
Every change answers with one line saying what changed, and a mistyped pack or clip name gets the one it meant ("Did you mean aoe-turk?"). Moment names are typed in lowercase (/sounds needsyou); /sounds lists them, and a short word like push, fail or done gets the moment it means.
Install asks nothing. The first session shows one notice naming the pack and /sounds. Settings, moment rules included, are kept in the plugin's store, per Claude Code config directory.
A folder under ~/.config/findmutlu-sounds/packs/<name>/ (lowercase letters, digits and dashes) with your clips and a pack.json is a pack. It loads when a session starts and then works like the others (/sounds <name>, /sounds default <name>):
{
"label": "My office",
"ordered": ["yes-boss.m4a"],
"needsYou": ["knock.wav"],
"longDone": ["applause.mp3"],
"subagent": [],
"failed": ["sigh.wav"],
"pushed": ["cheer.m4a"],
"compacted": []
}
WAV, MP3, M4A and AIFF play. A built-in pack's name always means the built-in pack. Your clips stay on your machine: nothing is uploaded.
To add a pack to this plugin for everyone: a folder under sounds/ with the clips, a pack.json like the one above and a CREDITS.md naming the source and rights holder of every clip, then python3 scripts/packs.py, which writes the table in hooks/register.js (CI checks it is up to date).
lsappinfo, no permission needed).afplay underneath), never waiting for it, so nothing slows down. Answers its own /sounds command and no other. Writes four files in ~/.config/findmutlu-sounds/: last-played (the time of the last sound), so your terminals take turns instead of talking over each other, all-terminals.json (the pack and time of the last /sounds default), sound.json (whether sound is on, set by /sounds on and /sounds off) and projects.json (each project folder you gave a pack, and the pack). Every terminal reads them before a sound, and asks Claude Code which folder it runs in.tool.call (Bash, AskUserQuestion, ExitPlanMode) plays a sound and passes the call on; it never changes or blocks a call. prompt.submit, turn.complete and the notification, subagent and compaction events pass through unchanged.Needs Claude Code 2.1.287 or later (mods) on macOS. Tested on 2.1.294.
/plugin marketplace add mutlumehmet/claude-plugins
/plugin install findmutlu-sounds@mehmetmutlu
A mod runs inside Claude Code with your permissions. Read the code before you install any mod.
afplay. On Linux and Windows the mod loads and stays silent.failed knows check steps by name (npm, pnpm, yarn, make, cargo or go with test, build, lint, typecheck or check; pytest, jest, vitest, tsc, playwright, eslint; scripts named check-, test- or lint-), so a failing script with another name stays silent./sounds <pack>) resets when the plugin reloads; the default does not.Made by Mehmet Mutlu, part of claude-plugins. More of his work at mehmetmutlu.dev.
Code: MIT. Sounds: not covered by the MIT license. NASA clips are public domain; the game clips belong to their publishers, as each sounds/<pack>/CREDITS.md says.
hooks/register.js 1700 lines1// Sound packs for the moments that need you, and no others.
2//
3// moment when event
4// ordered you sent a prompt (after /sounds rest minutes) prompt.submit
5// needsYou Claude waits for you: a permission prompt, classic.Notification,
6// a question, a plan to approve tool.call (AskUserQuestion, ExitPlanMode)
7// longDone a turn of 60 s or more answered turn.complete (main loop)
8// subagentStart a subagent started agent.spawn
9// subagent a subagent finished its turn.complete
10// failed a test, build, lint or type check failed tool.call (Bash, isError; the step run, not heredoc text)
11// pushed git push went through tool.call (Bash)
12// compacted the conversation was compacted classic.PostCompact
13// mcp an MCP tool ran (off unless you turn it on) tool.call (mcp__*, rests 5 minutes)
14//
15// Each moment plays the terminal's pack unless /sounds <moment> gave it its own rule: other packs,
16// one clip, random or off (kept in the plugin store as settings.moments)
17//
18// Three kinds of pack:
19// file packs clips in ../sounds/<pack>/ (source and rights holder in each CREDITS.md)
20// voice packs lines the system voice speaks ($.audio.speak), so no audio file ships (none yet)
21// your packs folders under ~/.config/<this plugin's name>/packs/<pack>/ with a pack.json,
22// read at session start and played from their bytes
23//
24// Which pack plays: this terminal's (/sounds <pack>), else your default (/sounds default <pack>,
25// kept in the plugin store), else DEFAULT_PACK.
26
27const DEFAULT_PACK = 'terran'
28const LONG_TURN_MS = 60000
29const QUIET_FROM = 23
30const QUIET_TO = 7
31// One sound at a time: several subagents finishing together give one clip, not ten. The last
32// play time is shared by every terminal through a small file beside your packs folder
33const GAP_MS = 2500
34// Every prompt plays by default; /sounds rest <minutes> makes a prompt wait that long after this
35// terminal's last prompt clip, so typing away is not a clip every message
36const ORDERED_REST_MIN = 0
37const MAX_REST_MIN = 120
38
39// Front apps that mean you are already looking at Claude Code (away mode)
40const HERE_APPS = ['Terminal', 'iTerm2', 'Code', 'Visual Studio Code', 'Cursor', 'Ghostty', 'Warp', 'Claude']
41
42// Notification types that are only information, not a wait on you
43const QUIET_NOTIFICATIONS = ['idle_prompt', 'auth_success']
44
45// Checked against each step a command runs (heredoc bodies dropped), never against file text
46const CHECK_TOOL = /^(pytest|jest|vitest|tsc|playwright|eslint|mypy|ruff|shellcheck|biome)$/
47const CHECK_WORD = /^(test|tests|build|lint|typecheck|type-check|check|validate)(:.*)?$/
48const CHECK_RUNNER = /^(npm|pnpm|yarn|bun|npx|bunx|make|cargo|go|deno|gradle|mvn|swift|turbo|nx)$/
49const CHECK_SCRIPT = /(^|\/)(check|test|lint)[\w.-]*\.(sh|py|js|ts|mjs)$/
50const PUSH_COMMAND = /\bgit\s+push\b/
51// Tools that stop and wait for your answer
52const ASKING_TOOLS = ['AskUserQuestion', 'ExitPlanMode']
53
54const MOMENTS = ['ordered', 'needsYou', 'longDone', 'subagentStart', 'subagent', 'failed', 'pushed', 'compacted', 'mcp']
55
56// What each moment means, for /sounds and its replies
57const MOMENT_INFO = {
58 ordered: 'you send a prompt',
59 needsYou: 'Claude waits for your OK or answer',
60 longDone: 'a turn of 60 s or more finishes',
61 subagentStart: 'a subagent starts',
62 subagent: 'a subagent finishes',
63 failed: 'a test, build or lint fails',
64 pushed: 'git push goes through',
65 compacted: 'the conversation is compacted',
66 mcp: 'an MCP tool runs (at most every 5 minutes)',
67}
68
69// Moments few packs carry start with a rule of their own: a villager is made when a subagent
70// starts; the MCP trebuchet is off until you turn it on (MCP tools run often)
71const DEFAULT_MOMENTS = { subagentStart: { packs: ['aoe'] }, mcp: { off: true } }
72
73// Moment names are typed in lowercase (/sounds needsyou)
74const MOMENT_BY_WORD = Object.fromEntries(MOMENTS.map((m) => [m.toLowerCase(), m]))
75
76// Words people reach for first, mapped to the moment they mean
77const MOMENT_ALIASES = {
78 push: 'pushed', fail: 'failed', fails: 'failed', error: 'failed', done: 'longDone', long: 'longDone',
79 start: 'subagentStart', spawn: 'subagentStart', agent: 'subagent', compact: 'compacted',
80 prompt: 'ordered', order: 'ordered', wait: 'needsYou', ask: 'needsYou', permission: 'needsYou',
81}
82const MCP_REST_MS = 5 * 60000
83
84// FILE_PACKS_START (generated from sounds/*/pack.json by scripts/packs.py; edit those, not this)
85const FILE_PACKS = {
86 "abathur": {
87 "label": "StarCraft II: Abathur, the Zerg evolution master (fan use)",
88 "ordered": [
89 "thanks-00.m4a",
90 "thanks-01.m4a"
91 ],
92 "needsYou": [
93 "idle.m4a",
94 "help-me.m4a"
95 ],
96 "longDone": [
97 "evolution-00.m4a",
98 "evolution-01.m4a"
99 ],
100 "subagentStart": [],
101 "subagent": [
102 "brutalisk.m4a",
103 "thanks-02.m4a"
104 ],
105 "failed": [
106 "units-lost.m4a"
107 ],
108 "pushed": [
109 "positive.m4a",
110 "generic.m4a"
111 ],
112 "compacted": [
113 "brutalisk-reminder.m4a"
114 ],
115 "mcp": []
116 },
117 "air-traffic": {
118 "label": "Air traffic control radio: cleared for takeoff, hold short, cleared to land",
119 "ordered": [
120 "taxi-into-position.m4a",
121 "contact-tower.m4a",
122 "descend-maintain.m4a",
123 "turn-left-130.m4a",
124 "intercept-localizer.m4a",
125 "three-mile-final.m4a",
126 "clear-for-departure.m4a"
127 ],
128 "needsYou": [
129 "hold-short.m4a",
130 "new-york-approach.m4a"
131 ],
132 "longDone": [
133 "clear-for-landing.m4a",
134 "cleared-to-land.m4a"
135 ],
136 "subagentStart": [],
137 "subagent": [
138 "leveling-190.m4a",
139 "safe-departure.m4a"
140 ],
141 "failed": [
142 "whats-that.m4a"
143 ],
144 "pushed": [
145 "clear-for-takeoff.m4a"
146 ],
147 "compacted": [
148 "maintain-altitude.m4a"
149 ],
150 "mcp": []
151 },
152 "aoe": {
153 "label": "Age of Empires II: wololo, the horn and the taunts (Microsoft Game Content Usage Rules)",
154 "ordered": [
155 "yes.mp3",
156 "start-the-game-already.mp3",
157 "roggan.mp3"
158 ],
159 "needsYou": [
160 "conversion-warning.mp3",
161 "what-age-are-you-in.mp3",
162 "wait-for-my-signal.mp3"
163 ],
164 "longDone": [
165 "drum-fanfare.mp3",
166 "long-time-no-siege.mp3",
167 "good-to-be-the-king.mp3",
168 "nice-town.mp3"
169 ],
170 "subagentStart": [
171 "villager-created.mp3",
172 "military-created.mp3"
173 ],
174 "subagent": [
175 "horn.mp3",
176 "sssh-ho.mp3",
177 "oooh.mp3"
178 ],
179 "failed": [
180 "herb-laugh.mp3",
181 "no.mp3",
182 "two-hours-to-die.mp3",
183 "the-wonder-no.mp3",
184 "being-rushed.mp3"
185 ],
186 "pushed": [
187 "viking-horn.mp3",
188 "converted.mp3",
189 "raiding-party.mp3"
190 ],
191 "compacted": [
192 "wololo.mp3",
193 "give-me-your-extra-resources.mp3"
194 ],
195 "mcp": [
196 "trebuchet-fire.mp3",
197 "mangonel-fire.mp3"
198 ]
199 },
200 "aoe-turk": {
201 "label": "Age of Empires II: the Turks, villagers male and female, the war cry, swords and fanfares (Microsoft Game Content Usage Rules)",
202 "ordered": [
203 "tamam.m4a",
204 "tamam-f.m4a",
205 "evet.m4a",
206 "evet-f.m4a",
207 "dogru.m4a",
208 "dogru-f.m4a",
209 "yapacagim.m4a",
210 "yapacagim-f.m4a"
211 ],
212 "needsYou": [
213 "efendim.m4a",
214 "efendim-f.m4a",
215 "emrin.m4a",
216 "emrin-f.m4a",
217 "evet-question.m4a",
218 "evet-question-f.m4a"
219 ],
220 "longDone": [
221 "hazir.m4a",
222 "hazir-f.m4a",
223 "victory.mp3",
224 "wonder.mp3"
225 ],
226 "subagentStart": [],
227 "subagent": [
228 "oduncu.m4a",
229 "oduncu-f.m4a",
230 "ciftci.m4a",
231 "ciftci-f.m4a",
232 "madenci.m4a",
233 "madenci-f.m4a",
234 "balikci.m4a",
235 "balikci-f.m4a",
236 "avci.m4a",
237 "avci-f.m4a",
238 "seyis.m4a",
239 "seyis-f.m4a"
240 ],
241 "failed": [
242 "villager-death.m4a",
243 "villager-death-f.m4a",
244 "tamirci.m4a",
245 "tamirci-f.m4a",
246 "sword-hit.mp3"
247 ],
248 "pushed": [
249 "saldir.m4a",
250 "saldir-f.m4a",
251 "allah-allah.mp3",
252 "ileri.mp3",
253 "sword-clash.mp3"
254 ],
255 "compacted": [
256 "usta.m4a",
257 "usta-f.m4a",
258 "castle.mp3"
259 ],
260 "mcp": []
261 },
262 "blood": {
263 "label": "Blood: Caleb laughs, quotes and boomsticks (fan use)",
264 "ordered": [
265 "lets-go.mp3",
266 "alright.mp3"
267 ],
268 "needsYou": [
269 "come-out.mp3",
270 "play-with-me.mp3"
271 ],
272 "longDone": [
273 "i-won.mp3",
274 "did-it.mp3"
275 ],
276 "subagentStart": [],
277 "subagent": [
278 "laughing.mp3",
279 "yeah.mp3"
280 ],
281 "failed": [
282 "all-dead.mp3",
283 "rip.mp3",
284 "pathetic.mp3"
285 ],
286 "pushed": [
287 "boomstick.mp3",
288 "napalm.mp3"
289 ],
290 "compacted": [
291 "live-again.mp3",
292 "nevermore.mp3"
293 ],
294 "mcp": []
295 },
296 "cabal": {
297 "label": "Tiberian Sun: CABAL, the Nod AI (fan use)",
298 "ordered": [
299 "establishing-battlefield-control.m4a",
300 "building.m4a",
301 "please-stand-by.m4a"
302 ],
303 "needsYou": [
304 "incoming-transmission.m4a",
305 "select-target.m4a",
306 "new-construction-options.m4a"
307 ],
308 "longDone": [
309 "primary-objective-achieved.m4a",
310 "mission-accomplished.m4a"
311 ],
312 "subagentStart": [],
313 "subagent": [
314 "reinforcements-have-arrived.m4a",
315 "objective-complete.m4a"
316 ],
317 "failed": [
318 "base-perimeter-breached.m4a",
319 "critical-unit-lost.m4a",
320 "you-make-this-easy.m4a"
321 ],
322 "pushed": [
323 "congratulations-on-your-success.m4a",
324 "prepare-for-decimation.m4a"
325 ],
326 "compacted": [
327 "construct-more-power-plants.m4a",
328 "low-power.m4a",
329 "silos-needed.m4a"
330 ],
331 "mcp": []
332 },
333 "counterstrike": {
334 "label": "Counter-Strike: the radio calls (fan use)",
335 "ordered": [
336 "lets-go.m4a",
337 "roger-that.m4a",
338 "affirmative.m4a"
339 ],
340 "needsYou": [
341 "need-backup.m4a",
342 "report-in.m4a"
343 ],
344 "longDone": [
345 "area-clear.m4a"
346 ],
347 "subagentStart": [],
348 "subagent": [
349 "moving-out.m4a",
350 "you-take-the-point.m4a"
351 ],
352 "failed": [
353 "negative.m4a",
354 "enemy-spotted.m4a"
355 ],
356 "pushed": [
357 "lock-and-load.m4a"
358 ],
359 "compacted": [
360 "fall-back.m4a",
361 "stick-together.m4a",
362 "hold-your-position.m4a"
363 ],
364 "mcp": []
365 },
366 "diablo": {
367 "label": "Diablo II effects: level up, quest done, gold, a portal opens (Blizzard, fan use)",
368 "ordered": [
369 "potion-drink.mp3",
370 "select.mp3"
371 ],
372 "needsYou": [
373 "hostile.mp3",
374 "waypoint.mp3"
375 ],
376 "longDone": [
377 "level-up.mp3",
378 "quest-done.mp3"
379 ],
380 "subagentStart": [],
381 "subagent": [
382 "gold.mp3",
383 "rune.mp3"
384 ],
385 "failed": [
386 "item-broken.mp3",
387 "glass-break.mp3"
388 ],
389 "pushed": [
390 "portal-open.mp3",
391 "cairn-success.mp3"
392 ],
393 "compacted": [
394 "identify.mp3",
395 "scroll.mp3"
396 ],
397 "mcp": []
398 },
399 "duke": {
400 "label": "Duke Nukem 3D: come get some, hail to the king, baby (fan use)",
401 "ordered": [
402 "come-get-some.mp3",
403 "im-going-in.mp3"
404 ],
405 "needsYou": [
406 "waiting-for-christmas.mp3",
407 "you-wanna-dance.mp3"
408 ],
409 "longDone": [
410 "damn-im-good.mp3",
411 "piece-of-cake.mp3"
412 ],
413 "subagentStart": [],
414 "subagent": [
415 "groovy.mp3",
416 "back-to-work.mp3"
417 ],
418 "failed": [
419 "game-over.mp3",
420 "this-sucks.mp3",
421 "gotta-hurt.mp3"
422 ],
423 "pushed": [
424 "hail-to-the-king.mp3",
425 "bubble-gum.mp3"
426 ],
427 "compacted": [
428 "much-better.mp3",
429 "needed-that.mp3"
430 ],
431 "mcp": []
432 },
433 "engineer": {
434 "label": "Team Fortress 2: the Engineer (fan use)",
435 "ordered": [
436 "teleporter-comin-right-up.mp3",
437 "buildin-a-sentry.mp3",
438 "lets-do-this-texas-style.mp3"
439 ],
440 "needsYou": [
441 "not-on-auto-pilot.mp3",
442 "help-me.mp3"
443 ],
444 "longDone": [
445 "done-and-done.mp3",
446 "knife-fight-in-a-phonebooth.mp3"
447 ],
448 "subagentStart": [],
449 "subagent": [
450 "another-satisfied-customer.mp3",
451 "nice-work.mp3"
452 ],
453 "failed": [
454 "you-just-aint-doin-it-right.mp3",
455 "sentry-down.mp3",
456 "told-ya-dont-touch.mp3"
457 ],
458 "pushed": [
459 "yeehaw.mp3",
460 "move-em-out.mp3"
461 ],
462 "compacted": [
463 "good-night-irene.mp3",
464 "now-ive-seen-everything.mp3"
465 ],
466 "mcp": []
467 },
468 "lebowski": {
469 "label": "The Big Lebowski: the Dude, Walter, Donny and friends, clean lines (fan use)",
470 "ordered": [
471 "the-dude-abides.mp3",
472 "far-out.mp3",
473 "no-problemo.mp3"
474 ],
475 "needsYou": [
476 "phones-ringing-dude.mp3",
477 "whats-your-point.mp3",
478 "certain-things-have-come-to-light.mp3"
479 ],
480 "longDone": [
481 "rug-tied-the-room-together.mp3",
482 "goodnight-sweet-prince.mp3"
483 ],
484 "subagentStart": [],
485 "subagent": [
486 "i-like-your-style.mp3",
487 "ive-got-information.mp3"
488 ],
489 "failed": [
490 "over-the-line.mp3",
491 "mark-it-zero.mp3",
492 "world-of-pain.mp3",
493 "this-aggression-will-not-stand.mp3"
494 ],
495 "pushed": [
496 "way-to-go-donny.mp3",
497 "wave-of-the-future.mp3"
498 ],
499 "compacted": [
500 "just-take-it-easy.mp3",
501 "strikes-and-gutters.mp3"
502 ],
503 "mcp": []
504 },
505 "lich": {
506 "label": "Warcraft III: the Lich and Kel'Thuzad (fan use)",
507 "ordered": [
508 "as-the-master-commands.m4a",
509 "i-shall-obey.m4a",
510 "direct-my-hatred.m4a"
511 ],
512 "needsYou": [
513 "thy-bidding-master.m4a",
514 "what-is-thy-will.m4a",
515 "i-await-your-command.m4a"
516 ],
517 "longDone": [
518 "thy-will-be-done.m4a",
519 "the-ancient-evil-survives.m4a"
520 ],
521 "subagentStart": [],
522 "subagent": [
523 "for-the-lich-king.m4a",
524 "it-is-destined.m4a"
525 ],
526 "failed": [
527 "aaugh.m4a",
528 "do-not-try-my-patience.m4a"
529 ],
530 "pushed": [
531 "kneel-before-my-frost-nova.m4a",
532 "dread-lord-not-drug-lord.m4a"
533 ],
534 "compacted": [
535 "the-scourge-will-consume-all.m4a",
536 "bone-to-pick.m4a"
537 ],
538 "mcp": []
539 },
540 "meeseeks": {
541 "label": "Rick and Morty: Mr. Meeseeks, look at me! (fan use)",
542 "ordered": [
543 "can-do.mp3",
544 "can-do-2.mp3",
545 "ooh-okay.mp3",
546 "okay.mp3"
547 ],
548 "needsYou": [
549 "what-do-you-got.mp3",
550 "excuse-me.mp3",
551 "back-to-the-task.mp3"
552 ],
553 "longDone": [
554 "all-done.mp3",
555 "exist-this-long.mp3"
556 ],
557 "subagentStart": [],
558 "subagent": [
559 "im-mr-meeseeks.mp3",
560 "look-at-me.mp3",
561 "fulfill-my-purpose.mp3",
562 "yes-sirree.mp3"
563 ],
564 "failed": [
565 "cant-take-it.mp3",
566 "frustrating.mp3",
567 "doesnt-work-like-that.mp3"
568 ],
569 "pushed": [
570 "ooh-yeah.mp3",
571 "yes-maam.mp3"
572 ],
573 "compacted": [
574 "gotta-relax.mp3",
575 "let-me-try.mp3"
576 ],
577 "mcp": []
578 },
579 "nasa": {
580 "label": "NASA radio: the Eagle has landed, liftoff, we have had a problem (public domain)",
581 "ordered": [
582 "roger-roll.m4a",
583 "quindar-beep.m4a"
584 ],
585 "needsYou": [
586 "houston-discovery.m4a",
587 "how-do-you-read.m4a"
588 ],
589 "longDone": [
590 "eagle-landed.m4a",
591 "wheels-stop.m4a"
592 ],
593 "subagentStart": [],
594 "subagent": [
595 "go-for-deploy.m4a",
596 "go-at-throttle-up.m4a"
597 ],
598 "failed": [
599 "weve-had-a-problem.m4a"
600 ],
601 "pushed": [
602 "liftoff.m4a",
603 "liftoff-41d.m4a"
604 ],
605 "compacted": [
606 "vector-transfer.m4a"
607 ],
608 "mcp": []
609 },
610 "necromancer": {
611 "label": "Diablo II Necromancer: raise skeleton, not enough mana, I cannot carry any more (Blizzard, fan use)",
612 "ordered": [
613 "ok.mp3",
614 "yes.mp3",
615 "lets-go.mp3"
616 ],
617 "needsYou": [
618 "need-help.mp3",
619 "yes-question.mp3",
620 "what-else.mp3"
621 ],
622 "longDone": [
623 "diablo-killed.mp3",
624 "baal-defeated.mp3",
625 "andariel-done.mp3"
626 ],
627 "subagentStart": [],
628 "subagent": [
629 "raise-skeleton.mp3",
630 "golem.mp3",
631 "revive.mp3"
632 ],
633 "failed": [
634 "i-cant.mp3",
635 "oops.mp3",
636 "not-enough-mana.mp3"
637 ],
638 "pushed": [
639 "time-to-die.mp3",
640 "meet-your-fate.mp3",
641 "corpse-explosion.mp3"
642 ],
643 "compacted": [
644 "cant-carry.mp3",
645 "need-mana.mp3"
646 ],
647 "mcp": []
648 },
649 "peon": {
650 "label": "Warcraft III peon: work work, zug zug, something need doing? (Blizzard, fan use)",
651 "ordered": [
652 "work-work.mp3",
653 "okey-dokey.mp3",
654 "i-can-do-that.mp3",
655 "be-happy-to.mp3"
656 ],
657 "needsYou": [
658 "something-need-doing.mp3",
659 "ready-to-work.mp3",
660 "what-do-you-want.mp3"
661 ],
662 "longDone": [
663 "zug-zug.mp3"
664 ],
665 "subagentStart": [],
666 "subagent": [
667 "me-busy.mp3",
668 "yes.mp3",
669 "ok.mp3"
670 ],
671 "failed": [
672 "splat.mp3",
673 "tummy-feels-funny.mp3",
674 "not-that-kind-of-orc.mp3"
675 ],
676 "pushed": [
677 "kill-them.mp3",
678 "why-not.mp3"
679 ],
680 "compacted": [
681 "leave-me-alone.mp3",
682 "no-time-for-play.mp3"
683 ],
684 "mcp": []
685 },
686 "protoss": {
687 "label": "StarCraft Protoss: construct additional pylons, my life for Aiur (Blizzard, fan use)",
688 "ordered": [
689 "adun-toridas.mp3"
690 ],
691 "needsYou": [
692 "transmission.mp3"
693 ],
694 "longDone": [
695 "upgrade-complete.mp3",
696 "research.mp3"
697 ],
698 "subagentStart": [],
699 "subagent": [
700 "upgrade.mp3",
701 "systems-functional.mp3"
702 ],
703 "failed": [
704 "pylons.mp3",
705 "pylons-2.mp3"
706 ],
707 "pushed": [
708 "life-for-aiur.mp3",
709 "power-overwhelming.mp3"
710 ],
711 "compacted": [
712 "vespene-gas.mp3"
713 ],
714 "mcp": []
715 },
716 "red-alert": {
717 "label": "Red Alert 2: Kirov reporting, for mother Russia (EA, fan use)",
718 "ordered": [
719 "acknowledged.mp3",
720 "yes-commander.mp3",
721 "can-do.mp3"
722 ],
723 "needsYou": [
724 "commander.mp3",
725 "give-me-a-job.mp3",
726 "anytime-boss.mp3"
727 ],
728 "longDone": [
729 "kirov-reporting.mp3",
730 "cha-ching.mp3"
731 ],
732 "subagentStart": [],
733 "subagent": [
734 "unit-reporting.mp3",
735 "agent-ready.mp3"
736 ],
737 "failed": [
738 "mommy.mp3",
739 "bail-out.mp3"
740 ],
741 "pushed": [
742 "kaboom.mp3",
743 "for-mother-russia.mp3"
744 ],
745 "compacted": [
746 "your-mind-is-clear.mp3",
747 "deconstructing.mp3"
748 ],
749 "mcp": []
750 },
751 "rick-and-morty": {
752 "label": "Rick and Morty: family-friendly lines from Rick and the crew (fan use)",
753 "ordered": [
754 "wubba-lubba-dub-dub.mp3",
755 "here-we-go.mp3",
756 "time-for-action.mp3",
757 "twenty-minute-adventure.mp3"
758 ],
759 "needsYou": [
760 "show-me-what-you-got.mp3",
761 "yes-or-no.mp3",
762 "hey-morty.mp3"
763 ],
764 "longDone": [
765 "pickle-rick.mp3",
766 "pure-luck.mp3"
767 ],
768 "subagentStart": [],
769 "subagent": [
770 "what-is-my-purpose.mp3",
771 "everything-you-want.mp3",
772 "oh-yeah.mp3"
773 ],
774 "failed": [
775 "oh-jeeze.mp3",
776 "oh-man.mp3",
777 "not-in-control.mp3"
778 ],
779 "pushed": [
780 "im-pickle-rick.mp3",
781 "my-plan-all-along.mp3"
782 ],
783 "compacted": [
784 "brain-functionality.mp3",
785 "super-intelligence.mp3"
786 ],
787 "mcp": []
788 },
789 "rick-and-morty-uncut": {
790 "label": "Rick and Morty, uncut: the swearing lines (explicit language, fan use)",
791 "ordered": [
792 "son-of-a-bitch-im-in.mp3",
793 "gonna-fucking-do-it.mp3",
794 "doctor-who.mp3"
795 ],
796 "needsYou": [
797 "who-the-fuck-are-you.mp3",
798 "seeds-up-your-butt.mp3"
799 ],
800 "longDone": [
801 "having-a-party.mp3"
802 ],
803 "subagentStart": [],
804 "subagent": [
805 "god-damn-it.mp3"
806 ],
807 "failed": [
808 "oh-fuck-me.mp3",
809 "fuck-the-government.mp3"
810 ],
811 "pushed": [
812 "everybody-fuck-off.mp3",
813 "dick-move.mp3"
814 ],
815 "compacted": [
816 "traumatized-for-breakfast.mp3",
817 "take-a-shit.mp3"
818 ],
819 "mcp": []
820 },
821 "sheogorath": {
822 "label": "The Elder Scrolls IV: Sheogorath, Prince of Madness (fan use)",
823 "ordered": [
824 "good-choice.m4a",
825 "i-like-it.m4a",
826 "dance-sing-smile.m4a"
827 ],
828 "needsYou": [
829 "ive-been-waiting-for-you.m4a",
830 "need-a-champion.m4a"
831 ],
832 "longDone": [
833 "cheese-for-everyone.m4a"
834 ],
835 "subagentStart": [],
836 "subagent": [
837 "congratulations.m4a",
838 "but-youre-not-done-yet.m4a"
839 ],
840 "failed": [
841 "boring-boring-boring.m4a",
842 "absolutely-not.m4a",
843 "how-rude.m4a"
844 ],
845 "pushed": [
846 "prince-of-madness.m4a",
847 "dont-get-too-comfortable.m4a"
848 ],
849 "compacted": [
850 "a-little-busy-here.m4a",
851 "niggling-little-details.m4a"
852 ],
853 "mcp": []
854 },
855 "stronghold": {
856 "label": "Stronghold Crusader: the AI lords (fan use)",
857 "ordered": [
858 "richard-i-march.mp3",
859 "abbot-agreed.mp3",
860 "marshal-off-we-go.mp3",
861 "philip-on-my-honor.mp3"
862 ],
863 "needsYou": [
864 "abbot-send-help.mp3",
865 "sheriff-help-surrounded.mp3"
866 ],
867 "longDone": [
868 "richard-sound-the-fanfare.mp3",
869 "abbot-victory-for-me.mp3",
870 "pig-no-one-beats-the-pig.mp3"
871 ],
872 "subagentStart": [],
873 "subagent": [
874 "rat-plans-worked-perfectly.mp3",
875 "saladin-another-has-fallen.mp3",
876 "emir-this-is-easy.mp3"
877 ],
878 "failed": [
879 "abbot-my-troops-fail-me.mp3",
880 "emir-what-a-disaster.mp3",
881 "marshal-bad-tactics.mp3"
882 ],
883 "pushed": [
884 "richard-the-lion-roars.mp3",
885 "wolf-i-win-you-lose.mp3",
886 "sheriff-sweet-victory.mp3"
887 ],
888 "compacted": [
889 "sheriff-not-father-christmas.mp3",
890 "richard-lean-times.mp3"
891 ],
892 "mcp": []
893 },
894 "tauren": {
895 "label": "World of Warcraft: the Tauren (fan use)",
896 "ordered": [
897 "peace-and-patience.m4a",
898 "indeed.m4a",
899 "it-is-so.m4a"
900 ],
901 "needsYou": [
902 "i-need-assistance.m4a",
903 "wont-you-help.m4a"
904 ],
905 "longDone": [
906 "fate-smiles-upon-you.m4a",
907 "our-ancestors-be-praised.m4a"
908 ],
909 "subagentStart": [],
910 "subagent": [
911 "well-done.m4a",
912 "pleasure-doing-business.m4a"
913 ],
914 "failed": [
915 "impermissible.m4a",
916 "i-cannot-do-that.m4a"
917 ],
918 "pushed": [
919 "for-the-horde.m4a",
920 "ride-the-winds.m4a"
921 ],
922 "compacted": [
923 "my-inventory-is-full.m4a",
924 "i-cannot-carry-more.m4a",
925 "moo.m4a"
926 ],
927 "mcp": []
928 },
929 "terran": {
930 "label": "StarCraft Terran: SCV good to go, nuclear launch detected (Blizzard, fan use)",
931 "ordered": [
932 "scv-good-to-go.mp3",
933 "jacked-up.mp3"
934 ],
935 "needsYou": [
936 "piece-of-me.mp3",
937 "supply-depots.mp3"
938 ],
939 "longDone": [
940 "battlecruiser-operational.mp3"
941 ],
942 "subagentStart": [],
943 "subagent": [
944 "research-complete.mp3",
945 "upgrade-complete.mp3"
946 ],
947 "failed": [
948 "nuclear-launch.mp3",
949 "base-under-attack.mp3"
950 ],
951 "pushed": [
952 "in-the-pipe.mp3"
953 ],
954 "compacted": [
955 "not-enough-minerals.mp3",
956 "vespene-gas.mp3"
957 ],
958 "mcp": []
959 },
960 "yuri": {
961 "label": "Red Alert 2: Yuri's Revenge: Yuri (fan use)",
962 "ordered": [
963 "your-thoughts-are-mine.m4a",
964 "a-trivial-matter.m4a",
965 "yes-i-know.m4a"
966 ],
967 "needsYou": [
968 "i-foresaw-this-need.m4a",
969 "share-your-thoughts.m4a",
970 "something-to-think-about.m4a"
971 ],
972 "longDone": [
973 "yes-my-exquisite-mind.m4a",
974 "they-will-obey.m4a"
975 ],
976 "subagentStart": [],
977 "subagent": [
978 "another-pawn-joins-us.m4a",
979 "he-shall-serve-me-well.m4a"
980 ],
981 "failed": [
982 "i-did-not-foresee-this.m4a",
983 "this-could-be-a-problem.m4a"
984 ],
985 "pushed": [
986 "there-is-only-one-yuri.m4a",
987 "yield-to-me.m4a"
988 ],
989 "compacted": [
990 "all-in-the-mind.m4a",
991 "i-cannot-be-overcome.m4a"
992 ],
993 "mcp": []
994 }
995}
996// FILE_PACKS_END
997
998const VOICE_PACKS = {}
999
1000// Module variables are this terminal's: each terminal is its own process. A plugin reload
1001// starts them over, which only costs this terminal's /sounds <pack> choice.
1002// pack and packAt: this terminal's /sounds <pack>; all: the last /sounds default <pack> of any terminal;
1003// project: the folder this session runs in and the pack /sounds project gave it (or its parent)
1004// Subagents by id, waiting for their own turn.complete. Not classic.SubagentStart or
1005// classic.SubagentStop: a managed plugin seated above this one (Claude Code's own sec-default, for
1006// Team and Enterprise organizations) sends them on past it and says so in the transcript.
1007// Teammates of an agent team play no subagent sound
1008const subagents = { stops: new Set() }
1009
1010const here = { pack: undefined, packAt: -1, all: undefined, cwd: '', project: undefined, playedAt: 0, orderedAt: 0, yourPacks: {}, lastClip: {} }
1011
1012const DEFAULTS = { isOn: true, defaultPack: DEFAULT_PACK, mode: 'always', isNightQuiet: false, restMin: ORDERED_REST_MIN }
1013
1014export function register(on) {
1015 on('session.start', async ($, e, next) => {
1016 await $.command.register({
1017 name: 'sounds',
1018 description: 'Sound packs for the moments that need you: /sounds to see every moment and command, /sounds <pack>, /sounds <moment> <pack>, test',
1019 argumentHint: '[<pack>|default <pack>|<moment> <pack> [clip]|<moment> random|off|reset|on|off|test [pack] [moment]]',
1020 })
1021 here.yourPacks = await loadYourPacks($)
1022 // Said once, so the way to change the pack is never a secret
1023 try {
1024 if (!(await $.store.get('welcomed'))) {
1025 await $.store.set('welcomed', true)
1026 const settings = await readSettings($)
1027 $.ui.toast('Sounds: ' + settings.defaultPack + ' pack. Type /sounds for the others')
1028 }
1029 } catch {
1030 // A hint is never worth an error line
1031 }
1032 return next(e)
1033 })
1034
1035 on('command.run', { command: 'sounds' }, async ($, e) => {
1036 const args = String(e.args ?? '').trim().toLowerCase().split(/\s+/).filter(Boolean)
1037 const settings = await readSettings($)
1038 const current = currentPack(settings)
1039
1040 if (args[0] === 'test') {
1041 // /sounds test [pack] [moment], either may be left out
1042 const words = args.slice(1)
1043 const moment = MOMENT_BY_WORD[words[words.length - 1]]
1044 if (moment) words.pop()
1045 const name = words[0] ?? current
1046 if (!packOf(name)) {
1047 const meant = closestPack(name)
1048 return { text: 'No pack named ' + name + (meant ? '. Did you mean ' + meant + '? /sounds test ' + meant + (moment ? ' ' + moment.toLowerCase() : '') : '\n' + listing()) }
1049 }
1050 const count = await playAll($, name, moment)
1051 return { text: 'Played ' + count + ' sounds of ' + name + (moment ? ' for ' + moment : '') }
1052 }
1053 // No word: where things stand, then every command and pack
1054 if (!args.length) return { text: describe(settings) }
1055 // /sounds <moment> ...: that moment's own rule
1056 if (MOMENT_BY_WORD[args[0]]) return momentCommand($, settings, MOMENT_BY_WORD[args[0]], args.slice(1))
1057 // A change answers with one line saying what changed, not the whole list again
1058 if (packOf(args[0]) && args.length === 1) {
1059 here.pack = args[0]
1060 here.packAt = await $.clock.now()
1061 const def = defaultOf(settings)
1062 return {
1063 text: 'This terminal now plays ' + args[0] + ': ' + packOf(args[0]).label +
1064 (args[0] === def ? '' : '\nOther terminals keep theirs (/sounds default ' + args[0] + ' switches them all)'),
1065 }
1066 }
1067 if (args[0] === 'default' && !packOf(args[1])) {
1068 const meant = args[1] && closestPack(args[1])
1069 if (meant) return { text: 'No pack named ' + args[1] + '. Did you mean ' + meant + '? /sounds default ' + meant }
1070 return { text: (args[1] ? 'No pack named ' + args[1] : 'Which pack? /sounds default <pack>') + '\n' + listing() }
1071 }
1072 // /sounds project [<pack>|off]: every terminal in this folder, or one below it
1073 if (args[0] === 'project') return projectCommand($, args.slice(1))
1074 // /sounds default <pack>: every open terminal, of both accounts, and every new one
1075 if (args[0] === 'default' && args.length === 2) {
1076 const name = args[1]
1077 if (current === name && defaultOf(settings) === name) return { text: 'Default is already ' + name + ': ' + packOf(name).label }
1078 const at = await $.clock.now()
1079 here.all = { pack: name, at }
1080 here.pack = undefined
1081 here.packAt = -1
1082 await $.fs.write(await allFile($), JSON.stringify(here.all)).catch(() => {})
1083 await $.store.set('settings', { ...settings, defaultPack: name, defaultAt: at })
1084 const kept = Object.keys(await readProjects($)).length
1085 return {
1086 text: 'Default changed: every terminal, open or new, now plays ' + name + ': ' + packOf(name).label +
1087 (kept ? '\nProject packs stay (/sounds project to see them)' : ''),
1088 }
1089 }
1090 const change = CHANGES.find((c) => c.matches(args))
1091 if (!change && args[0] === 'rest') return { text: 'How many minutes? /sounds rest <0 to ' + MAX_REST_MIN + '> (0: every prompt). Now: ' + restText(settings) }
1092 // A moment name mistyped or shortened (push, needsyu) gets the moment it meant
1093 const moment = !change && !packOf(args[0]) && closestMoment(args[0])
1094 if (moment) {
1095 return { text: 'No moment named ' + args[0] + '. Did you mean ' + moment + '? /sounds ' + [moment.toLowerCase(), ...args.slice(1)].join(' ') }
1096 }
1097 if (!change) {
1098 // A typo of a pack name (aeo-turk) gets the pack it meant, not just the list
1099 const last = args[args.length - 1]
1100 const meant = !packOf(last) && closestPack(last)
1101 if (meant) return { text: 'No pack named ' + last + '. Did you mean ' + meant + '? /sounds ' + (args[0] === 'default' ? 'default ' : '') + meant }
1102 return { text: 'Unknown: ' + args.join(' ') + '\n' + commands() + '\n' + listing() }
1103 }
1104 const updated = change.apply({ ...settings }, args)
1105 await $.store.set('settings', updated)
1106 if (change === CHANGES[0]) await $.fs.write(await soundFile($), JSON.stringify({ isOn: updated.isOn })).catch(() => {})
1107 return { text: change.said(updated, args, settings) }
1108 })
1109
1110 // An order given: the unit answers. You are at the keyboard, so away mode does not apply
1111 on('prompt.submit', async ($, e, next) => {
1112 // The rest counts from this terminal's last prompt clip only: a clip of another moment, or of
1113 // another terminal, does not silence the next prompt
1114 const settings = await readSettings($).catch(() => DEFAULTS)
1115 const now = await $.clock.now()
1116 if (here.orderedAt && now - here.orderedAt < restOf(settings) * 60000) return next(e)
1117 if (await cue($, 'ordered', { isPresent: true })) here.orderedAt = now
1118 return next(e)
1119 })
1120
1121 on('classic.Notification', async ($, e, next) => {
1122 if (!QUIET_NOTIFICATIONS.includes(e.notification_type)) await cue($, 'needsYou')
1123 return next(e)
1124 })
1125
1126 on('agent.spawn', async ($, e, next) => {
1127 const out = await next(e)
1128 const id = out.agentId
1129 if (id === undefined) return out
1130 if (out.teammateId !== undefined) return out
1131 subagents.stops.add(id)
1132 await cue($, 'subagentStart')
1133 return out
1134 })
1135
1136 on('classic.PostCompact', async ($, e, next) => {
1137 await cue($, 'compacted')
1138 return next(e)
1139 })
1140
1141 on('turn.complete', async ($, e, next) => {
1142 const out = await next(e)
1143 if (!e.agentId && e.reason === 'answer' && e.durationMs >= LONG_TURN_MS) await cue($, 'longDone')
1144 if (e.agentId) {
1145 if (subagents.stops.delete(e.agentId) && e.reason === 'answer') await cue($, 'subagent')
1146 }
1147 return out
1148 })
1149
1150 // One hook for the tools: a plugin gets one hook per event
1151 on('tool.call', async ($, e, next) => {
1152 // A question waits for you, so the sound goes before the answer, not after it
1153 if (ASKING_TOOLS.includes(e.tool)) {
1154 await cue($, 'needsYou')
1155 return next(e)
1156 }
1157 if (String(e.tool).startsWith('mcp__')) {
1158 const out = await next(e)
1159 if (out.deny === undefined && !out.isError) await cue($, 'mcp', { restMs: MCP_REST_MS })
1160 return out
1161 }
1162 if (e.tool !== 'Bash') return next(e)
1163 const out = await next(e)
1164 const command = String(e.command ?? '')
1165 if (out.deny === undefined) {
1166 if (out.isError && runsCheck(command)) await cue($, 'failed')
1167 else if (!out.isError && PUSH_COMMAND.test(command)) await cue($, 'pushed')
1168 }
1169 return out
1170 })
1171}
1172
1173// Plays one sound of the moment when the settings allow it; never delays or breaks the event
1174async function cue($, moment, opts = {}) {
1175 try {
1176 const settings = await readSettings($)
1177 if (!settings.isOn) return
1178 const choices = choicesFor(settings, moment)
1179 if (!choices.length) return
1180 const now = await $.clock.now()
1181 const last = Math.max(here.playedAt, await sharedPlayedAt($))
1182 if (now - last < GAP_MS) return
1183 if (settings.isNightQuiet && isQuietHour(new Date(now).getHours())) return
1184 if (!opts.isPresent && settings.mode === 'away' && (await isHere($))) return
1185 here.playedAt = now
1186 await sharePlayedAt($, now)
1187 // Not awaited: the sound plays while the session goes on
1188 const [name, item] = pick(choices.map((c) => c.pack + '/' + c.item), here.lastClip, moment, now).split(/\/(.*)/s)
1189 sound($, packOf(name), item).catch(() => {})
1190 return true
1191 } catch {
1192 // A sound is never worth an error line
1193 }
1194 return false
1195}
1196
1197// One sound of a pack: a clip of the plugin's, a line to speak, or a file of yours
1198async function sound($, pack, item) {
1199 if (pack.kind === 'voice') {
1200 try {