DEV Community

Cover image for Make Claude Code Talk: Voice Notifications When Your Agent Finishes (Open Source)
Miragea
Miragea

Posted on

Make Claude Code Talk: Voice Notifications When Your Agent Finishes (Open Source)

Long agent runs make you alt-tab every thirty seconds. agent-voice is an open-source (MIT) Agent Skill that makes Claude Code, or any tool with command hooks, say "all done" or "I need your permission" out loud in a Miragea voice. Lines are cached, new lines are capped per day, and the hook never blocks the agent.

Flow: hook fires, pick a line, cache check, synthesise once with a Miragea voice

Install

git clone https://codeberg.org/miragea-voice/miragea-skills
export MIRAGEA_API_KEY=...   # create one at https://miragea.ai/workspace/api
mkdir -p ~/.miragea-agent-voice
echo '{"actor": "My voice", "speak_summary": true}' > ~/.miragea-agent-voice/config.json
python3 miragea-skills/skills/agent-voice/scripts/agentvoice.py doctor
Enter fullscreen mode Exit fullscreen mode

Or let your agent do it: npx skills add https://codeberg.org/miragea-voice/miragea-skills.git and ask "make yourself talk when you finish".

Wire up the hooks

python3 miragea-skills/skills/agent-voice/scripts/agentvoice.py prewarm
python3 miragea-skills/skills/agent-voice/scripts/agentvoice.py install --write ~/.claude/settings.json
Enter fullscreen mode Exit fullscreen mode

install merges a Stop and a Notification hook into your settings (a .bak is kept, and running it twice adds nothing). Claude Code sends each hook a JSON event on stdin; the script reads it, picks a line and plays it from a detached process.

What it says

  • Stop: a stock phrase, or with "speak_summary": true the first sentence of the agent's last reply, with code, links and file paths removed and capped at 24 words.
  • Notification: "I need your permission to run that command" or "I have a question before I continue"; other notification text is shortened and spoken.

Real run

Terminal: doctor passes, a Stop hook speaks the summary, speech recognition of demo.mp3 matches

A Stop event with a transcript produced "I fixed the date parser and all 42 tests pass." in the CMU ARCTIC slt voice. I transcribed the 10-second demo MP3 back with speech recognition and it returned every line. Listen: https://codeberg.org/miragea-voice/miragea-skills/raw/branch/main/examples/agent-voice/demo.mp3

Cost control

Cues repeat, so every line is cached by text and voice: the second "All done" is instant and makes no API call. daily_new_limit (default 30) caps new lines per day; cached ones still play. Prewarm voices the four stock phrases once.

FAQ

Will the hook slow Claude Code down? No. It spawns a detached process and exits; errors are swallowed.

Which players work? afplay (macOS), ffplay, mpg123 or mpv. Override with MIRAGEA_AGENT_VOICE_PLAYER.

Can it use my own voice? Use a saved voice, or a public reference audio URL plus its transcript. Only clone voices you have consent to use.

Code, 160 tests and the other seven skills: https://codeberg.org/miragea-voice/miragea-skills

Top comments (0)