Audio Notification Hooks: Know Which Session Finished

James Phoenix
James Phoenix

Summary

When running multiple Claude Code sessions in parallel, you need to know when each one finishes without constantly checking every terminal window. A Stop hook that plays a system sound via afplay lets you walk away and come back when you hear the chime. Simple config, high impact for multi-session workflows.

The Problem

Running 4-6 parallel Claude Code sessions means constant window-switching to check progress. You end up either:

  1. Polling: Alt-tabbing through windows every 30 seconds, breaking your focus
  2. Missing completions: A session finishes, sits idle for 10 minutes while you are focused elsewhere
  3. Walking away blind: Leaving your desk with no idea whether sessions are done

Visual notifications (macOS alerts, menubar badges) get lost in the noise. You need something that interrupts ambient attention without requiring screen focus.

The Solution

Add a Stop hook to ~/.claude/settings.json that plays a system sound when Claude Code finishes a response:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Blow.aiff"
          }
        ]
      }
    ]
  }
}

How it works

  1. Claude Code finishes processing (any session)
  2. The Stop hook fires
  3. afplay plays the system sound
  4. You hear the chime from across the room and know a session is ready

Available macOS system sounds

Pick a sound that cuts through your environment:

Sound Path Character
Blow /System/Library/Sounds/Blow.aiff Soft whoosh
Glass /System/Library/Sounds/Glass.aiff Sharp ping
Ping /System/Library/Sounds/Ping.aiff Clean notification
Pop /System/Library/Sounds/Pop.aiff Short bubble
Tink /System/Library/Sounds/Tink.aiff Light tap
Hero /System/Library/Sounds/Hero.aiff Achievement tone
Submarine /System/Library/Sounds/Submarine.aiff Deep sonar

Test them: afplay /System/Library/Sounds/Glass.aiff

Different sounds per session

If you want to distinguish which session finished, you can use project-level settings (.claude/settings.json in each project directory) with different sounds. Or use a script that incorporates the working directory:

#!/bin/bash
# ~/.claude/hooks/stop-sound.sh
# Play different sounds based on project directory
case "$PWD" in
  */octospark*) afplay /System/Library/Sounds/Hero.aiff ;;
  */knowledge-base*) afplay /System/Library/Sounds/Glass.aiff ;;
  *) afplay /System/Library/Sounds/Blow.aiff ;;
esac
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bash ~/.claude/hooks/stop-sound.sh"
          }
        ]
      }
    ]
  }
}

Linux alternative

Replace afplay with paplay or aplay:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "paplay /usr/share/sounds/freedesktop/stereo/complete.oga"
          }
        ]
      }
    ]
  }
}

Integration with Parallel Workflows

This hook becomes essential when combined with:

Leanpub Book

Read The Meta-Engineer

A practical book on building autonomous AI systems with Claude Code, context engineering, verification loops, and production harnesses.

Continuously updated
Claude Code + agentic systems
View Book
  • YOLO mode: Sessions run autonomously, so you are not watching the terminal. The sound tells you when to check in.
  • 4-6 parallel sessions: Without audio cues, you would need to visually poll every window.
  • Walk-away workflows: Start a plan or implementation, leave the desk, return when you hear the sound.

The pattern: start work in a session, switch to the next window, hear the chime, cycle back and react. Audio becomes the scheduling signal for your attention across parallel agents.

Related

References

Topics
AfplayAudioClaude CodeHooksMulti SessionNotificationsParallel SessionsProductivityWorkflow Optimization

More Insights

Cover Image for Memory Engineering as Data Modelling

Memory Engineering as Data Modelling

Agent memory is not a feature. It is a data modelling problem with a lifecycle.

James Phoenix
James Phoenix
Cover Image for Concept Template

Concept Template

Use this template for each new concept. Copy and rename.

James Phoenix
James Phoenix