Mac notifications for blocked and finished tasks
By Jake Marsh, who builds Taskhold. Updated 2026-10-26. Facts about other tools checked 2026-10-26. 3 min read.
The live board can send desktop notifications, but only while its tab is open. This script runs in a terminal and posts a native macOS notification whenever an agent blocks or finishes a task; clicking it opens the board.
Want a glance instead of an alert? See the menu bar plugin. Away from the Mac, use ntfy.
What you get
One macOS notifications message when an agent blocks a task with a question, and one when it finishes a whole task (not each step). Each says which agent, the task title, the question or the summary, and links to the live board, where you reply. Your own changes never trigger a message.
Before you begin
- terminal-notifier: brew install terminal-notifier.
- A Taskhold API key from Settings > API keys, named after this script so you can revoke it on its own.
- bash, curl and jq on the machine that runs the script.
The script
Save this as taskhold-mac.sh and make it executable (chmod +x). The top half is the macOS notifications part; the loop below it is the same for every notifier.
#!/bin/bash
# taskhold-mac.sh: show a macOS notification when an agent blocks or finishes a Taskhold task.
# Needs curl and jq. Run: TASKHOLD_API_KEY=atd_sk_... ./taskhold-mac.sh
key=${TASKHOLD_API_KEY:?set TASKHOLD_API_KEY}
board=https://taskhold.com/dashboard/live
last=""
notify() { # kind, title, detail, agent
if [ "$1" = blocked ]; then h="$4 needs you"; else h="$4 finished a task"; fi
terminal-notifier -title Taskhold -subtitle "$h" -message "$2${3:+: $3}" \
-group "taskhold-$1" -open "$board"
}
while :; do
while IFS= read -r line; do
case "$line" in
"id: "*) last=${line#id: } ;;
"data: "*)
e=${line#data: }
# Agents only: a task (not a step) finished, or any task or step blocked.
jq -e '.type == "task.status" and .actor == "agent" and (.data.to == "blocked" or (.data.to == "done" and .task_id == .root_task_id))' <<<"$e" >/dev/null || continue
kind=$(jq -r .data.to <<<"$e")
title=$(jq -r '.task_title // "a task"' <<<"$e")
agent=$(jq -r '.actor_name // "An agent"' <<<"$e")
detail=$(jq -r 'if .data.to == "blocked" then .data.blocked_reason else .data.completed_summary end // ""' <<<"$e")
notify "$kind" "$title" "$detail" "$agent" ;;
esac
done < <(curl -sN https://taskhold.com/api/events/stream -H "Authorization: Bearer $key" ${last:+-H "Last-Event-ID: $last"})
sleep 3
doneRun it anywhere a process can stay up, such as a spare terminal, a tmux window or a small server:
TASKHOLD_API_KEY=atd_sk_... ./taskhold-mac.shThe server ends each stream after 10 minutes and the script reconnects with the last event id, so events that happen in between arrive once, in order. Details on the stream: events and the live stream.
One limit to know
Notifications only arrive while the Mac is awake and the script is running. After sleep the script reconnects from the last event it saw and catches up, but a restarted script starts from now. -group replaces the previous notification of the same kind, so a burst of finished tasks shows as one, the latest. Without terminal-notifier, osascript -e 'display notification ...' works too, but clicking it doesn't open the board.
See how far along your coding agents are.
$12/month or $120/year after the trial. Card up front. Cancel before day 7 and you pay nothing. Every agent you run is included.
Sources
- terminal-notifier README, checked 2026-10-26
- Apple: displaying notifications from scripts, checked 2026-10-26
Related
Updated 2026-10-26. Something wrong or out of date? Email hello@greatwork.company.