Two cuelume sounds for Claude Code: ready when a long turn ends, attention when a permission prompt waits.

Two Cuelume sounds for Claude Code, so you can look away while it works.
| When | Cue |
|---|---|
| A turn of ten seconds or more ends with an answer | ready |
| A permission prompt is waiting on you | attention |
Short replies, interrupted turns and subagent turns stay silent.
/plugin marketplace add danielwh2/cuelume
/plugin install cuelume@cuelume
It needs a Claude Code version with mods, and macOS: Claude Code plays plugin audio through afplay, so other platforms stay silent.
/cuelume show the current theme
/cuelume bubble switch to default, mech, bubble or press, and hear it
/cuelume off no sounds
Your choice is kept across sessions.
press is modelled on the trackpad and keycap sounds in DawoodUI's Artasaka preview.
It plays the WAV files bundled in this folder and keeps your theme choice in Claude Code's plugin store. It reads nothing else, runs no other program and sends nothing over the network.
The plugin registers four hooks. None of them makes a decision for you. The first three pass their event on unchanged and return what Claude Code gave back; the last answers the plugin's own command.
| Hook | When it runs | What it does | What it decides |
|---|---|---|---|
classic.PermissionRequest | A permission prompt is about to show | Plays attention | Nothing. It never allows, denies or answers the request; that decision stays with you |
turn.complete | A turn ends | Plays ready if the turn ran ten seconds or more | Nothing. The answer is returned as it was |
session.start | A session starts | Registers the /cuelume command | Nothing |
command.run | You run /cuelume | Saves the theme you chose and plays it | Nothing |
Cuelume synthesizes its cues live with Web Audio. A Claude Code mod can only play audio files, so each cue here is rendered once from Cuelume's own recipes to a 48 kHz WAV. The renderer uses the library's own room and noise and leaves out the small variation between plays, so a cue here sounds the same every time. The WAVs sit at the library's level, peaking near -18 dBFS, and the plugin plays them at 1.4 times that.
hooks/register.ts 77 lines1import type { EngineInterface, Register } from 'claude-code'
2
3const THEMES = ['default', 'mech', 'bubble', 'press'] as const
4const OFF = 'off'
5const DEFAULT_THEME = 'default'
6const THEME_KEY = 'theme'
7const GAIN = 1.4
8// A short reply is still on screen when it lands; only a turn worth walking away from rings.
9const MIN_TURN_MS = 10_000
10
11type Cue = 'ready' | 'attention'
12type Choice = (typeof THEMES)[number] | typeof OFF
13
14export const parseChoice = (text: string): Choice | undefined => {
15 const word = text.trim().toLowerCase()
16
17 return word === OFF || THEMES.some(theme => theme === word) ? (word as Choice) : undefined
18}
19
20async function chosen($: EngineInterface): Promise<Choice> {
21 const stored = await $.store.get(THEME_KEY)
22
23 return (typeof stored === 'string' && parseChoice(stored)) || DEFAULT_THEME
24}
25
26async function cue($: EngineInterface, name: Cue) {
27 const theme = await chosen($)
28 if (theme === OFF) return
29
30 await $.audio
31 .play({ asset: `sounds/${theme}/${name}.wav` }, { gain: GAIN })
32 .catch((error: unknown) => $.ui.toast(`${$.plugin.name}: ${name} did not play: ${String(error)}`))
33}
34
35export const register: Register = on => {
36 on('session.start', async ($, e, next) => {
37 await $.command.register({
38 name: 'cuelume',
39 description: 'Pick the sound theme for turn-end and permission cues, or turn them off',
40 argumentHint: [...THEMES, OFF].join(' | '),
41 })
42
43 return next(e)
44 })
45
46 on('command.run', { command: 'cuelume' }, async ($, e) => {
47 const choice = parseChoice(e.args)
48 if (choice === undefined) {
49 return { text: `cuelume: ${await chosen($)}. Options: ${[...THEMES, OFF].join(', ')}.` }
50 }
51
52 await $.store.set(THEME_KEY, choice)
53 await cue($, 'ready')
54
55 return { text: choice === OFF ? 'cuelume: off.' : `cuelume: ${choice}.` }
56 })
57
58 // The cue starts before next(e) and is awaited after it: a call left running once the hook returns never
59 // plays, and this way the answer and the dialog do not wait on the sound. Each hook returns what next gave back.
60 on('turn.complete', async ($, e, next) => {
61 const isWorthRinging = e.agentId === undefined && e.reason === 'answer' && e.durationMs >= MIN_TURN_MS
62 const playing = isWorthRinging ? cue($, 'ready') : undefined
63 const answer = await next(e)
64 await playing
65
66 return answer
67 })
68
69 on('classic.PermissionRequest', async ($, e, next) => {
70 const playing = cue($, 'attention')
71 const decision = await next(e)
72 await playing
73
74 return decision
75 })
76}
77