[FEATURE] Voice mode hook events + audio file access for accessibility and speech analysis
[FEATURE] Voice mode hook events + audio file access for accessibility and speech analysis
The Problem
Claude Code's /voice mode transcribes speech well. But hooks have no way to know a prompt came from voice input, and there's no access to the raw audio file after transcription.
UserPromptSubmit gets the same payload whether I typed or spoke. The audio is streamed, transcribed, and gone. Never saved to disk.
Why This Matters
I have Usher Syndrome Type 2. Legally blind, severe-to-profound hearing loss since birth. I also have a learning disability that makes typing slow. Voice mode lets my brain run at full speed and it works great for me.
But here's what I found today. The transcription errors are actually speech analysis data. And right now that data gets thrown away.
How Hearing Loss Shapes Speech and Writing
When you've never heard a sound clearly, you don't really know how to say it. High-frequency consonants like s, sh, f, th, k all live in the frequency range I've never had. My audiogram shows No Response at 3kHz and above. So I had to teach myself how to make those sounds without ever really hearing what they're supposed to sound like. You're guessing.
That affects more than speech. We write how we hear things. When you've never clearly heard the difference between "letters" and "butters," that confusion shows up in your spelling, your typing, your word choices. For people like me, voice-to-text isn't just convenient. It's a window into the gap between what our brains intend and what our mouths actually produce, and what shows up when we try to write.
Understanding those patterns, which sounds are hard, which substitutions happen consistently, helps us teach ourselves better. And it helps AI understand us better.
What I Found Today (Real Data)
I used /voice for a session today and captured what came through. Here's what Whisper heard vs what I actually meant:
| Whisper Produced | What I Meant | What Happened |
|-----------------|--------------|---------------|
| "OAuth box me came for first few butters" | "It always blocks me, came for first few letters" | "letters" became "butters", "always blocks" became "OAuth box" |
| "But I what it is. The butters are just hard for me" | "But I know what it is. The letters are just hard for me" | "letters" became "butters" again. Consistent. |
| "better words to you" | "better words to use" | "use" became "you" |
| "it's think this is gonna be" | "I think this is gonna be" | Minor pronoun swap |
"Letters" became "butters" twice. That's not random. That's a consistent speech pattern caused by hearing loss. The L-sound and the B-sound are being produced similarly enough that Whisper can't tell them apart. That maps directly to my audiogram.
This is data no doctor has ever collected for me. No speech therapist has mapped my specific substitution patterns. But Claude Code's voice mode is accidentally generating exactly that data, and then throwing it away.
How I Captured It (The Workaround)
Since there's no hook for voice mode, I built a parallel mic recorder using sox:
# Records from the same system mic Claude Code uses
rec -q -r 16000 -b 16 -c 1 "capture.wav" &
# ... use /voice in Claude Code ...
kill $PID
# Auto-trim the silence
sox capture.wav trimmed.wav silence 1 0.3 1% reverse silence 1 0.3 1% reverse
It works, but it's clunky. I have to manually start it before using /voice and manually stop it after. It records everything including silence. My test captured 101 seconds but only about 30 seconds was actual speech. Auto-trimming with sox helps but isn't precise. And there's no way to align the audio to a specific transcript. If I use /voice three times during a capture, it's all one blob.
With hook support, this could be automatic and aligned per-utterance.
What Would Help
1. Voice metadata in UserPromptSubmit hook (most important)
Add a field indicating the prompt source:
{
"hook_event_name": "UserPromptSubmit",
"prompt": "the transcribed text",
"input_source": "voice",
"voice_audio_path": "/tmp/claude-voice-12345.wav"
}
Or at minimum just:
{
"input_source": "voice"
}
2. Option to save audio files
A setting like:
{
"voiceSaveAudio": true,
"voiceAudioPath": "~/.claude/data/voice-captures/"
}
3. Voice-specific hook events (nice to have)
VoiceStart- user began recording (held Space)VoiceEnd- user released Space, transcription startingVoiceTranscribed- transcription complete, before prompt submission
Who Benefits
- Deaf and hard-of-hearing users who want to understand how hearing loss shapes their speech
- Deafblind users where speech is a primary output channel
- Speech therapy and rehabilitation, paired audio + transcript data for pattern analysis
- Accessibility researchers studying voice-to-text accuracy across disability profiles
- Anyone with speech differences, accents, impediments, neurological conditions
- Power users who want to log, audit, search, or replay voice inputs
Environment
- Claude Code 2.1.74
- macOS (Darwin 25.3.0)
- Voice mode works great. This is about extending it, not fixing it.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗