AI Agent Sound Notification
A VS Code extension that plays a sound when Claude Code or Google Antigravity needs your input — and a different one when it's really done — so you can look away while your agent works.
Features
- 🔔 Alert sound when an agent is blocked on you: a permission prompt, a question, a plan to approve, an MCP server asking for input.
- ✅ Completion sound only when the agent is really done. A turn that ends while a backgrounded command, subagent or monitor is still running is paused, not done, and stays silent. Subagents finishing in the background don't chime either; the chime comes when everything has settled.
- ❌ Failure sound when a turn dies on an API error (rate limit, overload, authentication).
- ⏱️ Initial delay (default 10 s) so you can react before anything plays, and optional back-off repeats.
- 🪟 Multi-window aware — the sound plays in the window that owns the session; every other window shows "Claude needs you in <workspace>" in its status bar, and clicking it switches to that window.
- 🧵 Session-aware — several sessions, and subagents within a session, each have their own alert; one finishing never silences another.
- 🎵 27 built-in sounds — 16 from Google's Material Design set (CC-BY 4.0) and 11 synthesized in-house — or any
.wav of your own.
- 🌍 Windows, macOS and Linux, with optional Windows Focus Assist / Do Not Disturb respect.
Supported agents
| Agent |
How it's detected |
Notes |
| Claude Code VS Code extension |
Async hooks in ~/.claude/settings.json |
Exact: dedicated events for prompts, questions, turn end, background work |
| Google Antigravity VS Code extension |
A named hook in ~/.gemini/config/hooks.json |
Antigravity has no "permission requested" event, so approval waits are inferred — see below |
Only sessions run by those VS Code extensions are tracked. Claude Code in a terminal, claude -p/SDK scripts, the agy CLI and the standalone Antigravity apps are ignored, even though they read the same config files.
Requirements: VS Code 1.85+. The agents launch the hook with Node.js: the extension uses your node if it's on your PATH and version 16 or later. If not, it downloads its own copy of Node.js (one 40–60 MB download from nodejs.org, checked against a SHA-256 built into the extension) into its own folder. That copy is used only by the hooks and is deleted when you uninstall the extension, or once a suitable node shows up on your PATH.
Installation
From the VS Code Marketplace, or download a .vsix from the Releases page and use Extensions → … → Install from VSIX….
That's it: on startup the extension registers its hooks and keeps them up to date. Other hooks in those files are never touched. Uninstalling the extension removes the hooks again.
How it works
Claude Code / Antigravity ──hook──▶ node hook.js ──HTTP (localhost)──▶ the VS Code window that owns the session
│ sounds, status bar
└──▶ other windows' status bars
- Each VS Code window runs a tiny HTTP server on
127.0.0.1 (random port, random token) and describes itself — port, workspace folders, last focus — in a small file in %APPDATA%\ai-agent-sound-notification (~/.config/ai-agent-sound-notification on macOS/Linux).
- The agents run
hook.js with Node.js on the events below. It drops anything not run by a VS Code extension, picks the window whose workspace contains the session's working directory, and sends it a trimmed event. Prompts, tool inputs and model output are never forwarded — only event names, session ids, tool names and the like.
- That window decides what to play and tells the other windows what it's waiting on.
Claude Code
Hooks are registered as async (Claude Code starts them and moves on, so they never slow the agent down) and in exec form (no shell is spawned).
| Hook event |
What it means |
PermissionRequest |
🔔 A permission prompt is on screen |
PreToolUse (AskUserQuestion\|ExitPlanMode) |
🔔 Claude asks you a question or wants a plan approved |
Elicitation |
🔔 An MCP server asks you for input |
PostToolBatch, ElicitationResult |
You answered (approved, denied, or the tool failed) → clear that alert |
UserPromptSubmit |
New turn → clear the session's alerts |
Stop |
Turn over. If background_tasks lists work still in flight it's paused (silent); otherwise ✅ |
StopFailure |
❌ The turn died on an API error |
SessionEnd |
Session closed → clear |
Every event carries the session id and, inside a subagent, the subagent's id. Alerts are keyed on both, so a background subagent's tool call can't clear the main thread's prompt (or vice versa).
The Notification hook (permission_prompt, idle_prompt) isn't used: it fires only after a period of inactivity. The delay you get is the one you configure.
Antigravity
Antigravity's hooks are SessionStart, PreToolUse, PostToolUse, PreInvocation, PostInvocation and Stop. There is no "waiting for approval" event, so:
PreToolUse fires just before Antigravity asks for approval. If the tool call hasn't finished (PostToolUse) after antigravity.approvalThreshold (default 15 s), it's assumed to be waiting for your approval: the status bar shows it and the alert plays. Tools that legitimately run long (invoke_subagent, generate_image, search_web, …) are exempt.
- Denying a tool call, or a tool call failing, fires no hook at all. Both write an error step to the conversation's transcript, though, so while a tool alert is pending its window watches the transcript and clears the alert as soon as that step appears. Only each step's type and status are read; nothing from the transcript is logged or sent anywhere.
Stop ends the turn: fullyIdle: false means background work is still running (silent), an error termination plays the failure sound, a user cancel is silent, anything else is ✅.
Known gaps:
- Long approved commands: a command you approved that then runs longer than the threshold can cause a false alert. Antigravity moves a command to the background after the wait the model chose (typically 5–10 s), which keeps this rare; raise the threshold if it bothers you.
- Cancelling while a prompt is up: stopping the agent while it waits for approval leaves no trace in hooks or the transcript. That alert still plays once the threshold passes, then clears with your next message.
The hook never prints anything. Antigravity treats a PreToolUse hook's output as a decision, and both {} and a hook that fails to run deny the tool call. So the hook script always exits silently, its command line avoids quotes (older Antigravity builds mangle them), the hooks are removed when no Node.js is available, and uninstalling keeps the script in place if a hook couldn't be removed. Antigravity runs hooks synchronously, so each tool call pays the hook's start-up time (~0.1–0.2 s on Windows); only PreToolUse, PostToolUse and Stop are registered to keep that small.
Configuration
All settings live under aiAgentSoundNotification.*:
| Setting |
Default |
Description |
enabled |
true |
Master switch |
initialDelay |
"10s" |
How long an agent must wait on you before the alert plays |
soundName / soundFile |
"md-alert-simple" / "" |
Alert sound; a custom .wav path overrides the built-in |
completionSound.enabled / .name / .file |
true / "md-hero-simple-1" / "" |
Completion sound. Suppressed if the alert already sounded that turn |
failureSound.enabled / .name / .file |
true / "failure" / "" |
Failure sound. Never suppressed |
repeat.enabled |
false |
Repeat the alert until you respond |
repeat.intervals |
["1m","5m","10m","30m","1h","3h"] |
Back-off between repeats; stops after the last |
respectDND |
false |
Stay silent during Windows Focus Assist / Do Not Disturb |
integrations.claudeCode |
true |
Hook into the Claude Code extension |
integrations.antigravity |
true |
Hook into the Antigravity extension (when installed) |
antigravity.approvalThreshold |
"15s" |
See Antigravity |
debug |
false |
Log every event, alert and sound to the output channel |
Turning an integration off removes its hooks; turning it on puts them back.
An alert is acknowledged — silenced, status bar cleared — when the agent moves on, when you focus the window it's in, type in an editor or switch terminals there, or click the status bar.
Built-in sounds
Use AI Agent Sound: Choose Sound... for a live-preview picker (alert, completion or failure), or set the names directly.
| Material Design (Google, CC-BY 4.0) |
|
Synthesized (in-house) |
|
md-alert-simple |
Clear, simple alert — alert default |
alert |
Two-tone notification chime |
md-alert-high |
Urgent high-intensity alert |
chime |
Gentle ascending major triad |
md-alarm-gentle |
Soft repeating alarm (~6 s) |
bell |
Single rich bell strike with long decay |
md-notif-ambient |
Soft, ambient notification |
ding |
Bright, short single ding |
md-notif-simple-1 / -2 |
Clean two-tone ping |
harp |
Quick C-major harp arpeggio |
md-notif-decorative-1 / -2 |
Pleasant decorative chime |
fanfare |
Triumphant brass-style fanfare |
md-notif-high |
Strong notification tone |
success |
Ascending pentatonic "level up" melody |
md-ringtone-minimal |
Minimal looping ringtone |
failure |
Descending minor third — failure default |
md-hero-simple-1 |
Crisp "done!" — completion default |
gentle |
Soft sine pad |
md-hero-simple-2 / -3 |
Crisp "done!" (variants) |
zen |
Meditative singing bowl |
md-hero-decorative-1 / -2 / -3 |
Richer celebratory flourish |
arpeggio |
Cascading bell arpeggio in D major |
Commands
| Command |
Description |
AI Agent Sound: Trigger Test Alert |
Raise a test alert (full pipeline: delay, status bar, repeats) |
AI Agent Sound: Dismiss Active Alerts |
Silence every alert in this window |
AI Agent Sound: Choose Sound... |
Pick the alert, completion or failure sound with live preview |
AI Agent Sound: Preview Alert / Completion / Failure Sound |
Play the configured sound once |
AI Agent Sound: Remove Agent Hooks |
Remove the hooks from both agents and turn both integrations off |
AI Agent Sound: Reset Settings to Defaults |
Restore every setting of this extension |
AI Agent Sound: Show Log |
Open the output channel |
| Platform |
Player |
| Windows |
Windows PowerShell + System.Media.SoundPlayer |
| macOS |
afplay |
| Linux |
paplay → aplay → play (sox), first one found |
The extension runs in the local (UI) extension host. Remote windows (SSH, WSL, containers) aren't supported: the agents run on the remote machine and can't reach your local windows.
Troubleshooting
Turn on aiAgentSoundNotification.debug and run AI Agent Sound: Show Log. Every event that reaches the window is logged with its delivery lag; if nothing shows up when the agent asks for permission:
- Which Node.js do the hooks use? The log says, and says why if it couldn't get one (no network for the one-time download, an unsupported platform such as Alpine Linux). Installing Node.js 16+ yourself and reloading the window always works.
- Are the hooks there? Look for
ai-agent-sound-notification in ~/.claude/settings.json or ~/.gemini/config/hooks.json. If a file can't be parsed, the extension leaves it untouched and says so in the log.
- Is the session's folder open in a VS Code window? Events go to the window whose workspace contains the session's working directory, falling back to the most recently focused window.
Credits
The md-* sounds under resources/sounds/ are from Google's Material Design Sound Resources, licensed CC-BY 4.0, mirrored from the Internet Archive snapshot.
License
MIT for the extension code and the synthesized sounds. The Material Design sounds keep their CC-BY 4.0 license.