闲社服务运行正常AI智能体自动化平台
c

Claude通知

技能标识:claude-notifications

Set up native macOS notifications for Claude Code on local and devpod/remote environments. Use when the user asks to 'setup notifications', 'configure devpod notifications', 'get notified when Claude needs attention', 'setup claude alerts', or 'install notification hooks'. Handles local terminal-notifier, SSH reverse tunnel for devpods, launchd listener, tmux passthrough, and Claude Code hook configuration.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

Claude通知

Claude Code 通知设置

为 Claude Code 设置原生 macOS 通知 — 既支持本地使用,也支持通过 SSH 反向隧道在远程开发容器上使用。当 Claude 需要权限、等待输入或需要 MCP 交互时,会发出带声音的提醒。

功能说明

  • - 本地:当 Claude 需要权限、进入空闲状态或需要 MCP 输入时,使用 terminal-notifier 发送原生 macOS 通知
  • 开发容器:通过 SSH 反向隧道将远程开发容器的通知路由到本地的 terminal-notifier,并支持 OSC 9 回退方案
  • 钩子:为 permissionprompt、idleprompt 和 elicitation_dialog 配置 Claude Code 通知钩子

平台

仅限 macOS。 如果在 Linux/开发容器上运行,设置脚本将显示明确错误并退出。它使用 brew、launchctl 和 terminal-notifier — 均为 macOS 专属。脚本通过 SSH 进入开发容器进行远程配置,因此开发容器设置也是在 Mac 上完成的。

重要提示:仅在本地 Mac 上运行

请务必确认用户在本地 Mac 上运行此程序,而不是在开发容器中。 整个设置过程(包括开发容器配置)都是从本地机器通过 SSH 完成的。脚本通过 SSH 进入开发容器进行远程配置。如果用户在开发容器中,请要求他们先切换到本地 Mac 终端。

设置流程

1. 询问开发容器 SSH 主机

询问用户要配置哪些开发容器。示例主机:username.devpod-ind、username-web.devpod-ind。如果仅本地设置,则跳过开发容器参数。

2. 运行设置脚本

bash

仅本地


python3 scripts/setup_notifications.py

本地 + 开发容器

python3 scripts/setup_notifications.py --devpod --devpod

从技能目录运行:~/.claude/skills/claude-notifications/

脚本处理以下事项:

  • - 如果缺少 terminal-notifier,通过 brew 安装
  • 将 notify.py 复制到 ~/.claude/scripts/
  • 通过 launchd 创建并启动反向隧道监听器(notify-listener.py)
  • 为每个开发容器在 ~/.ssh/config 中添加 RemoteForward 19876
  • 将 notify.py 复制到每个开发容器并配置 Claude Code 钩子
  • 在每个开发容器的 ~/.tmux.conf 中添加 set -g allow-passthrough on
  • 在 ~/.claude/settings.json 中配置 Claude Code 通知钩子
  • 发送测试通知

3. 提醒用户手动步骤

脚本完成后,务必告知用户以下必需的手动步骤:

  1. 1. 为终端启用通知:系统设置 > 通知 > [Warp / iTerm / 终端]。确保允许通知已开启,提醒样式设置为提醒或横幅。
  2. 为脚本编辑器启用通知:系统设置 > 通知 > 脚本编辑器(terminal-notifier 通过它路由)。
  3. 关闭勿扰模式或将脚本编辑器和终端应用添加到专注例外。
  4. 重新连接开发容器的 SSH 会话 — 现有会话没有反向隧道。新会话会自动获取。

架构

┌─────────────────────────────────────────────────┐
│ 开发容器(远程) │
│ │
│ Claude Code 钩子 → notify.py │
│ → curl localhost:19876(反向隧道) │
│ → 回退方案:OSC 9 转义序列 │
└──────────────────┬──────────────────────────────┘
│ SSH RemoteForward 19876
┌──────────────────▼──────────────────────────────┐
│ 本地 Mac │
│ │
│ notify-listener.py(launchd,端口 19876) │
│ → terminal-notifier → macOS 通知中心 │
└─────────────────────────────────────────────────┘

故障排除

  • - 没有显示通知:检查系统设置 > 通知,确保终端应用和脚本编辑器的通知都已启用
  • 勿扰模式阻止:将脚本编辑器添加到专注例外,或关闭勿扰模式
  • 监听器未运行:launchctl list | grep claude 和 lsof -i :19876
  • 重启监听器:launchctl unload ~/Library/LaunchAgents/com.claude.notify-listener.plist && launchctl load ~/Library/LaunchAgents/com.claude.notify-listener.plist
  • 监听器日志:cat ~/.claude/logs/notify-listener.log
  • 本地测试:python3 ~/.claude/scripts/notify.py test --title Claude Code --sound Glass
  • 测试开发容器隧道:在开发容器的 tmux 会话中:python3 ~/.claude/scripts/notify.py test --title Claude Code --sound Glass
  • 调试模式:DEBUG=1 python3 ~/.claude/scripts/notify.py test

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 claude-notifications-1776106346 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 claude-notifications-1776106346 技能

通过命令行安装

skillhub install claude-notifications-1776106346

下载

⬇ 下载 claude-notifications v1.0.0(免费)

文件大小: 20.17 KB | 发布时间: 2026-4-14 12:32

v1.0.0 最新 2026-4-14 12:32
claude-notifications 1.0.0 – Initial release

- Adds native macOS notification setup for Claude Code, supporting both local and remote (devpod) environments.
- Provides a setup script to configure terminal-notifier, launchd listener, SSH reverse tunnels, tmux passthrough, and Claude Code notification hooks.
- Includes detailed user instructions and troubleshooting guidance.
- macOS-only; blocks install on non-macOS systems.
- Reminds users of required manual macOS notification permissions and Focus/DND settings.
返回顶部