speak
Text-to-speech plugin for Claude Code. Reads responses aloud using native TTS engines.
Demo
Prerequisites
- git — Required to clone the plugin repository
- Node.js 18+ — Required to run plugin hooks
Install
claude plugin marketplace add alphabet/speak
claude plugin install speak@alphabetware
To install from source instead:
gh repo clone alphabet/speak ~/speak
claude --plugin-dir ~/speak
Usage
Type /speak to verify the plugin is loaded. Key commands:
/speak on # enable TTS
/speak off # disable TTS
/speak set voice Ava # change voice (fuzzy match)
/speak set engine `native|kokoro` # TTS engine
/speak set speed 1.5 # adjust speed (0.1-3.0)
/speak set sentences 2 # sentences per response (1-10)
/speak terse # strip markdown before speaking
/speak voices # list available voices
/speak set notificationHook <mode> # on|off|speak/<path>
Full command reference: skills/speak/SKILL.md
Platform support
| Platform | Engine | Install |
|---|
| macOS | say (native) | Built-in, always available |
| Linux | espeak (native) | apt install espeak or dnf install espeak |
| Windows | SAPI (native) | Built-in via PowerShell + System.Speech |
| Any | kokoro | npm install kokoro-js in the speak plugin directory |
How it works
A Stop hook fires after each Claude response. The text is cleaned (markdown stripped), truncated to N sentences, and spoken by the platform's native TTS engine. If a previous response is still speaking, it gets cut off. No additional tokens are consumed -- this is pure client-side TTS.
A Notification hook fires on permission prompts and idle pings, configurable via /speak set notificationHook (on/off/speak/sound-file path; off silences it, speak TTS's it, a path plays that sound on macOS).
The engine interface is at lib/engine.mjs if you want to swap in a different runtime.
Troubleshooting
No sound on macOS -- Check system volume. Run say "test" in Terminal. Check ~/.speak/config.json has "enabled": true.
No sound on Linux -- Install espeak: apt install espeak. Run espeak "test" to verify.
Adjust voice or speed -- /speak voices to list voices, /speak set voice <name> for fuzzy match, /speak set speed <n> for rate.
Config issues -- Delete ~/.speak/config.json to reset to defaults. Parse errors are logged to ~/.speak/speak.log.
Hook not firing -- Restart your Claude Code session after installing. Check ~/.speak/speak.log for errors.
Architecture
Engine interface is pluggable via lib/engine.mjs. If you're not satisfied with the system TTS, a different engine can be configured behind this same interface. Right now the plugin only requires Node.js >= 18 and your platform's native TTS (say on macOS, espeak on Linux). Neural engines sound better, but neural engine performance varies with system hardware (CPU vs GPU) and the engine capabilities. And I already mentioned that I prefer a robot voice for my agent over a human one.
Kokoro neural TTS
Kokoro is a local neural TTS engine powered by kokoro-js. It runs an 82M-parameter ONNX model on your CPU -- no API keys, no network required after setup.
Setup:
cd ~/speak # or wherever you cloned this repo
npm install kokoro-js
The first time Kokoro speaks, it downloads the quantized model (~86 MB) from Hugging Face. This is cached automatically for future use.
Switch to Kokoro:
/speak set engine kokoro
/speak voices # list all 54 voices
/speak set voice bella # fuzzy match works
Switch back to native:
/speak set engine native
54 voices across 8 languages: American English, British English, Japanese, Mandarin Chinese, Spanish, French, Hindi, Italian, Brazilian Portuguese.
Performance note: Kokoro loads its model on each hook invocation. For short sentences (the default sentences: 1), this fits within the hook timeout. For longer text or slower hardware, a daemon architecture is planned.
Legal
macOS voices: Apple's system voices are subject to the macOS Software License Agreement, which restricts their use to personal, non-commercial purposes. This plugin calls say on the user's own machine -- it does not redistribute Apple's voices. If you use the audio output commercially, review Apple's license terms.