← 返回
未分类 中文

cc-sticky-notify

Install, configure, or fix cc-sticky-notify — a notification system that displays a pinned yellow sticky note in the Mac top-right corner for key Claude Code...
安装、配置或修复 cc‑sticky‑notify——在 Mac 右上角显示固定黄色便签的通知系统,用于关键的 Claude Code
bucleliu bucleliu 来源
未分类 clawhub v1.0.2 1 版本 100000 Key: 无需
★ 1
Stars
📥 427
下载
💾 0
安装
1
版本
#latest

概述

cc-sticky-notify

A pinned sticky note notification system for Mac. Key Claude Code events appear as a yellow floating sticky note in the top-right corner, persisting until manually closed.

File Structure (fully self-contained)

~/.claude/skills/cc-sticky-notify/
├── SKILL.md
├── install.sh                   ← one-time setup: chmod + settings.json guidance
└── scripts/
    ├── notify.sh                ← main notification script (called directly by hooks)
    ├── sticky-window.swift      ← Swift source (compiled by install.sh on first install)
    └── sticky-notify.app/       ← .app bundle (built automatically on first use)
        └── Contents/
            ├── Info.plist
            └── MacOS/
                └── sticky-notify-app

Two-layer notification mechanism:

  1. display notification — no permissions required, appears instantly in top-right corner
  2. Swift NSWindow (.floating level) — pinned sticky note, close manually with ✕

Hook coverage (consistent with popo-notify):

HookTriggerSticky note content
------------------------------------
StopTask completed✅ Task completed + time/project/session
Notification/permission_promptPermission approval needed🔐 Permission approval required
Notification/idle_promptWaiting for user selection💬 Awaiting your input
PostToolUse/Bash (on failure)Command execution failed❌ Command failed, exit code

Requirements

  • macOS 12 Monterey or later
  • Xcode Command Line Tools — required for compiling the Swift floating window, code signing, and JSON parsing

```bash

xcode-select --install

```

All dependencies (swiftc, codesign) come from Xcode CLT. install.sh will check and exit early if CLT is missing.


Installation

When the user requests installation, follow these steps:

Step 1 — Run install.sh

bash ~/.claude/skills/cc-sticky-notify/install.sh

What this script does:

  1. Check Xcode CLT — exits early with instructions if xcode-select -p fails.
  2. chmod +x notify.sh — ensures the script is executable (git clone may strip the +x bit).
  3. Build .app bundle — compiles sticky-window.swift, writes Info.plist + entitlements, signs with codesign. Skipped if the bundle already exists.
  4. Check hook configuration — inspects ~/.claude/settings.json for existing cc-sticky-notify entries and prints the required hook commands if none are found.
  5. Smoke test — fires a test notification via notify.sh.

Step 2 — Configure settings.json hooks

Read ~/.claude/settings.json and append one sticky-notify entry to each of the following four locations in the hooks field (skip if already present).

Stop — append to Stop[0].hooks:

{
  "type": "command",
  "command": "$HOME/.claude/skills/cc-sticky-notify/scripts/notify.sh"
}

Notification/permission_prompt — append:

{
  "type": "command",
  "command": "$HOME/.claude/skills/cc-sticky-notify/scripts/notify.sh '🔐 Claude Code Permission approval required, check terminal'"
}

Notification/idle_prompt — append:

{
  "type": "command",
  "command": "$HOME/.claude/skills/cc-sticky-notify/scripts/notify.sh '💬 Claude Code Awaiting your input, check terminal'"
}

PostToolUse/Bash — append (triggers only on failure):

{
  "type": "command",
  "command": "bash -c 'INPUT=$(cat); STATUS=$(echo \"$INPUT\" | jq -r \".tool_response.exitCode // 0\"); [ \"$STATUS\" != \"0\" ] && $HOME/.claude/skills/cc-sticky-notify/scripts/notify.sh \"❌ Claude Code Command failed, exit code: $STATUS\" || true'"
}

Step 3 — Verify

# Test arg mode (simulates Notification hook)
$HOME/.claude/skills/cc-sticky-notify/scripts/notify.sh '✅ Installation verified'

# Test stdin mode (simulates Stop hook)
echo '{"session_id":"test12345678"}' | $HOME/.claude/skills/cc-sticky-notify/scripts/notify.sh

A yellow sticky note and system notification appearing in the top-right corner confirms successful installation.


Configuration

CC_STICKY_NOTIFY_CLOSE_TIMEOUT — Auto-close timeout

Sticky notes automatically close after 1 hour (3600 seconds) by default. Override with this environment variable:

export CC_STICKY_NOTIFY_CLOSE_TIMEOUT=300   # auto-close after 5 minutes
  • Unit: seconds (decimals supported, e.g. 30.5)
  • Must be greater than 0; otherwise falls back to the default 3600 seconds
  • Set a large value (e.g. 86400) to keep the note visible for nearly a full day

To persist the setting, add it to your shell config (~/.zshrc or ~/.bashrc):

echo 'export CC_STICKY_NOTIFY_CLOSE_TIMEOUT=300' >> ~/.zshrc

Troubleshooting

No system notification either

  • Verify the hooks configuration is correctly written in ~/.claude/settings.json
  • Path should be $HOME/.claude/skills/cc-sticky-notify/scripts/notify.sh

xcrun: error: invalid active developer path during compilation

  • Xcode Command Line Tools path is broken (common after macOS upgrade or Xcode reinstall)
  • Fix: sudo xcode-select --reset
  • If that doesn't work, reinstall: xcode-select --install
  • The floating sticky window will be disabled if swiftc can't compile, but system notifications still work

Permission denied on notify.sh

  • The script is missing execute permission — happens when files are cloned/copied without preserving permissions
  • Fix: chmod +x ~/.claude/skills/cc-sticky-notify/scripts/notify.sh
  • Re-run install.sh after fixing (the latest version auto-runs chmod +x on startup)

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-05-03 08:08 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 30,948
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,913
it-ops-security

Tmux

steipete
通过发送按键和抓取窗格输出,远程控制交互式 CLI 的 tmux 会话。
★ 46 📥 29,538