NarrateClaude¶
Talk to Claude Code and hear it answer. NarrateClaude turns the claude command into a voice loop, on macOS, Linux and Windows, with nothing but open-source parts running on your machine:
- A listener records the mic and cuts it into sentences with a voice activity detector, then transcribes each one with whisper.cpp (a full-precision f16 model, Metal on Apple Silicon).
- Each sentence is typed into
claude, which runs inside the loop's own pseudo-terminal, so any terminal app works. On macOS the original Apple Terminal mode is still the default. - Claude Code speaks while it works, through
~/.local/bin/speak: the local Piper voice out of the box, or a cloned copy of your own voice. - The mic pauses while the voice plays, so the assistant does not hear itself.
Apple's speech engine is still there as narrate-claude --apple.
Who it is for¶
- People who use Claude Code and want to work away from the keyboard for stretches.
- People who want a voice loop where speech recognition stays on the Mac. Pair it with claude-code-local to run the model locally too. Without a local model,
claudestill talks to Anthropic's servers. - Tinkerers who want a working example of continuous
SFSpeechRecognizerdictation with wedge detection and auto-respawn.
What is in the repo¶
| Part | File |
|---|---|
| Listener: VAD + whisper.cpp | dictation/voice/stt.py |
Session: claude in the loop's own pty |
dictation/voice/session.py |
| Default voice (Piper) | dictation/voice/speak.py |
| Optional Apple-speech listener (Swift) | dictation/src/Listen.swift |
| Supervisor: respawn loop, window watchdog, pipeline | dictation/bin/dispatch |
| Injector: types each sentence into the bound Terminal window | dictation/bin/inject |
Control CLI: setup, start, stop, status, toggle, tail, uninstall |
dictation/bin/dictation |
| One-click launcher | narrative-claude.sh |
| "Was that for me?" relevance filter | dictation/filter/relevance.py |
| Voiceprint filter and enrollment (Terminal.app mode) | dictation/filter/filter.py, enroll.py |
| Claude Code Stop hook that reads the last reply aloud | dictation/bin/speak-on-stop |
| Mic diagnostic | dictation/src/MicProbe.swift |
| The always-narrate instructions Claude Code reads | CLAUDE.md |
Screenshots and demo¶
There is no screenshot, GIF or demo video in the repo yet. The best record of how it behaves is the engineering log BARGE_IN_ATTEMPTS.md, which covers eight echo-cancellation attempts, with what failed and the measured results (for example 58 dB offline echo reduction for WebRTC AEC3 against 29.5 dB for SpeexDSP, and the live trials behind 2.0's barge-in).
Known limits¶
- The default macOS mode is Apple Terminal only;
narrate-claude --hereworks in any terminal (issue #2). - Barge-in (talk over the voice to stop it) is opt-in with
NARRATE_BARGE_IN=2, macOS only, and only for voices played as a WAV throughafplay, not Chatterbox. Without it, anything you say while a reply is playing is dropped. See Barge-in. - Lines under 3 words are dropped unless they end in
?or are a common short reply like "yes" or "stop". - English by default (
NARRATE_WHISPER_LANGchanges it with the multilingual model).
Details are on the Troubleshooting and FAQ pages.
Built on¶
whisper.cpp, Silero VAD, Piper, Apple's Speech framework (for --apple), Claude Code by Anthropic, MLX and mlx-lm for the optional relevance judge, Meta's Llama 3.2 3B as that judge's model, Resemblyzer for voiceprints, and Pocket TTS by Kyutai for the author's cloned voice. See Credits.