MCPcopy Index your code
hub / github.com/777genius/claude-notifications-go

github.com/777genius/claude-notifications-go @v1.40.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.40.0 ↗ · + Follow
1,499 symbols 6,438 edges 121 files 703 documented · 47%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Claude Notifications (plugin)

Ubuntu CI macOS CI Windows CI Go Report Card codecov

image image image

Smart notifications for Claude Code with click-to-focus, git branch display, and webhook integrations.

Boost your productivity — check out the advanced task manager for Claude with a convenient UI, from the creator of this plugin.

Table of Contents

Features

  • Cross-platform: macOS (Intel & Apple Silicon), Linux (x64 & ARM64), Windows 10+ (x64)
  • 6 notification types: Task Complete, Review Complete, Question, Plan Ready, Session Limit, API Error
  • Click-to-focus (macOS, Linux): click notification to focus the exact project window and tab — Ghostty, VS Code, iTerm2, Warp, kitty, WezTerm, Alacritty, Hyper, Apple Terminal, GNOME Terminal, Konsole, Tilix, Terminator, XFCE4 Terminal, MATE Terminal
  • Multiplexers: tmux (including iTerm2 -CC integration mode), zellij, WezTerm, kitty — click switches to the correct session/pane/tab
  • Git branch in title: ✅ Completed main [cat]
  • Sounds: MP3/WAV/FLAC/OGG/AIFF, volume control, audio device selection
  • Webhooks: Slack, Discord, Telegram, Lark/Feishu, Microsoft Teams, ntfy.sh, PagerDuty, Zapier, n8n, Make, custom — with retry, circuit breaker, rate limiting (docs)
  • Plugin compatibility: works with double-shot-latte and other plugins that spawn background Claude instances

Installation

Prerequisites

  • Claude Code
  • Windows users: Git Bash (included with Git for Windows)
  • macOS/Linux users: No additional software required

Quick Install (Recommended)

One command to install everything:

curl -fsSL https://raw.githubusercontent.com/777genius/claude-notifications-go/main/bin/bootstrap.sh | bash

Windows users: run this from Git Bash. If you run it from PowerShell and bash opens WSL, the installer would target Linux paths and binaries instead of Windows.

Then restart Claude Code and optionally run /claude-notifications-go:settings to configure sounds.

The binary is downloaded once and cached locally. You can re-run /claude-notifications-go:settings anytime to reconfigure.

If the bootstrap script doesn't work for your environment, use the Manual Install steps below inside Claude Code.

Manual Install

Step-by-step installation inside Claude Code (if bootstrap doesn't work)

Run these slash commands in the Claude Code chat, not in your system terminal:

# 1) Add marketplace
/plugin marketplace add 777genius/claude-notifications-go
# 2) Install plugin
/plugin install claude-notifications-go@claude-notifications-go
# 3) Restart Claude Code
# 4) Download binary
/claude-notifications-go:init
# 5) (Optional) Configure sounds and settings
/claude-notifications-go:settings

Having issues with installation? See Troubleshooting.

Updating

Run the same command as for installation — it will update both the plugin and the binary:

curl -fsSL https://raw.githubusercontent.com/777genius/claude-notifications-go/main/bin/bootstrap.sh | bash

Then restart Claude Code to apply the new version. Your settings in ~/.claude/claude-notifications-go/config.json are preserved across updates.

Manual update (if bootstrap didn't work)

Claude Code also periodically checks for plugin updates automatically. Binaries are updated on the next hook invocation when a version mismatch is detected.

To update manually via Claude Code UI:

  1. Run /plugin, select Marketplaces, choose claude-notifications-go, then select Update marketplace
  2. Select Installed, choose claude-notifications-go, then select Update now

If the binary auto-update didn't work (e.g. no internet at the time), run /claude-notifications-go:init to download it manually. If hook definitions changed in the new version, restart Claude Code to apply them.

Supported Notification Types

Status Icon Description Trigger
Task Complete Main task completed Stop/SubagentStop hooks (state machine detects active tools like Write/Edit/Bash, or ExitPlanMode followed by tool usage)
Review Complete 🔍 Code review finished Stop/SubagentStop hooks (state machine detects only read-like tools: Read/Grep/Glob with no active tools, plus long text response >200 chars)
Question Claude has a question PreToolUse hook (AskUserQuestion) OR Notification hook
Plan Ready 📋 Plan ready for approval PreToolUse hook (ExitPlanMode)
Session Limit Reached ⏱️ Session limit reached Stop/SubagentStop hooks (state machine detects "Session limit reached" text in last 3 assistant messages)
API Error 🔴 Authentication expired, rate limit, server error, connection error Stop/SubagentStop hooks (state machine detects via isApiErrorMessage flag + error field from JSONL)

Platform Support

Supported platforms: - macOS (Intel & Apple Silicon) - Linux (x64 & ARM64) - Windows 10+ (x64)

No additional dependencies: - ✅ Binaries auto-download from GitHub Releases - ✅ Pure Go - no C compiler needed - ✅ All libraries bundled - ✅ Works offline after first setup

Windows-specific features: - Native Toast notifications (Windows 10+) - Works in PowerShell, CMD, Git Bash, or WSL - MP3/WAV/OGG/FLAC audio playback via native Windows APIs - System sounds not accessible - use built-in MP3s or custom files

Click-to-Focus (macOS & Linux)

Clicking a notification activates your terminal window. Auto-detects terminal and platform.

macOS — via AX API with bundle ID detection:

Terminal Focus method
Ghostty Exact tab focus via Ghostty AppleScript, with AXDocument fallback
VS Code / Insiders / Cursor AXTitle (focus-window subcommand)
iTerm2 Exact tab/pane targeting via iTerm2 Python API when available, otherwise app-level iTerm activation
Warp, kitty, WezTerm, Alacritty, Hyper, Apple Terminal AXTitle (focus-window subcommand)
Any other (custom terminalBundleId) AXTitle (focus-window subcommand)

Linux — via D-Bus daemon with automatic compositor detection:

Terminal Supported compositors
VS Code GNOME, KDE, Sway, X11
GNOME Terminal, Konsole, Alacritty, kitty, WezTerm, Tilix, Terminator, XFCE4 Terminal, MATE Terminal GNOME, KDE, Sway, X11
Any other Fallback by name

Linux focus methods (tried in order): GNOME extension, GNOME Shell Eval, GNOME FocusApp, wlrctl (Sway/wlroots), kdotool (KDE), xdotool (X11).

Multiplexers (both platforms): tmux (including iTerm2 -CC integration mode), zellij, WezTerm, kitty — click switches to the correct pane/tab.

iTerm2 note: to open the exact iTerm2 tab or split pane, enable iTerm2 > Settings > General > Magic > Enable Python API. If you just toggled it, restart iTerm2 once. Without the Python API, the plugin falls back to app-level iTerm activation instead of exact tab targeting.

Windows — clicking a notification raises the originating terminal window (Windows Terminal, VS Code, conhost, …) via a protocol-activated toast. Window-level only: tab/split-pane targeting isn't possible (one window hosts all tabs), and picking among multiple WT windows in one process is best-effort. See the guide for details.

See Click-to-Focus Guide for configuration details.

Configuration

Run /claude-notifications-go:settings to configure sounds, volume, webhooks, and other options via an interactive wizard. You can re-run it anytime to reconfigure.

Manual Configuration

Config file location:

Platform Path
macOS / Linux ~/.claude/claude-notifications-go/config.json
Windows (Git Bash) ~/.claude/claude-notifications-go/config.json
Windows (PowerShell) $env:USERPROFILE\.claude\claude-notifications-go\config.json

Edit the config file directly:

{
  "notifications": {
    "desktop": {
      "enabled": true,
      "sound": true,
      "volume": 1.0,
      "audioDevice": "",
      "clickToFocus": true,
      "terminalBundleId": "",
      "appIcon": "${CLAUDE_PLUGIN_ROOT}/claude_icon.png"
    },
    "webhook": {
      "enabled": false,
      "preset": "slack",
      "url": "",
      "chat_id": "",
      "format": "json",
      "headers": {},
      "payloadFields": {}
    },
    "suppressQuestionAfterTaskCompleteSeconds": 12,
    "suppressQuestionAfterAnyNotificationSeconds": 7,
    "notifyOnSubagentStop": false,
    "suppressForSubagents": true,
    "notifyOnTextResponse": true,
    "respectJudgeMode": true,
    "notifyOnlyWhenUnfocused": false,
    "notifyDelaySeconds": 0,
    "suppressFilters": [
      {
        "name": "Suppress ClaudeProbe completions (remote-control)",
        "status": "task_complete",
        "gitBranch": "",
        "folder": "ClaudeProbe"
      }
    ]
  },
  "statuses": {
    "task_complete": {
      "title": "✅ Completed",
      "sound": "${CLAUDE_PLUGIN_ROOT}/sounds/task-complete.mp3"
    },
    "review_complete": {
      "title": "🔍 Review",
      "sound": "${CLAUDE_PLUGIN_ROOT}/sounds/review-complete.mp3"
    },
    "question": {
      "title": "❓ Question",
      "sound": "${CLAUDE_PLUGIN_ROOT}/sounds/question.mp3"
    },
    "plan_ready": {
      "title": "📋 Plan",
      "sound": "${CLAUDE_PLUGIN_ROOT}/sounds/plan-ready.mp3"
    },
    "session_limit_reached": {
      "title": "⏱️ Session Limit Reached",
      "sound": "${CLAUDE_PLUGIN_ROOT}/sounds/error.mp3"
    },
    "api_error": {
      "title": "🔴 API Error: 401",
      "sound": "${CLAUDE_PLUGIN_ROOT}/sounds/error.mp3"
    },
    "api_error_overloaded": {
      "title": "🔴 API Error",
      "sound": "${CLAUDE_PLUGIN_ROOT}/sounds/error.mp3"
    }
  }
}
Option Default Description
notifyOnSubagentStop false Send notifications when subagents (Task tool) complete. Has no effect unless suppressForSubagents is also set to false.
suppressForSubagents true Suppress subagent (SubagentStop) notifications, plus any Stop notification whose transcript is a subagent/teammate transcript. Detection uses the hook event for SubagentStop (Claude Code passes the parent session transcript_path to that hook, so a path check alone can't identify it). Set to false together with notifyOnSubagentStop: true to get a notification each time a subagent finishes.
notifyOnTextResponse true Send notifications for text-only responses (no tool usage)
respectJudgeMode true Honor CLAUDE_HOOK_JUDGE_MODE=true env var to suppress notifications
notifyOnlyWhenUnfocused false Skip the desktop notification only when the focused terminal window can be matched to the current Claude Code session. Best-effort per platform; if focus can't be determined the notification is still shown.
notifyDelaySeconds 0 Wait N seconds before delivering a desktop notification (capped at 25s by the hook timeout). With notifyOnlyWhenUnfocused, focus is re-checked after the wait. Webhooks are unaffected.
suppressQuestionAfterTaskCompleteSeconds 12 Suppress question notifications for N seconds after task complete
suppressQuestionAfterAnyNotificationSeconds 7 Suppress question notifications for N seconds after any notification
suppressFilters [] Array of rules to suppress notifications by status, git branch, and/or folder. Each rule is an AND of its fields; omitted fields match any value. Set gitBranch to "" to match sessions outside git repos.

Each status can be individually disabled by adding "enabled": false.

You can also override individu

Extension points exported contracts — how you extend this code

Formatter (Interface)
Formatter renders a SendContext into a preset-specific webhook payload. Implementations should treat ctx.Message as the [4 …
internal/webhook/formatters.go
RetryableFunc (FuncType)
RetryableFunc is a function that can be retried
internal/webhook/retry.go

Core symbols most depended-on inside this repo

Error
called by 169
internal/logging/logging.go
Run
called by 163
internal/daemon/server.go
Debug
called by 99
internal/logging/logging.go
Error
called by 90
internal/notifier/notifier.go
DefaultConfig
called by 81
internal/config/config.go
Close
called by 79
internal/hooks/hooks.go
HandleHook
called by 66
internal/hooks/hooks.go
Format
called by 66
internal/webhook/formatters.go

Shape

Function 1,214
Method 190
Struct 84
TypeAlias 5
Interface 3
Class 2
FuncType 1

Languages

Go99%
Python1%

Modules by API surface

internal/notifier/notifier_test.go81 symbols
internal/hooks/hooks_test.go79 symbols
internal/config/config_test.go59 symbols
internal/daemon/mappings_test.go57 symbols
internal/summary/summary_test.go48 symbols
pkg/jsonl/jsonl_test.go43 symbols
internal/config/config.go42 symbols
internal/state/state_test.go39 symbols
internal/notifier/notifier.go32 symbols
internal/daemon/focus.go28 symbols
pkg/jsonl/jsonl.go26 symbols
internal/webhook/webhook_test.go26 symbols

For agents

$ claude mcp add claude-notifications-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page