peon-ping
Set which voice pack (character voice) plays for the current chat session. Automatically enables session_override rotation mode if not already set. Use when user wants a specific character voice like GLaDOS, Peon, or Kerrigan for this conversation.
1How It Works & Mechanism
The core is an actual program rather than prompts: peon.sh is registered by the installer as multiple lifecycle hooks for the host (README lists SessionStart / SessionEnd / SubagentStart / Stop / Notification / PermissionRequest / PostToolUseFailure / PreCompact), executing playback and notification logic upon incoming events (SKILL.md serves merely as a shell).
`peon.sh` is a Claude Code hook registered for `SessionStart`, `SessionEnd`, `SubagentStart`, `Stop`, `Notification`, `PermissionRequest`, `PostToolUseFailure`, and `PreCompact` events. On each event:
The installer writes the same command into the hooks section of the user-level ~/.claude/settings.json (or the project's ./.claude/settings.json if --local is used), and only cleans up the peon.sh / notify.sh entries that it installed itself.
echo "Updating Claude Code hooks in settings.json..."
Most skills are thin prompts: /peon-ping-toggle directs the model to invoke peon.sh toggle under the installation directory via the shell, with the actual logic residing inside the program.
bash "${CLAUDE_CONFIG_DIR:-$HOME/.claude}"/hooks/peon-ping/peon.sh toggle
/peon-ping-use takes the hook interception path rather than the model path: the UserPromptSubmit hook reads the prompt, handles it internally, and halts the LLM, completing configuration updates with zero tokens.
The hook scripts (`scripts/hook-handle-use.sh` and `scripts/hook-handle-use.ps1`) do all the work - this SKILL.md file exists solely for discoverability in the `/` command autocomplete menu.
Session-level voice pack assignment equals direct rewriting of config and state files by hooks: sets pack_rotation_mode to session_override and writes the session→pack mapping into session_packs in .state.json.
config['pack_rotation_mode'] = 'session_override'
Voice packs are not stored in the repository: during installation, it reads a custom registry manifest and pulls files one by one from raw.githubusercontent.com into <peon_dir>/packs/<pack>/, recording sha256 checksums.
PACK_BASE="https://raw.githubusercontent.com/$SOURCE_REPO/$SOURCE_REF/$SOURCE_PATH"
Playback uses platform-native utilities: macOS prefers afplay (or switches to the peon-play binary if installed to support Sound Effects devices), while Linux probes multiple players sequentially.
local player="afplay"
Desktop notifications are implemented per platform: Linux uses notify-send, macOS uses terminal-notifier (falling back to osascript if absent), and Windows/WSL uses PowerShell toasts.
nohup notify-send --urgency="$urgency" $expire_time_flag $icon_flag "$title" "$msg" >/dev/null 2>&1 &
The same repository also provides an MCP server: it spawns system players directly to play designated pack/sound assets without relying on hooks.
const child = spawn(cmd[0], cmd[1], { stdio: "ignore" });
In SSH / devcontainer / Codespaces scenarios, sound is not emitted locally; instead, audio and notification requests are sent to a relay service on host port 19998.
"http://${relay_host}:${relay_port}/notify" >/dev/null 2>&1 &
2Core Capabilities
3External Dependencies
| Kind | Dependency / Endpoint |
|---|---|
| network | GitHub raw(核心文件与语音包下载,main 分支未 pin) |
| network | 语音包文件下载基址(按 registry 的 source_repo/ref/path 拼接) |
| network | 自建语音包 registry 清单 |
| network | GitHub 仓库 tarball(部分适配器安装包) |
| api | ElevenLabs 声音生成 / TTS(xi-api-key 头鉴权) |
| api | MiniMax 语音合成(T2A v2,两个地区端点) |
| api | ntfy 手机推送(服务器可在配置中覆盖) |
| api | Pushover 推送 |
| api | Telegram Bot 推送 |
| network | 本机音频 / 通知 relay |
| cli | 系统通知 / 播放 / 编译依赖 |
| package | MCP SDK(Node,供 mcp/peon-mcp.js 使用) |
4Recommended Governance & Evidence
- scripts/: Local script or command execution: Installation registers peon.sh as Claude Code event command hooks (the 8 categories listed in the README: SessionStart /
- 网络端点: Declared external network access: Core code fetched during install/update: REPO_BASE points to the **main branch** on raw.githubusercontent.com, installed via curl -
- 本地工作目录: File I/O and artifact output: Writes user-level Claude settings and registers hooks: install.sh uses `with open(settings_path, 'w') as f:`
5Second-Pass Verification
- [ok] skill.path 的选取(skills/peon-ping-use) — 重读仓库根目录(无 SKILL.md、无 plugin.json/marketplace.json)、glob **/SKILL.md(恰 7 个,全在 skills/peon-ping-*/)、glob **/plugin.json 与 **/marketplace.json(零命中)、以及 docs/public/llms.txt 与 README 对技能的分组排序。结论:展示名是产品级/仓库级,没有单一插件入口声明,必须主观择一;选 peon-ping-use(frontmatter 带 license: MIT 与 metadata.author: PeonPing,且是会话级语音包切换的主实现)。七个技能的 name/description 原文均已取证,可零成本改选。
- [discrepancy] 仓库 7 个 SKILL.md 与安装器 6 个的矛盾 — 重读 install.sh 的 install_skill 调用段(仅 6 个:toggle/config/use/log/remix/create-pack)与 install.ps1 的技能数组(同样 6 个,无 rename)。结论:peon-ping-rename 的 SKILL.md 不会被装到用户目录,只有它的 hook 脚本被单独下载——宣称 7 个、落地 6 个。
- [ok] external_deps:raw.githubusercontent.com 系列调用点 — 分别重读 install.sh 的 REPO_BASE 定义与下载段、pack-download.sh 的 PACK_BASE 拼接、peon.sh 的自更新与 VERSION 探测、adapters/omp.sh 与 adapters/kilo.sh。全部为明文 HTTPS 拉取,**无 pin、无签名校验**(语音包的 sha256 基线也来自同一来源,故不能防上游作恶)。
- [ok] external_deps:自建 registry 与 peon.sh 内的 urllib 拉取 — 重读 install.sh 的 REGISTRY_URL 常量,并在 peon.sh 检索 urllib.request.urlopen 命中两处同一 URL;另 pack-download.sh 亦有同域请求。属自建静态清单,与包文件所在 GitHub raw 分离。
- [ok] security:hooks 写进了哪里、注册了哪些事件 — 重读 install.sh 的 hook 安装段:HOOK_CMD 指向 $GLOBAL_BASE/hooks/peon-ping/peon.sh,settings.json 两次被以 'w' 模式改写;另确认 UserPromptSubmit 的两个 hook 分别指向 hook-handle-use.sh 与 hook-handle-rename.sh。README 侧 11 类事件清单与之吻合。
- [ok] security:是否提权 / 是否碰系统目录 — 对 install.sh、peon.sh、relay.sh、scripts/、adapters/ 检索 sudo:零命中;重读 install.sh 的 chmod 与软链段确认权限动作只有 chmod +x,写入目标全部在 $HOME 之下(~/.claude、~/.local/bin、~/.zshrc、~/.bashrc、~/.config/fish、~/Library/LaunchAgents)。
- [ok] security:凭据读取清单 — 重读 pack-render.py(env + 两处文件回退 + xi-api-key 头)、tts-minimax.sh/.ps1(MINIMAX_API_KEY / GROUP_ID)、peon.sh 的手机推送凭据读段。结论:本地配置/环境变量 → 明文 HTTPS 出站到用户自选的第三方服务,无第三方中转、不上传至作者域名。
- [ok] security:配置驱动的 shell 执行 — 在 peon.sh 检索 notification_title_script 命中取值与执行两处,重读该段确认 `_sp.run(_script, shell=True, capture_output=True, text=True, timeout=2, env=_env)`;又重读 config.json 确认默认值为空串。结论:默认关闭但机制真实存在。
6Verdict & Scenarios
6daa61016ffad439…