Claude Speech

A Claude Code plugin that gives Claude a spoken voice. The natural-language parts of Claude's responses are spoken aloud through one of three TTS backends — Deepgram Aura-2 (cloud), Piper (local neural), or macOS say (local classic) — with automatic fallback if the primary fails. Code, tool calls, file paths, and other non-prose are filtered out.
What it does
- Hooks into Claude Code's
Stop event (always), PreToolUse in Mode B for short tool cues, and Notification in Mode C, to extract or generate the speakable text for each event.
- Strips code blocks, file paths, URLs, and markdown formatting so only natural sentences remain.
- Optionally runs the result through Claude Haiku 4.5 to lightly polish phrasing (off by default — see
config.rewrite).
- Sends the polished text to Deepgram Aura-2 for high-quality TTS, with
say as a local fallback if Deepgram is unconfigured or unreachable.
- Streams Deepgram's audio bytes directly into
ffplay's stdin so the first sentence starts playing within ~1s instead of waiting for the full mp3. Long replies split into sentence-sized chunks; consecutive chunks share one ffplay so audio plays gaplessly across chunk boundaries.
- Falls back to file-based
afplay playback if ffplay is not installed.
- Audio from a prior turn is killed the moment you send a new prompt.
Modes
| Mode | When Claude speaks |
|---|
| A (default) | Final response only — one clip per turn. Fully hook-driven and deterministic. |
| B | Same as A, plus automatic short cues ("Looking that up", "Pulling it up") before tool calls via a hook-driven PreToolUse event. Both end-of-turn and pre-tool speech are fully deterministic and hook-driven. speak_cli is reserved for between-tool interjections only. |
| C | Final response plus distinct alerts when Claude hits a Notification event (asks for permission, signals a blocker, etc.). |
Mode is set via config.json. The setup skill regenerates hooks/hooks.json so only the hooks for the current mode are registered. In mode B, a SessionStart hook injects instructions forbidding Claude from narrating tool calls (the PreToolUse hook handles this deterministically) and reserving speak_cli for optional interjections between tool calls.
Requirements
- macOS (the
say fallback is Darwin-only)
- Python 3.10+
- Claude Code
- Optional but recommended: a Deepgram API key (free tier works; Aura-2 voices are well above
say quality)
- Optional but recommended:
ffplay from ffmpeg (brew install ffmpeg). With ffplay, audio streams directly from Deepgram for ~1s time-to-first-audio. Without it, the plugin falls back to writing temp mp3s and playing with afplay.
- Optional: Piper for local neural TTS that beats
say quality without needing a network. See the Voices section below.
Install
Inside a Claude Code session:
/plugin marketplace add jason-c-dev/claude-code-speak
/plugin install claude-speech@claude-code-speak
/reload-plugins
Or from a local clone:
git clone https://github.com/jason-c-dev/claude-code-speak ~/dev/claude-code-speak
/plugin marketplace add ~/dev/claude-code-speak
/plugin install claude-speech@claude-code-speak
/reload-plugins
Then ask Claude to set it up:
> set up speech
The setup skill walks you through installing the Python dependency (claude-agent-sdk), entering your Deepgram key (or skipping for say-only mode), picking a voice, picking a mode, and running a smoke test. About a minute, end to end.
Configuration
Plugin-level config lives in config.json at the repo root. The setup skill regenerates this — you shouldn't normally edit it by hand. Example:
{
"enabled": true,
"mode": "A",
"voice": "aura-2-thalia-en",
"primary_tts": "deepgram",
"fallback_tts": "say",
"piper_voice": "",
"say_voice_map": {},
"rewrite": false,
"speech_rate": 1.0
}
primary_tts and fallback_tts each accept "deepgram", "piper", or "say". The plugin tries primary first; if that backend's prerequisites are missing or it returns no audio, it falls through to fallback. See Voices for backend details.
Your Deepgram key lives outside the repo at ~/.claude/voice/.env:
DEEPGRAM_API_KEY=...
This survives plugin reinstall and never lands in version control.