← Hooks
Claude Code hook Free

Desktop Notification Free Claude Code hook, copy & paste

Pops a desktop notification when Claude Code needs your input, so you can work elsewhere while it runs.

WHEN TO USE IT

When a long task runs in the background and you keep switching back to check whether it is waiting on you.

Lives in The "hooks" block of .claude/settings.json (shared) or ~/.claude/settings.json (just you).
Checked

Formats change. If a field stops working, check it against Anthropic's documentation.

Read it before you install it. A hook runs with your user account's permissions, on its own, every time it is triggered. That is what makes it useful, and why a stranger's should never be installed unread — this one included.

~/.claude/settings.json — macOS

The Notification event fires when Claude Code wants your attention. Put it in your user settings — it is a preference, not a project rule.

{
  "hooks": {
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "osascript -e 'display notification \"Claude Code needs your input\" with title \"Claude Code\"'"
          }
        ]
      }
    ]
  }
}
Linux and Windows

Swap the command for your platform. With no matcher, the hook runs for every notification.

Linux (libnotify):
  notify-send 'Claude Code' 'Claude Code needs your input'

Windows (PowerShell — plays the system alert sound):
  powershell -NoProfile -Command "[System.Media.SystemSounds]::Asterisk.Play()"

MORE HOOKS

The authority

Anthropic's documentation for Hooks

This template is a starting point. Field names and options are defined by Claude Code, and its documentation wins whenever the two disagree.

Read the docs ↗

https://code.claude.com/docs/en/hooks

New drops, every week

Free tools & Claude templates, landing regularly.

We keep shipping new free tools, code recipes and Claude Code templates. Follow @freeyantra on Instagram or join the newsletter so you never miss one.

Follow @freeyantra

or get them by email

Double opt-in. Unsubscribe any time. Privacy