Skip to content

Commit 5798fa6

Browse files
ZhaoChaoqunclaude
andcommitted
fix: use Stop hook instead of Notification for plugin compatibility
Plugin hooks.json does not support the Notification event type. Switch to Stop hook which fires when Claude finishes and waits for user input — the exact moment a notification is needed. Also remove extra quotes from command path and drop the now-irrelevant notification_type filter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1d1eeed commit 5798fa6

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

claude-notify/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ claude plugin install /path/to/claude-notify
4040
## How It Works
4141

4242
```
43-
Claude Code fires Notification hook
43+
Claude Code fires Stop hook (task complete, waiting for input)
4444
|
4545
notify.py reads hook input
4646
|

claude-notify/hooks/hooks.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"hooks": {
3-
"Notification": [
3+
"Stop": [
44
{
5-
"matcher": "*",
65
"hooks": [
76
{
87
"type": "command",
9-
"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/notify.py\""
8+
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/notify.py"
109
}
1110
]
1211
}

claude-notify/notify.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ def main():
188188
except (json.JSONDecodeError, ValueError):
189189
data = {}
190190

191-
# Skip permission_prompt — PermissionRequest hook handles it
192-
if data.get("notification_type") == "permission_prompt":
193-
sys.exit(0)
194-
195191
tty = get_tty()
196192
pid = os.getppid()
197193
terminal = detect_terminal(pid)

0 commit comments

Comments
 (0)