georgebracher.com

Video 013 · 2 Dec 2026

How do I use Claude Code hooks?

A hook is a command Claude Code runs by itself, at a set moment. It doesn't have to remember. It just happens.

7commands in one file
4moments they run at
11checks before I typed
3errors it found

How to use Claude Code hooks

  1. It pings me when it's stuck. When Claude needs me, a Notification hook puts up a Mac notification with a sound. So I can walk away while it works.
  2. It checks my setup first. When a session starts, a SessionStart hook runs my setup check and only prints something if it's wrong. The morning I wrote this, it ran 11 checks and found 3 errors before I typed a single word. What the hook prints goes to Claude too, so it starts the session already knowing.
  3. It reads its answer out loud. When it finishes, a Stop hook speaks the last reply. If any app starts recording from the microphone, like dictation, it shuts up.

Claude Code hooks examples

Hooks live in your settings file, ~/.claude/settings.json. This is the shape of my three. The ping is exactly what I run. The other two point at my own scripts, so swap in yours.

{
  "hooks": {
    "Notification": [
      {"hooks": [{"type": "command",
        "command": "osascript -e 'display notification \"Claude needs your attention\" with title \"Claude Code\" sound name \"Ping\"'"}]}
    ],
    "SessionStart": [
      {"hooks": [{"type": "command", "command": "~/bin/check-setup"}]}
    ],
    "Stop": [
      {"hooks": [{"type": "command", "command": "~/bin/speak-last-reply"}]}
    ]
  }
}

Every hook gets a bit of JSON on its input, including transcript_path, the file the conversation is saved in. That's how my Stop hook finds the last reply to read out.

It was seven commands across four events when I filmed this. It's nine now. The rest keep my project notes up to date.

Why hooks and not rules?

A rule is a request. My rules file (it's in 009) tells Claude what to do, and Claude can forget a rule. A hook doesn't ask. Claude Code runs it at that moment whatever the model is doing, so it always runs.

Claude Code's hooks docs Watch it on Instagram Watch it on TikTok

More videos