# cmux notifications for blocked and finished tasks

> Light up a cmux pane and its sidebar tab when a coding agent blocks or finishes a Taskhold task, with cmux notify and one bash script.

Source: https://taskhold.com/integrations/cmux
Last updated: 2026-11-23

cmux is a macOS terminal built for running coding agents side by side. Its notify command puts a ring on a pane, a badge on its sidebar tab and an entry in the Notifications panel. This script follows Taskhold's event stream and calls cmux notify whenever an agent blocks a task with a question or finishes one, with a link to the [live board](https://taskhold.com/demo/live), so a question from any agent, on any machine, shows up in the cmux window you're already looking at.

Agents in plain terminals? See [Mac notifications](https://taskhold.com/integrations/macos-notifications) or a [tmux board pane](https://taskhold.com/integrations/tmux). Answering the question is covered in [answering a blocked coding agent](https://taskhold.com/guides/answer-a-blocked-coding-agent).

## What you get

An entry titled "Taskhold: <task>" with "<agent> needs you" or "<agent> finished a task" as the subtitle and the question or summary plus the live board link as the body. cmux also shows a macOS banner, rings the script's pane and badges its tab; Cmd+Shift+U jumps to it.

taskhold-cmux.sh reacts only to agents: a step finishing, or an edit you make yourself, sends nothing.

## Before you begin

- cmux, with its cmux command on your PATH (run cmux notify --title test in a cmux terminal to check).
- A Taskhold API key named "cmux" (Settings > API keys). The script only reads events with it, so revoking it stops the alerts without touching your agents.
- curl ships with macOS. jq does too from macOS 15; on older versions, brew install jq.

## The script

The cmux part is the notify() function:

```bash
notify() { # kind, title, detail, agent
  if [ "$1" = blocked ]; then s="$4 needs you"; else s="$4 finished a task"; fi
  cmux notify --title "Taskhold: $2" --subtitle "$s" --body "${3:-No details} $board"
}
```

Around it, taskhold-cmux.sh reads Taskhold's event stream and keeps only agents' blocked and finished tasks. Save the whole file and run chmod +x taskhold-cmux.sh.

```bash
#!/bin/bash
# taskhold-cmux.sh: cmux notify when an agent blocks or finishes a Taskhold task.
# Needs curl and jq. Run: TASKHOLD_API_KEY=atd_sk_... ./taskhold-cmux.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 s="$4 needs you"; else s="$4 finished a task"; fi
  cmux notify --title "Taskhold: $2" --subtitle "$s" --body "${3:-No details} $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
done
```

Run it in a cmux terminal: cmux notify talks to the cmux window it runs in. Give it its own pane or workspace and leave it open:

```bash
TASKHOLD_API_KEY=atd_sk_... ./taskhold-cmux.sh
```

Every 10 minutes the server closes the stream; taskhold-cmux.sh reconnects from the last event id it saw, so a task that blocks in between still reaches cmux once. More on the stream: [events and the live stream](https://taskhold.com/docs/events).

## One limit to know

cmux files each notification under the pane that sent it, so the ring and badge land on the script's pane, not on the pane of the agent that blocked. The subtitle names the agent; to land everything in one place, start the script in a workspace of its own. Like any script on the Mac, it only hears events while the Mac is awake; after sleep it reconnects from the last event it saw and catches up.

## Sources

- [cmux docs: notifications](https://github.com/manaflow-ai/cmux/blob/main/docs/notifications.md), checked 2026-10-26
- [cmux README](https://github.com/manaflow-ai/cmux), checked 2026-10-26

## Related

- [Mac notifications when a coding agent is blocked](https://taskhold.com/integrations/macos-notifications.md)
- [Taskhold in tmux: status bar and a live board pane](https://taskhold.com/integrations/tmux.md)
- [Use Taskhold with Claude Squad](https://taskhold.com/integrations/claude-squad.md)
- [Answer a blocked coding agent from your phone](https://taskhold.com/guides/answer-a-blocked-coding-agent.md)

## About Taskhold

Taskhold is a hosted task list shared by a person and their AI coding agents over MCP. Agents break tasks into steps and report progress, and the person watches a live board. $12/month or $120/year per person, 7-day trial with a card, no free plan. Made by Great Work LLC.

To try it, add the MCP server https://taskhold.com/api/mcp to your agent. It connects with no sign-up, and the first time the agent uses Taskhold it gives you a link to start the trial.

- Pricing: https://taskhold.com/pricing.md
- Agent index: https://taskhold.com/llms.txt
