brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: add a Notification hook so Claude Code pings you when it waits

Claude
~/tips/tip-claude-hook-notification-alert

"command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"

Sends a desktop notification when Claude Code is waiting for your input or approval.

Long tasks are where I would drift off to another window. The agent then sits there, patient and blocked, asking for permission.

The Notification event fires when Claude Code sends a notification, such as when it is waiting for input or a permission answer. Add this to ~/.claude/settings.json (macOS version):

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

If the file already has a hooks key, add Notification next to the existing events instead of replacing the whole object. Check it with /hooks.

With this you can leave the terminal alone and still know the moment your input is needed. The hook is a plain shell command, so you can swap the notification for a sound, a message to your phone or whatever you already use.

The caveat: on macOS nothing appears until you allow notifications for Script Editor in System Settings, under Notifications. Linux and Windows use different commands; the hooks guide lists them.

Further reading: Automate actions with hooks – Claude Code docs, On this site: let a PostToolUse hook run Prettier after every Claude edit, On this site: block edits to .env with a PreToolUse hook that exits 2

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link