Skip to content

hta218/claude-code-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Claude Code Notification

πŸ“’ Send system notifications when Claude Code requests permissions or completes tasks

A cross-platform notification script that integrates with Claude Code to show system notifications for various events like session completions and permission requests.

Installation

Step 1: Install terminal-notifier (macOS only)

brew install terminal-notifier

Step 2: Create the script file

curl -o ~/.claude/claude-code-notifier.sh https://raw.githubusercontent.com/hta218/claude-code-notifier/main/claude-code-notifier.sh

Step 3: Make it executable (macOS/Linux)

chmod +x ~/.claude/claude-code-notifier.sh

Note: Windows users can skip this step.

Step 4: Enable notifications on your system

Make sure notifications are enabled for Terminal/your shell application in your system settings.

Enable Terminal Notifications

Step 5: Add configuration to Claude settings

Create or edit ~/.claude/settings.json and add:

{
  "hooks": {
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/claude-code-notifier.sh"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/claude-code-notifier.sh"
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/claude-code-notifier.sh"
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/claude-code-notifier.sh"
          }
        ]
      }
    ]
  }
}

Step 6: Restart Claude Code

Restart Claude Code to apply the changes then simply prompt 'Hello' to see notifications in action.

Usage

Once installed, the script will automatically trigger notifications with default System sounds when Claude Code:

  • Starts sessions (SessionStart hook)
  • Requests permissions or user input (Notification hook)
  • Completes tasks or responses (Stop hook)
  • Ends sessions (SessionEnd hook)

Notification Preview

Event Types

The script handles different notification types:

  • SessionStart: Shows "Session started πŸš€"
  • SessionEnd: Shows "Session completed βœ…"
  • Stop: Shows "Response finished 🏁"
  • Notification: Shows the original message from Claude
  • Other events: Shows the event name with the message

Requirements

macOS (recommended)

  • terminal-notifier for pushing notifications
  • jq for JSON processing
  • Install: brew install terminal-notifier jq

Linux

  • notify-send (usually pre-installed)
  • Install if missing: sudo apt install libnotify-bin

Windows

  • PowerShell (built-in on modern Windows)
  • Uses Windows Toast notifications

Customization

You can modify the script to:

  • Change notification messages
  • Add different sounds
  • Log notifications to a file (uncomment the last line)
  • Customize notification appearance

Contributing

Feel free to submit issues and pull requests to improve the script!

About

πŸ“’ Send system notifications when Claude Code requests permissions or completes tasks

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages