Building a 100% Local Voice-to-Code Pipeline with Whisper and Claude Code
Discover how to set up an offline voice coding workflow on an M2 Mac, keeping client code and sensitive data completely secure without hitting cloud APIs.

Stock photo for illustration only, not from the actual event
- Set up a 100% local voice coding workflow with zero cloud data transmission.
- Powered by faster-whisper for transcription and Claude Code /voice for agent interaction.
- Use initial_prompt tuning to resolve technical terms and variable name accuracy.
- Achieve an average latency of 1.2 seconds per sentence on an M2 MacBook with 16GB RAM.
Voice coding with ChatGPT works well in practice, but comes with a major caveat: every spoken word travels directly to OpenAI. Since July 23, 2026, Codex has supported voice control to open pull requests or track down bugs in a single phrase. While convenient for side projects, it becomes a complete dealbreaker when dealing with proprietary client code.
Developers sought the same convenience without the data leaks, resulting in a fully local pipeline utilizing faster-whisper for transcription and Claude Code with the /voice command for agent execution. Nothing leaves the machine—neither voice data, context, nor source code. This article examines the exact setup, latency measurements on an M2 chip, and the two major bugs that cost half a day to resolve.
Voice coding conflates two entirely different paradigms. ChatGPT's voice mode is engineered for conversation, meaning it responds, pauses, and rephrases. Dictating code requires the exact opposite: a faithful, silent transcription that does not chat, rephrase, or add unsolicited text.

Stock photo for illustration only, not from the actual event
As of March 2026, Claude Code includes an integrated voice mode. Typing /voice in the terminal, holding the spacebar to speak, and releasing routes the transcription through a local Whisper instance rather than a remote API. For 90% of use cases, this suffices to dictate an intent, let the agent write the code, and review the outcome.
The workflow relies on three core components: audio capture, transcription, and prompt injection, utilizing sox for recording and faster-whisper for local text conversion.
A critical technical detail on macOS is that faster-whisper runs on the CPU rather than the GPU. While large models offer maximum precision, medium serves as the optimal balance for non-English languages, while distil variants should be avoided as they tend to hallucinate terms.
"Coder à la voix avec ChatGPT, ça marche. Le hic tient en une ligne : chaque mot que tu dictes part chez OpenAI."
Hernanz
Building a fully localized voice-to-code environment highlights the growing demand for data privacy and security among software engineers. Relying exclusively on cloud services poses risks to intellectual property, making hybrid local tools like Whisper and Claude Code vital for enterprise environments.
A hidden trap involves dictating precise identifiers like getUserData, which standard speech-to-text models often break apart or lowercase improperly. The solution relies on describing the functional intent rather than spelling out syntax, alongside utilizing initial_prompt parameters to prime the decoder with technical vocabulary.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment