Skip to main content

Send Claude Code hook notifications to ntfy.sh

Project description

claude-code-ntfy-notification-hook

A Claude Code hook that forwards Notification events to an ntfy.sh topic as push notifications.

Installation

pip install claude-code-ntfy-notification-hook

Usage

Configure Claude Code to call send-ntfy-claude-notification as a hook for Notification events. In your Claude Code settings (.claude/settings.json or ~/.claude/settings.json):

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "send-ntfy-claude-notification my-ntfy-topic"
          }
        ]
      }
    ]
  }
}

Replace my-ntfy-topic with your ntfy.sh topic name.

Configuration

A YAML configuration file can be placed at $XDG_CONFIG_HOME/send-ntfy-claude-notification/config.yaml (typically ~/.config/send-ntfy-claude-notification/config.yaml):

topic: my-ntfy-topic        # Default topic (overridden by CLI argument)
server: https://ntfy.sh     # ntfy.sh server URL
priority: 3                 # 1 (min) – 5 (urgent)
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Claude_AI_symbol.svg/250px-Claude_AI_symbol.svg.png
log_level: WARNING          # DEBUG / INFO / WARNING / ERROR / CRITICAL
log_file: ""                # Leave empty to log to stdout

Notification type emoji mapping

notification_type ntfy.sh emoji tag
permission_prompt warning ⚠️
idle_prompt hourglass_flowing_sand
auth_success white_check_mark
elicitation_dialog speech_balloon 💬
elicitation_complete tada 🎉
elicitation_response incoming_envelope 📨

Command-line reference

usage: send-ntfy-claude-notification [-h] [--server SERVER] [--priority {1-5}]
                                     [--icon ICON] [--log-file PATH]
                                     [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                                     [-v]
                                     [topic]

positional arguments:
  topic                 ntfy.sh topic name (required if not set in config)

options:
  --server SERVER       ntfy.sh server base URL (default: https://ntfy.sh)
  --priority {1-5}      Notification priority 1 (min) – 5 (urgent) (default: 3)
  --icon ICON           Icon URL attached to the notification
  --log-file PATH       Write logs to this file instead of stdout
  --log-level ...       Minimum log level (default: WARNING)
  -v, --verbose         Enable verbose output (overrides --log-level to DEBUG)

License

GPL-3.0-or-later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_code_ntfy_notification_hook-1.0.0.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file claude_code_ntfy_notification_hook-1.0.0.tar.gz.

File metadata

File hashes

Hashes for claude_code_ntfy_notification_hook-1.0.0.tar.gz
Algorithm Hash digest
SHA256 739eb2107e66663097711edd63066a1d61024453e9b75033261302d89891a251
MD5 acb13c5c60139a7ca150c3fdf06f023b
BLAKE2b-256 afee7545fe5554e505b0fddca2741d85a3693da6aa1e9cecd22bd45714b79e7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_ntfy_notification_hook-1.0.0.tar.gz:

Publisher: release.yml on gene1wood/claude-code-ntfy-notification-hook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_code_ntfy_notification_hook-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_code_ntfy_notification_hook-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a873cb7aa731cb2a4c00da367ee216dad1b8f643e5518c96697a3f9c903d9aa1
MD5 9e6a1df08afc69897fc733805c4d1399
BLAKE2b-256 f8ad87382edc83ead3bd8908fcd40bf560bd32f5943a9ae824cb9adafc98f5db

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_ntfy_notification_hook-1.0.0-py3-none-any.whl:

Publisher: release.yml on gene1wood/claude-code-ntfy-notification-hook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page