feat: add macOS desktop notification Stop hook

Add a new Stop hook that sends a native macOS notification with the
task summary (first line of last_assistant_message) when Claude finishes
responding. Uses osascript via spawnSync for shell injection safety.
Supports run-with-flags fast require() path. Only active on standard
and strict profiles; silently skips on non-macOS platforms.
This commit is contained in:
Jonghyeok Park
2026-03-24 10:17:42 +09:00
parent 7f7e319d9f
commit 445ae5099d
3 changed files with 101 additions and 0 deletions

View File

@@ -289,6 +289,18 @@
}
],
"description": "Track token and cost metrics per session"
},
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/run-with-flags.js\" \"stop:desktop-notify\" \"scripts/hooks/desktop-notify.js\" \"standard,strict\"",
"async": true,
"timeout": 5
}
],
"description": "Send macOS desktop notification with task summary when Claude responds"
}
],
"SessionEnd": [