Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions claude/hooks/agent-notify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Claude Code hook dispatcher. Prefers signalbox (which fires the session
# event AND applies the tmux signals itself); falls back to the plain tmux
# notify behaviour when signalbox is not installed. Always exits 0 — a
# notifier must never break the agent that calls it.
# exec (stdin passes straight through): one less shell in the process tree,
# so signalbox can identify the agent process for its liveness tracking.
if command -v signalbox >/dev/null 2>&1; then
exec signalbox hook claude 2>/dev/null
fi

payload="$(cat)"

# No signalbox on this machine: keep the original in-terminal signals.
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
case "$payload" in
*'"hook_event_name":"Notification"'*) "$dir/tmux-notify.sh" 2>/dev/null ;;
*'"hook_event_name":"UserPromptSubmit"'*) "$dir/tmux-notify.sh" clear 2>/dev/null ;;
esac
exit 0
36 changes: 33 additions & 3 deletions claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,17 @@
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/tmux-notify.sh"
"command": "~/.claude/hooks/agent-notify.sh"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/agent-notify.sh"
}
]
}
Expand All @@ -73,7 +83,27 @@
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/tmux-notify.sh clear"
"command": "~/.claude/hooks/agent-notify.sh"
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/agent-notify.sh"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/agent-notify.sh"
}
]
}
Expand Down Expand Up @@ -159,4 +189,4 @@
"alwaysThinkingEnabled": true,
"skipDangerousModePermissionPrompt": true,
"effortLevel": "xhigh"
}
}