mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
7d83fa8647
The PostToolUse hook with a wildcard matcher fires on every single tool call, flooding the user with dozens of notifications per turn. Replace with Stop (fires once when Claude finishes) and Notification (fires when Claude needs user input), matching the pattern already used by discord-notifications and slack-notifications hooks.
25 lines
987 B
JSON
25 lines
987 B
JSON
{
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
} |