New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

claude-code-notifier-hook

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

claude-code-notifier-hook

Claude Code Stop hook notifier — sends a system notification when Claude finishes a task

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Claude Code Notifier Hook

当 Claude Code 完成任务时,自动发送 macOS 系统通知(可附带提示音),让你不用盯着屏幕等待。

效果

  • Claude 完成任务后弹出系统通知:"Claude Code 任务完成,请继续..."
  • 可选播放提示音(系统音效或内置趣味音效)

安装

npm install -g claude-code-notifier-hook

使用

初始化(只需运行一次)

claude-code-notifier-hook init

向导会引导你:

  • 选择安装级别

    • 用户级别 ~/.claude/settings.json — 对所有项目生效
    • 项目级别 .claude/settings.json — 仅对当前项目生效
  • 选择提示音(macOS)

    • 系统音效:Frog、Purr、Sosumi、Submarine
    • 内置趣味音效:来啦老弟 / 你干嘛 / 开始工作
    • 自定义音效(~/Library/Sounds 中的 .aiff 文件)
    • 或不使用提示音

配置完成后,Claude Code 每次完成任务都会自动触发通知。

手动测试

echo '{"stop_hook_active": false}' | claude-code-notifier-hook notify --sound Frog

工作原理

本工具作为 Claude Code 的 Stop hook 运行。每当 Claude 完成一轮任务,Claude Code 会自动调用 notify 子命令并通过 stdin 传入 JSON 数据。

防止无限循环: 若 JSON 中 stop_hook_active === true(表示 hook 本身触发了新会话),通知器会立即退出,避免循环触发。

用户级去重: 安装到用户级别时,hook 命令会先检查当前项目是否已有自定义 notifier hook,有则跳过,避免重复通知。

内置音效说明

音效名文件
来啦老弟lailalaodi.aiff
你干嘛niganma.aiff
开始工作letsgetwork.aiff

init 时会将所选文件复制到 ~/Library/Sounds/,之后通过 afplay 播放。

系统要求

  • macOS(通知与音效功能依赖 macOS API)
  • Node.js >= 14

License

MIT

Keywords

claude-code

FAQs

Package last updated on 27 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts