A voice-activated AI assistant powered by Claude, with wake word detection, push-to-talk, local speech-to-text (Whisper), and local text-to-speech (Piper).
- Python 3.10+
- Piper TTS installed and on your PATH
- A working microphone and speakers/headphones
- An Anthropic API key
- Linux (uses
evdevfor push-to-talk key detection)
-
Clone the repo and open it in VS Code / Cursor:
git clone https://github.com/pulsipd/claude-voice.git cd claude-voice code . # or: cursor .
-
Create a virtual environment and install dependencies:
Open a terminal in VS Code/Cursor (`Ctrl+``) and run:
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt -
Set your Anthropic API key:
export ANTHROPIC_API_KEY="sk-ant-..."
To make it permanent, add that line to your
~/.bashrcor~/.zshrc. -
Install Piper TTS:
pip install piper-tts
Or follow the install instructions at https://github.com/rhasspy/piper.
With the virtual environment activated:
python3 claude-voice.pyOn first run it will automatically download:
- A Whisper speech-to-text model (~150 MB)
- A Piper voice (~30 MB)
These are cached in the models/ directory.
The app has two input modes:
- Voice mode (default) — Say the wake word (default: "Hey Jarvis") to start listening. It stops recording after detecting silence.
- Push-to-talk mode — Hold the Scroll Lock key to record, release to send.
You can also type questions directly into the terminal.
| Command | Description |
|---|---|
/help |
Show all commands |
/quit |
Exit the app |
/clear |
Clear conversation history |
/model [name] |
Show or set Claude model (sonnet, opus, haiku) |
/mode [voice|ptt] |
Switch between voice and push-to-talk |
/wake [model] |
List or change wake word model |
/voice [name] |
List or switch TTS voice |
/voice download <name> |
Download a new Piper voice |
/devices |
List audio input/output devices |
/input <id> |
Set audio input device |
/output <id> |
Set audio output device |
Run /voice to see all options. Some highlights:
| Name | Description |
|---|---|
| lessac | US female, clear and neutral |
| amy | US female, warm and friendly |
| joe | US male, casual and upbeat |
| alan | British male, deep and composed |
| jenny | British female, expressive |
| ryan | US male, broadcaster style |
Download with /voice download <name>, then switch with /voice <name>.
- "ANTHROPIC_API_KEY not set" — Make sure you exported the key in the same terminal session.
- "piper not found" — Install with
pip install piper-ttsor check it's on your PATH. - No audio input — Run
/devicesto list devices, then/input <id>to pick the right mic. - Wake word not working — Try
/mode pttas a fallback or/waketo see available models. - Permission error on key detection — Push-to-talk uses evdev and may need your user in the
inputgroup:sudo usermod -aG input $USER(then log out/in).
MIT