> **TL;DR:** I wired custom voice audio into Claude Code, Codex CLI, and Gemini CLI using their hook systems — so my agents literally speak to me when they're done, waiting, or need attention. Here's how, and how you can add your own sounds. ## What We Built The architecture consists of three layers: 1. **Lifecycle event hooks** — each CLI has events (session start, prompt submitted, agent done, notification). We wire audio to those. 2. **Intent‑matched sounds** — sounds chosen to match the *meaning* of the event, not just "something happened." 3. **Attention re‑trigger timer** — if you don't respond within 30 s after a Notification, it nudges you again every 2 minutes until you do. ## The Attention Timer **File:** `~/.agents/sounds/cli/attention_timer.sh` When an agent finishes its turn (`Stop` or `AfterAgent`), the timer starts. This ensures that if the agent is waiting for your review or has hit a notification state, you get a nudge: - **30 seconds** → plays `cli-im-on-wait-mode.mp3` (first nudge) - **Every 2 minutes after** → plays `cli-been-waiting.mp3` - **When you respond** → the timer PID is killed, and an acknowledgment sound plays. The timer uses a shared PID file at `/tmp/cli-attention-timer.pid`. Responding to any of the three agents cancels the timer for all of them. ## The Player Script `~/.agents/sounds/peon/play_sound.sh` is the backbone. It ensures the CLI never blocks by running in the background. ```bash ## Play one random sound from a list ~/.agents/sounds/peon/play_sound.sh \ ~/.agents/sounds/cli/cli-im-here.mp3 \ ~/.agents/sounds/cli/cli-alright.mp3 ``` ### Further Reading If you’re interested in deeper CLI customizations, check out the related post **[A Better Codex CLI Wrapper (with Logs + Defaults)](/a-better-codex-cli-wrapper-with-logs-defaults/)** for advanced logging and default handling techniques. **END_OF_REPORT** 🌿✨