Stay Updated!

Get the latest posts and insights delivered directly to your inbox

Skip to content

How I Added Sound Effects to Claude Code with Hooks

Published: at 

TLDR#

Claude Code has a hooks system that lets you run shell commands on lifecycle events. I wired up Age of Empires sound effects to four key moments: session start, prompt submission, task completion, and context compaction. Now my terminal sounds like a medieval battlefield and I love it.

Why Sounds?#

I spend a lot of time in Claude Code. Sometimes I send a prompt and switch to another window while it works. The problem is I never know when it’s done. I could keep checking, but that breaks my flow.

I wanted audio cues. Something that tells me “hey, I’m done” without me having to look. And if I’m going to add sounds, why not make them fun?

How Claude Code Hooks Work#

Claude Code lets you define hooks in your settings.json file at ~/.claude/settings.json. Hooks fire on specific lifecycle events:

Each hook runs a shell command. That’s it. Simple and powerful.

If you’re new to hooks, I covered the basics in my post about setting up Claude Code notification hooks Claude Code Notifications: Get Alerts When Tasks Finish (Hooks Setup) How to set up Claude Code notifications using hooks. Get desktop alerts when Claude finishes a task, needs your input, or requests permission, instead of watching the terminal. claude-codenotificationshooks +1 . This post goes in a different direction: instead of desktop notifications, we’re adding sound effects.

For a broader look at what Claude Code can do, see my overview of the full Claude Code feature stack Understanding Claude Code's Full Stack: MCP, Skills, Subagents, and Hooks Explained A practical guide to Claude Code's features — explained in the order they were introduced: MCP (2024), Claude Code core (Feb 2025), Plugins (2025), and Agent Skills (Oct 2025). What each does, how they fit together, and when to use what. claude-codeaimcp +2 .

My Setup#

I put four MP3 files in ~/.claude/sounds/ and used afplay (macOS built-in audio player) to play them. Here’s my full hooks config:

// ~/.claude/settings.json
{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup|clear",
        "hooks": [
          {
            "type": "command",
            "command": "afplay ~/.claude/sounds/horn.mp3 &"
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay ~/.claude/sounds/yes.mp3 &"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay ~/.claude/sounds/allhail.mp3 &"
          }
        ]
      }
    ],
    "PreCompact": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "afplay ~/.claude/sounds/wololo.mp3 &"
          }
        ]
      }
    ]
  }
}

The & at the end is important. It runs afplay in the background so the sound doesn’t block Claude Code from continuing.

The Sound Choices#

All sounds are from Age of Empires. Here’s why I picked each one:

EventSoundWhy
SessionStarthorn.mp3A battle horn. The session begins, time to work.
UserPromptSubmityes.mp3The villager “yes” response. Claude acknowledges your command.
Stopallhail.mp3”All hail!” when Claude finishes. Victory.
PreCompactwololo.mp3The priest conversion sound. Your context is being… converted.

The wololo for context compaction is my favorite. If you’ve played Age of Empires, you know what happens when a priest starts chanting “wololo”: things change. That’s exactly what context compaction does. It transforms your conversation to fit the context window.

Bonus: Touch Files for Status Line#

You might have noticed my actual config also touches files like touch ~/.claude/.claude-done. I use these as signals for my custom status line script How to Customize Your Claude Code Status Line Learn how to display model name, context usage, and cost directly in your terminal while using Claude Code. A step-by-step guide to creating custom status line scripts. claude-codeaitooling . The status line reads these files to show the current Claude Code state in my terminal prompt.

How to Set This Up Yourself#

  1. Create the sounds directory: mkdir -p ~/.claude/sounds
  2. Drop your MP3 files in there (any short sound clips work)
  3. Add the hooks config to ~/.claude/settings.json
  4. Restart Claude Code

💪 Tip

On Linux, replace afplay with aplay or paplay. On Windows WSL, you can use powershell.exe -c (New-Object Media.SoundPlayer "path").PlaySync().

Conclusion#

Small things like audio feedback make tools feel more alive. It took five minutes to set up and now I actually enjoy waiting for Claude to finish.

Press Esc or click outside to close

Stay Updated!

Subscribe to my newsletter for more TypeScript, Vue, and web dev insights directly in your inbox.

  • Background information about the articles
  • Weekly Summary of all the interesting blog posts that I read
  • Small tips and trick
Subscribe Now