Skip to content

How to Get a Sound When Claude Code Needs You (Mac)

Set up Claude Code notification sounds with hooks: a sound when it needs permission, sits idle or finishes. Copy-paste settings.json for macOS, plus random sounds and quiet hours.

Pierre Sauvignon 5 min read productivity, guides

Claude Code is good at working on its own for a few minutes. The trouble is the moment it stops. It asks for permission to run a command, or it finishes and waits for your next message, and you only find out when you happen to look back at the terminal. On a long task that can cost you ten minutes at a time.

A short sound fixes this. You look away, do something else, and come back when you hear it. Claude Code has everything you need built in: hooks, which run a shell command when something happens in a session. On a Mac, that command can be afplay, which plays an audio file.

This guide shows the exact settings, which moments are worth a sound, and how to add random variations and quiet hours. If you would rather not edit JSON, the LobsterOne Mac app does all of this for you.

The four moments worth a sound

Claude Code fires many hook events. Four of them map to the moments you actually care about:

Moment Hook event Matcher When it fires
Claude needs your permission Notification permission_prompt A permission prompt has been waiting about six seconds and you have not typed
Claude is waiting for you Notification idle_prompt About 60 seconds after Claude finished responding, if you have not typed since
Claude finished Stop none Claude finishes its response and hands back to you
A session starts SessionStart startup You open a new Claude Code session

The timings for the two Notification types come from the Claude Code hooks reference. They matter: the permission sound does not play the instant a prompt appears, and the idle sound is a reminder a minute later, not a second “finished” sound.

If you pick only one, pick permission. It is the moment where Claude is blocked on you and doing nothing.

Step 1: open your Claude Code settings

User-level settings live in ~/.claude/settings.json and apply to every project. Open it in any editor. If it does not exist, create it with {} inside.

Settings can also live in a project’s .claude/settings.json (shared with your team) or .claude/settings.local.json (just for you). For sounds, the user file is the right place: they are your preference, not the project’s.

Step 2: add the hooks

Here is a complete hooks block using sounds that ship with macOS. Merge it into your settings file, keeping anything that is already there.

{
  "hooks": {
    "Notification": [
      {
        "matcher": "permission_prompt",
        "hooks": [{ "type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff &" }]
      },
      {
        "matcher": "idle_prompt",
        "hooks": [{ "type": "command", "command": "afplay /System/Library/Sounds/Ping.aiff &" }]
      }
    ],
    "Stop": [
      {
        "hooks": [{ "type": "command", "command": "afplay /System/Library/Sounds/Hero.aiff &" }]
      }
    ]
  }
}

A few details that save you a debugging session:

  • The & at the end runs the sound in the background, so Claude Code does not wait for it to finish playing.
  • afplay -v 0.5 sets the volume, from 0 to 1. System sounds are loud next to a quiet room.
  • Use full paths. ~ works in most shells, but a full path never surprises you.
  • Your own files work too. Any .wav, .aiff, .mp3 or .m4a file plays. ~/Library/Sounds is a sensible home for them.

To hear what macOS ships with, list /System/Library/Sounds and play a few:

ls /System/Library/Sounds
afplay /System/Library/Sounds/Submarine.aiff

Step 3: start a new session and test it

Start a new Claude Code session after saving. A session that is already open keeps the hooks it started with. Then ask Claude to do something that needs permission, such as running a shell command, and wait a few seconds without typing. You should hear the permission sound.

If you hear nothing, check three things: the JSON is valid (a stray comma silently breaks the whole file), the file path exists, and afplay on its own plays the file from your terminal.

Optional: a different sound each time

Hearing the same chime a hundred times a day gets old. If you have a few versions of a sound, say hello-1.wav, hello-2.wav and hello-3.wav, the shell can pick one at random:

{
  "type": "command",
  "command": "set -- ~/Library/Sounds/hello-1.wav ~/Library/Sounds/hello-2.wav ~/Library/Sounds/hello-3.wav; shift $((RANDOM % 3)); afplay \"$1\" &"
}

set -- loads the files as numbered arguments, shift drops a random number of them, and $1 is whichever file is left at the front. It works in sh, bash and zsh. Change the 3 if you have a different number of files.

Optional: quiet hours

If you leave long tasks running in the evening, you may not want a ping at 23:00. Wrap the command in a time check:

{
  "type": "command",
  "command": "t=$(date +%H%M); if ! { [ \"$t\" -ge 2200 ] || [ \"$t\" -lt 0800 ]; }; then afplay /System/Library/Sounds/Glass.aiff & fi"
}

This stays silent from 22:00 to 08:00. For a window that does not cross midnight, such as lunch from 12:30 to 13:30, use && between the two tests instead of ||, with 1230 and 1330.

On Linux

The hooks are identical; only the player changes. Use paplay (PulseAudio or PipeWire) or aplay (ALSA) in place of afplay, with sounds from /usr/share/sounds.

Or let LobsterOne set it up

Writing the hooks yourself takes about ten minutes and works well. Keeping them tidy across sounds, volumes and quiet hours is where it gets fiddly, which is why we built it into the LobsterOne Mac app:

  • Five moments, each with its own switch and volume level, under one main volume.
  • 98 bundled sounds in eight themed packs, including NASA mission audio, plus macOS sounds or your own files.
  • The same sounds in Codex and Mistral Vibe, each through its own hook system.
  • Random versions and quiet times, written as the same kind of hooks shown above.
  • Your own hooks are left exactly as they are, and switching sounds off removes only LobsterOne’s.

Because the result is ordinary Claude Code hooks, the sounds keep playing when the app is closed. You can listen to every pack on the sounds page.

See how developers track their AI coding

Explore LobsterOne
Pierre Sauvignon
Pierre Sauvignon Founder

Founder of LobsterOne. Building tools that make AI-assisted development visible, measurable, and fun.

Related Articles

Nine tools, one install.

One Mac app for the work around your coding agent. Watch your limits, your spend and your AWS bill, prompt by voice, hear when the agent needs you, see what the money shipped, and meet other developers in town.

Get LobsterOne free Tour the toolbox

We receive usage numbers and project details, never file contents or the AI’s replies. Free for individuals, no credit card. Teams pay $4.90 a seat per month.