Claude Code
Notify when Claude Code finishes a session — or when it needs permission or your input.
Before you start
- Shared
trigv-notify.shscript export TRIGV_API_KEY=trgv_…in~/.zshrcor~/.bashrc
Step 1 — Create the hook script
Create ~/.claude/hooks/trigv-stop.sh:
Code
#!/usr/bin/env bash
set -euo pipefail
INPUT=$(cat)
CWD=$(echo "$INPUT" | jq -r '.cwd // empty')
NAME=$(basename "${CWD:-claude}")
TRIGV_LEVEL=success "${HOME}/.local/bin/trigv-notify.sh" \
"Claude: ${NAME} done" \
"Session finished — open terminal to review" Run: chmod +x ~/.claude/hooks/trigv-stop.sh
Step 2 — Add hooks to settings
Edit ~/.claude/settings.json:
Code
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "~/.claude/hooks/trigv-stop.sh",
"async": true
}]
}],
"Notification": [{
"matcher": "permission_prompt|idle_prompt",
"hooks": [{
"type": "command",
"command": "TRIGV_LEVEL=warning ~/.local/bin/trigv-notify.sh 'Claude: needs you' 'Waiting for input'",
"async": true
}]
}]
}
} Step 3 — Test
- Start a Claude Code session and let it complete a task.
- For Notification, trigger a permission prompt and check your phone.
Team projects
You can put .claude/settings.json in a repo — don’t commit API keys; each developer uses their own TRIGV_API_KEY.