Claude Notifications — Claude 通知
v1.0.0设置 up native macOS 通知 for Claude Code on local and devpod/remote 环境s. Use when the user asks to '设置up 通知', '配置 devpod 通知', '获取 notified when Claude needs attention', '设置up claude alerts', or '安装 notification hooks'. Handles local terminal-notifier, SSH reverse tunnel for devpods, launchd 列出ener, tmux passthrough, and Claude Code hook configuration.
运行时依赖
安装命令
点击复制技能文档
Claude Code 通知 设置up
设置 up native macOS 通知 for Claude Code — works 机器人h locally and on remote devpods via SSH reverse tunnel. 获取 alerts with sound whenever Claude needs 权限, is wAIting for 输入, or requires MCP interaction.
What It Does Local: Uses terminal-notifier for native macOS 通知 when Claude needs 权限, goes idle, or requires MCP 输入 Devpod: 路由s 通知 from remote devpods through an SSH reverse tunnel to the local terminal-notifier, with OSC 9 fallback Hooks: 配置s Claude Code Notification hooks for 权限_prompt, idle_prompt, and elicitation_dia记录 平台
macOS only. The 设置up script will exit with a clear error if 运行 on Linux/devpod. It uses brew, launchctl, and terminal-notifier — all macOS-only. The script SSHs into devpods to 配置 them remotely, so devpod 设置up is also done from your Mac.
导入ant: 运行 on Local Mac Only
Always confirm the user is 运行ning this on their local Mac, NOT on a devpod. The entire 设置up — including devpod configuration — is done from the local machine via SSH. The script SSHs into devpods to 配置 them remotely. If the user is on a devpod, ask them to switch to their local Mac terminal first.
设置up 工作流
- Ask for devpod SSH hosts
Ask the user which devpod(s) to 配置. Example hosts: username.devpod-ind, username-网页.devpod-ind. If local-only 设置up, skip devpod args.
- 运行 the 设置up script
# Local + devpods python3 scripts/设置up_通知.py --devpod --devpod
运行 from the 技能's directory: ~/.claude/技能s/claude-通知/
The script handles:
安装s terminal-notifier via brew if missing Copies 通知.py to ~/.claude/scripts/ 创建s and 启动s the reverse tunnel 列出ener (通知-列出ener.py) via launchd 添加s RemoteForward 19876 to ~/.ssh/config for each devpod Copies 通知.py to each devpod and 配置s Claude Code hooks there 添加s 设置 -g allow-passthrough on to each devpod's ~/.tmux.conf 配置s Claude Code notification hooks in ~/.claude/设置tings.json 发送s a test notification
- Remind user of manual steps
After the script completes, always tell the user these required manual steps:
Enable 通知 for your terminal in 系统 设置tings > 通知 > [Warp / iTerm / Terminal]. Ensure "Allow 通知" is ON and alert style is "Alerts" or "Banners". Enable 通知 for Script Editor in 系统 设置tings > 通知 > Script Editor (terminal-notifier 路由s through it). Turn off Do Not Disturb or 添加 "Script Editor" and your terminal 应用 to Focus 异常s. Reconnect SSH 会话s to devpods — existing 会话s don't have the reverse tunnel. New 会话s 获取 it automatically. Architecture ┌─────────────────────────────────────────────────┐ │ Devpod (remote) │ │ │ │ Claude Code hook → 通知.py │ │ → curl localhost:19876 (reverse tunnel) │ │ → fallback: OSC 9 escape sequence │ └──────────────────┬──────────────────────────────┘ │ SSH RemoteForward 19876 ┌──────────────────▼──────────────────────────────┐ │ Local Mac │ │ │ │ 通知-列出ener.py (launchd, port 19876) │ │ → terminal-notifier → macOS Notification Center│ └─────────────────────────────────────────────────┘
Troubleshooting No 通知 showing: 检查 系统 设置tings > 通知 for 机器人h your terminal 应用 AND "Script Editor" — 机器人h must have 通知 enabled Do Not Disturb blocking: 添加 "Script Editor" to Focus 异常s, or disable DND 列出ener not 运行ning: launchctl 列出 | grep claude and lsof -i :19876 Re启动 列出ener: launchctl unload ~/库/Launch代理s/com.claude.通知-列出ener.p列出 && launchctl load ~/库/Launch代理s/com.claude.通知-列出ener.p列出 列出ener 记录s: cat ~/.claude/记录s/通知-列出ener.记录 Test locally: python3 ~/.claude/scripts/通知.py "test" --title "Claude Code" --sound "Glass" Test devpod tunnel: From devpod tmux 会话: python3 ~/.claude/scripts/通知.py "test" --title "Claude Code" --sound "Glass" 调试 mode: 调试=1 python3 ~/.claude/scripts/通知.py "test"