Skip to main content

TTS with karaoke-style word highlighting for Claude Code. Fully local, zero API keys, one file.

Project description

claude-voice

The missing half of Claude Code's voice mode.

You talk to Claude with /voice. Now Claude talks back — with real-time word-by-word highlighting in your terminal. Fully local. Zero API keys. One file.

claude-voice demo

What it does

Installs as a Claude Code Stop hook. After every response, Claude's text is spoken aloud using Kokoro TTS (82M params, runs on CPU) while a karaoke-style highlight tracks the current word in your terminal.

  • Karaoke highlighting — current word lit up, gradient around it, progress bar with word count
  • Fully local — no API keys, no cloud, no internet. Audio never leaves your machine
  • 12 voices — American/British, male/female. Warm, deep, polished, casual — pick your style
  • Smart filtering — skips code-heavy responses, strips markdown/URLs/tables, fixes dev pronunciations (CLI, API, JSON, nginx, kubectl)
  • Interrupt on keypress — press any key to stop immediately
  • One-command setupclaude-voice setup adds the hook automatically

Install

pip install kokoro sounddevice numpy
git clone https://github.com/Null-Phnix/claude-voice
cd claude-voice
python speak.py setup

That's it. Restart Claude Code and every response will be spoken.

Commands

claude-voice setup              # install hook into Claude Code
claude-voice demo               # run a polished demo (for screen recording)
claude-voice benchmark          # measure latency, print shareable stats
claude-voice on                 # enable
claude-voice off                # disable (without removing the hook)
claude-voice --voices           # list all 12 voices
claude-voice --voice am_fenrir "text"   # speak with a specific voice
claude-voice --long "text"      # no truncation for long text

Voices

Voice Description
af_heart * American female, warm & expressive
af_nova American female, clear & professional
af_alloy American female, smooth & neutral
am_adam American male, natural
am_fenrir American male, deep & strong
am_onyx American male, smooth & confident
bm_george British male, polished
bm_daniel British male, warm
bf_emma British female, clear
bf_isabella British female, elegant

* default

Config

Config lives at ~/.config/claude-voice/config.json:

{
  "voice": "af_heart",
  "min_chars": 30,
  "max_chars": 1500,
  "chime": true,
  "enabled": true
}

How it works

  1. Claude Code fires the Stop hook after every response
  2. Hook receives last_assistant_message as JSON on stdin
  3. Strips markdown, code blocks, URLs, tables — keeps only speakable text
  4. Skips if response is mostly code (>50% inside fences)
  5. Fixes dev term pronunciation (CLI → "C L I", JSON → "jason", etc.)
  6. Generates audio with Kokoro TTS, concatenates all sentences into one seamless buffer
  7. Plays audio while rendering word-by-word highlighting to /dev/tty
  8. Background thread listens for keypress — any key interrupts instantly
  9. Cleans up display when done

Benchmark

claude-voice benchmark: ttfa=0.93s avg_gen=0.59s voice=af_heart engine=kokoro-82M local=true

Warm TTFA (time to first audio) under 1 second. First run is ~6s due to model loading.

Why not VoiceMode / ElevenLabs / OpenAI TTS?

claude-voice VoiceMode ElevenLabs OpenAI TTS
Word highlighting Yes No No No
Fully local Yes Optional No No
Zero API keys Yes Optional No No
Files 1 100+ - -
Setup One command MCP server Account + key Account + key
Auto-speaks Yes (Stop hook) No (Claude must call tool) No No
Cost Free Free $0.30/1M chars $0.015/1K chars

Requirements

  • Python 3.11+
  • kokoro, sounddevice, numpy
  • espeak-ng (system package for phonemization)
  • Works on Linux. macOS support untested but likely works.
  • Tested on Kitty, Ghostty, Alacritty. Any terminal with ANSI true color support.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_voice-0.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_voice-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file claude_voice-0.1.0.tar.gz.

File metadata

  • Download URL: claude_voice-0.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for claude_voice-0.1.0.tar.gz
Algorithm Hash digest
SHA256 272f8bd6e4030285f0090fad1fbf29057cf3225b265874365809b302971fba53
MD5 5b8c68f2ffcd7ccef8bffb8af8043ea6
BLAKE2b-256 c86378ab4d5ee2a1f4c1e45334a555281bd82386ccea6b89e637aef3593f6611

See more details on using hashes here.

File details

Details for the file claude_voice-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: claude_voice-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for claude_voice-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d517ac47b1cb3fc23a0909448de9909122a0bc30b7b51c8740a1a54686838e3
MD5 feaa9495f4f84beac5a3a9f776e79304
BLAKE2b-256 4010fc77d6d58b5a5726f1e536dfff04205aa1da1e40ccad4825da72efedbfca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page