A Claude Code plugin that enables voice input via push-to-talk. Hold a hotkey to record your voice, release to transcribe and insert text into Claude Code.
- Push-to-talk: Hold
Ctrl+Spaceto record, release to transcribe - Dual transcription backends: OpenAI Whisper API and local whisper.cpp
- Cross-platform: Windows, macOS, Linux (X11 and Wayland)
- Automatic fallback: Falls back to alternative backend if preferred fails
- Visual feedback: Shows recording/transcribing status
/plugin marketplace add aaddrick/claude-ptt
/plugin install ptt@claude-ptt-marketplacegit clone https://github.com/aaddrick/claude-ptt.git
cd claude-ptt
npm install
npm run buildConfiguration is stored in ~/.claude/ptt-config.json:
{
"hotkey": "Ctrl+Space",
"whisper": {
"openaiApiKey": null,
"localModelPath": null,
"preferredMode": "api",
"enableFallback": true,
"language": "en"
},
"audio": {
"sampleRate": 16000,
"silenceThreshold": 0.5
},
"keystroke": {
"waylandBackend": "wtype"
},
"feedback": {
"showRecordingIndicator": true
}
}API Mode (Recommended for ease of use):
- Set
OPENAI_API_KEYenvironment variable, or - Set
openaiApiKeyin config
Local Mode (Recommended for privacy):
- Install whisper.cpp
- Set
localModelPathto your model file
Use preferredMode to choose which backend to try first:
"api": Try OpenAI API first"local": Try local whisper.cpp first
Enable enableFallback to automatically try the other backend if the preferred one fails.
No additional setup required. The plugin uses nut.js for keystroke simulation.
Grant accessibility permissions to your terminal application:
- Open System Preferences > Security & Privacy > Privacy > Accessibility
- Add your terminal app (Terminal.app, iTerm2, etc.)
Install libxtst for keystroke simulation:
sudo apt install libxtst-devInstall one of the following for keystroke simulation:
# Option 1: wtype (recommended, no daemon required)
sudo apt install wtype
# Option 2: ydotool (requires daemon)
sudo apt install ydotool
sudo systemctl enable --now ydotool
# Option 3: dotool
# Build from source: https://sr.ht/~geb/dotool/The plugin uses system audio tools:
- Linux:
arecord(ALSA, usually pre-installed) - macOS/Windows:
sox(install viabrew install soxor download from http://sox.sourceforge.net/)
# Via npm
npm start
# Or directly
node dist/daemon.js- Start the daemon in a separate terminal
- In Claude Code, hold
Ctrl+Spaceto record - Speak your message
- Release
Ctrl+Spaceto transcribe - Text appears in your input for review
- Press Enter to submit
The plugin provides MCP tools for configuration:
ptt_get_config: Get current configurationptt_set_config: Update configurationptt_get_status: Get daemon statusptt_get_platform_info: Get platform info and setup instructions
- Linux: May need to run as root for global key capture
- macOS: Ensure accessibility permissions are granted
- All platforms: Check for conflicts with other applications
- macOS: Check accessibility permissions
- Linux Wayland: Ensure wtype or ydotool is installed
- Linux X11: Ensure libxtst-dev is installed
- API mode: Verify your OpenAI API key
- Local mode: Verify whisper.cpp is installed and model path is correct
- All modes: Check microphone permissions and audio recording
- Check microphone permissions in system settings
- Verify audio recording tool is installed:
- Linux:
which arecord - macOS/Windows:
which sox
- Linux:
# Install dependencies
npm install
# Build TypeScript
npm run build
# Watch mode
npm run watch
# Run daemon
npm start
# Run MCP server
npm run mcp-serverMIT
Aaddrick Williams aaddrick@gmail.com