Skip to main content
hook

simple-notifications — Claude Code hook: what it does, how to install

Sends desktop notifications on macOS and Linux whenever Claude Code finishes a task or requires user attention.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --hook automation/simple-notifications
Open on GitHub

What simple-notifications does

This hook registers handlers for two events in Claude Code: Stop and Notification. It triggers a desktop notification when execution finishes. If Claude Code pauses for user confirmation or input, it fires a separate alert.

Under the hood, the hook executes shell commands tailored to the operating system. On macOS, it relies on osascript and plays a Ping sound when user input is needed. On Linux, it routes alerts to notify-send, assigning the -u critical flag to input requests.

Without osascript on macOS or notify-send on Linux, the commands do nothing because the shell logic checks for these binaries before firing. Settings are stored directly in .claude/settings.json.

What it helps with

  • receive a desktop alert when Claude Code finishes working
  • get notified with a Ping sound whenever Claude Code asks for input on macOS
  • display a critical notification via notify-send on Linux systems

Example prompts for the agent

  • Run the full test suite and notify me when you are done
  • Analyze project dependencies and pause for my confirmation before updating

How to install simple-notifications

1claude-code-templates

npx claude-code-templates@latest --hook automation/simple-notifications

2Manually: put the files in place

.claude/settings.json

The hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json

Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command

Questions about simple-notifications

How to install simple-notifications in Claude Code?

Run npx claude-code-templates@latest --hook automation/simple-notifications. This adds the hook configuration directly to .claude/settings.json.

What does the simple-notifications hook do?

It triggers desktop alerts on macOS and Linux when Claude Code finishes a task or pauses for input.

Which system utilities are required for notifications to work?

On macOS, the hook relies on built-in osascript with a Ping audio alert. On Linux, it requires the notify-send utility to display critical alerts.

Source text

simple-notifications.json · MIT
{
  "description": "Send desktop notifications when Claude Code finishes working or needs user input. Works on macOS and Linux systems.",
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "if command -v osascript >/dev/null 2>&1; then osascript -e 'display notification \"Claude has finished working\" with title \"Claude Code\"'; elif command -v notify-send >/dev/null 2>&1; then notify-send 'Claude Code' \"Claude has finished working\"; fi"
          }
        ]
      }
    ],
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "if command -v osascript >/dev/null 2>&1; then osascript -e 'display notification \"Claude needs your input\" with title \"Claude Code\" sound name \"Ping\"'; elif command -v notify-send >/dev/null 2>&1; then notify-send -u critical 'Claude Code' \"Claude needs your input\"; fi"
          }
        ]
      }
    ]
  }
}

© davila7 · MIT · davila7/claude-code-templates

Similar hooks

All hooks for Agent setup: memory, context, orchestration →

From the same set804

The whole set →
backend-architect A subagent for backend design work: service boundaries, API paradigm choice, database schemas and observability. Useful when the decision comes before the first line of code. 23,691installs generate-tests Creates a complete test suite for a specified component or file. The command inspects your testing setup and generates assertions following the AAA pattern. 12,378installs database-architect A subagent for schema design, database selection and migration planning. Reach for it when the question is how data should be stored, not how to write a query. 12,224installs architect-review This subagent checks code changes against a project’s architecture and established patterns. Use it to review structural pull requests or assess a new service design. 8,999installs ultra-think Runs a structured analysis of a hard problem: surfaces hidden assumptions, proposes competing solutions, stress-tests each one. Useful when a decision is expensive to get wrong. 8,383installs documentation-expert This subagent creates, updates, and maintains project documentation, from README files to API references. Use it when docs need structure or a refresh. 6,992installs task-decomposition-expert Breaks down complex multi-step goals into a structured work breakdown structure with dependency graphs, effort estimates, and handoff plans. 6,870installs create-architecture-documentation A Claude slash command that turns your repo into architecture documentation: diagrams, ADRs and component descriptions. 6,136installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor