Ring Ring Claude banner
hst-Sunday hst-Sunday

Ring Ring Claude

Development community

Description

A tool that adds sound notifications to the Claude Code CLI. When the command line requires user confirmation or action, it automatically plays a ringtone to ensure you don't miss any important prompts. It supports custom ringtones and is cross-platform (macOS, Linux, Windows).

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

[English Readme](./README.en.md)

Ring Ring Claude 🔔

为 Claude Code 添加声音提醒功能,当需要用户确认或权限时播放自定义铃声。

功能特性

  • 🔊 当 Claude Code 需要用户确认时播放提示音
  • 🎵 使用自定义 MP3 铃声文件
  • 🖥️ 跨平台支持(macOS、Linux、Windows)
  • 📝 详细的日志记录
  • ⚡ 一键安装脚本

快速开始

方式一:全局安装(推荐)

git clone 
cd ring-ring-claude
./install.sh

全局安装会:

  • 检查 Claude Code 是否已安装
  • 复制脚本到 ~/.claude/ 目录
  • 配置全局 Claude Code hooks
  • 在所有项目中启用声音提醒

方式二:本地安装

支持安装到指定目录(默认当前目录):

git clone 
cd ring-ring-claude

# 安装到当前目录
./local-install.sh

# 安装到指定目录
./local-install.sh /path/to/project

# 安装到用户工作区
./local-install.sh ~/workspace

本地安装会:

  • 在指定目录创建 .claude 配置目录
  • 复制声音文件和脚本到本地目录
  • 创建本地配置 .claude/settings.json
  • 不影响全局配置或其他项目

**使用本地安装的项目:**

cd /path/to/project
export CLAUDE_SETTINGS_PATH="$(pwd)/.claude/settings.json"
claude
# 或者
claude --settings "$(pwd)/.claude/settings.json"

完成!

现在当 Claude Code 需要用户确认时,会自动播放铃声提醒。

系统要求

Claude Code

首先需要安装 Claude Code CLI:

# 使用 npm
npm install -g @anthropic-ai/claude-code

# 或使用 pip
pip install claude-code

详细安装说明:https://docs.anthropic.com/en/docs/claude-code/quickstart

音频播放器

**macOS**: 内置 `afplay`(无需额外安装)

**Linux**: 需要以下任一播放器

# Ubuntu/Debian
sudo apt install mpg123

# CentOS/RHEL
sudo yum install mpg123

# Arch Linux
sudo pacman -S mpg123

**Windows**: 内置 PowerShell(无需额外安装)

项目结构

ring-ring-claude/
├── claude-bell.wav              # 提示音文件
├── play-notification-sound.sh  # 声音播放脚本
├── install.sh                  # 全局安装脚本
├── local-install.sh            # 本地安装脚本
├── uninstall.sh                # 卸载脚本
└── README.md                   # 使用说明

工作原理

  1. Hook 机制: 使用 Claude Code 的 Notification Hook 功能
  2. 触发时机: 当 Claude Code 需要用户权限或确认时触发
  3. 声音播放: 优先使用项目目录的 claude-bell.wav,降级到系统默认提示音
  4. 日志记录: 所有活动记录在 ~/.claude/notification.log

配置文件

全局安装配置

安装后会在 `~/.claude/settings.json` 中添加以下配置:

{
  "hooks": {
    "Notification": [
      {
        "matcher":