tmux/claude: desktop notification when a background session needs attention #3

Open
opened 2026-06-03 18:19:35 +00:00 by jmz · 0 comments
Owner

Context

The tmux-claude-status.sh hook already records per-window @claude_status
(busy/idle/waiting/prompt) on UserPromptSubmit/Stop/Notification.
Today the only signal is a small marker on the tmux tab — invisible when you're
focused on another window or another app.

Proposal

When a window enters prompt (blocked on a permission decision) or waiting
(idle-nudge) and that window is not the active/attached one, also fire a
desktop notification so background sessions can pull your attention.

Implementation sketch

  • Extend dot_claude/hooks/tmux-claude-status.sh: after setting @claude_status,
    compare $TMUX_PANE's window vs #{active} / the attached client's current
    window; if not active, emit a notification.
  • Notification transport on Ghostty: OSC 777 / OSC 9 desktop notification, or
    shell out to terminal-notifier (title = /rename session name, body = state).
  • Debounce so the same state doesn't re-notify on every event.

Effort

Small (~15–25 lines in the existing hook).

Part of the "attention routing" bundle (see the jump-to-attention and
status-summary issues).

## Context The `tmux-claude-status.sh` hook already records per-window `@claude_status` (`busy`/`idle`/`waiting`/`prompt`) on `UserPromptSubmit`/`Stop`/`Notification`. Today the only signal is a small marker on the tmux tab — invisible when you're focused on another window or another app. ## Proposal When a window enters `prompt` (blocked on a permission decision) or `waiting` (idle-nudge) **and that window is not the active/attached one**, also fire a desktop notification so background sessions can pull your attention. ## Implementation sketch - Extend `dot_claude/hooks/tmux-claude-status.sh`: after setting `@claude_status`, compare `$TMUX_PANE`'s window vs `#{active}` / the attached client's current window; if not active, emit a notification. - Notification transport on Ghostty: `OSC 777` / `OSC 9` desktop notification, or shell out to `terminal-notifier` (title = `/rename` session name, body = state). - Debounce so the same state doesn't re-notify on every event. ## Effort Small (~15–25 lines in the existing hook). Part of the "attention routing" bundle (see the jump-to-attention and status-summary issues).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jmz/dotfiles-public#3
No description provided.