brain-speak
README.md
# Brain Speak: make your terminal talk to you
[](https://glama.ai/mcp/servers/KennethAtchon/brain-speak)
**Text-to-speech for Claude Code, Codex and OpenCode on macOS.** Your AI coding agent says short updates out
loud ("the build passed", "I need your answer on the schema") in a natural local voice, so you can look away
from the terminal. Run five agent tabs at once and they take turns through one speaker. A menu-bar popover
shows who is speaking and what they said, and lets you replay, pause, mute or jump to any tab.
Free and local: Kokoro-82M neural voice on Apple Silicon (macOS `say` as fallback), no API keys, no cloud.
```
/plugin install brain-speak --marketplace KennethAtchon/brain-speak
```

Most "make Claude talk" tools read every reply aloud. Brain Speak is built for running several agents at once:
- **The model decides what's worth saying.** Agents call a `speak` tool (MCP) with a short spoken update;
everything else stays text.
- **One voice, nothing lost.** An update that arrives while another is playing is not talked over and not
queued behind it (a queue of stale progress is worse than silence): it is saved, audio and all, as
*skipped*. The menu-bar icon shows how many you have not heard, Recent pins them on top, and
**Play all** (or ⌃⌥S) catches you up oldest first. Your own replays are never cut off by new speech.
- **Duplicates play once**, and a muted tab never speaks (muting mid-sentence stops it).
- **Replay the last 20 updates**, with a real waveform, scrubber, ±10 s and speed (0.8×–2×). Recent shows
the newest five; older ones are pruned with their audio (heard ones first, unheard skipped ones last).
- **Per-tab control**: every open agent tab is listed by tool (Claude Code / Codex / OpenCode) with its
status (Speaking, Working, Idle, Muted), its own updates (click the row), its skipped count, a mute switch
and a button that brings its iTerm2 or Terminal tab to the front.
- **Resume closed sessions**: tabs closed in the last two days stay listed with a **Resume** button that
opens a new terminal tab running `claude --resume` (or `codex resume`, `opencode --session`) in the
session's folder, with the switches and experimental flags it was started with.
- **Holds speech while you talk**: when an app is recording from the microphone (a call, dictation), new
updates are saved as skipped instead of played over you. Optional: say the project name first, so you
can tell tabs apart by ear.
- **Talk back.** When an update from a Claude Code, Codex or OpenCode tab finishes, Brain Speak chimes and
listens for five seconds. Answer out loud and your words are transcribed by [OpenWhispr](https://github.com/OpenWhispr/openwhispr)'s
local model, shown for a moment (Cancel or ⌃⌥. to drop them), then typed into that tab as its next prompt,
so you can go back and forth without touching the keyboard. The agent's answer is never skipped: for five
minutes after you reply, its updates wait for the speaker. ⌃⌥V replies to the newest update at any time.
Guards: it never types into a tab whose screen (or Claude's own session registry) shows an approval
prompt, since Return there would approve it; it does not listen while another app records (OpenWhispr
dictation, a call) or plays sound (a video, whose words the mic would hear); and it checks the tab took
your words, copying them for you if it did not. Your replies are saved with the updates.
- **A voice per tab**: each open tab speaks with its own Kokoro voice (your main voice first), so you can
tell agents apart by ear. Right-click a tab to pick its voice; turn it off in the gear menu.
- **Approval alerts**: when Claude Code stops to ask permission, you hear "azelify needs your permission to
use Bash." It waits for the current update rather than being skipped (Notification hook).
- **Fast**: Kokoro stays loaded in a small background server, so an update is ready in a fraction of a
second instead of reloading the model each time (about 2.5 s); it exits after 30 idle minutes.
- **Shortcuts anywhere**: ⌃⌥P pause/resume, ⌃⌥. stop (or cancel a reply), ⌃⌥R replay the latest, ⌃⌥S play
skipped, ⌃⌥V reply by voice.
- **Local and free.** Kokoro-82M through [MLX-Audio](https://github.com/Blaizzy/mlx-audio) on Apple Silicon,
macOS `say` as the fallback. No API keys, nothing leaves your Mac.
## Install
**Claude Code, one step** (adds the `speak` MCP tool, the session hook and a `talk-to-me` skill):
```
/plugin install brain-speak --marketplace KennethAtchon/brain-speak
```
or from a shell: `claude plugin marketplace add KennethAtchon/brain-speak && claude plugin install brain-speak@brain-speak`.
Claude can talk right away (through `afplay`); the menu-bar app below adds replay, skipped updates, pause and per-tab mute.
**Menu-bar app and Kokoro voice** (macOS 14+, Swift toolchain from Xcode or Command Line Tools; the engine is plain Python 3):
```bash
git clone https://github.com/KennethAtchon/brain-speak && cd brain-speak
pip install mlx-audio # optional: Kokoro voice (Apple Silicon); otherwise macOS `say` is used
scripts/install.sh # builds ~/Applications/Brain Speak.app and starts it at login
bin/brain-speak say "Hello from Brain Speak"
```
If mlx-audio lives in its own virtualenv, point the installer at it:
`BRAIN_SPEAK_MLX_PYTHON=/path/to/venv/bin/python scripts/install.sh` (and `BRAIN_SPEAK_HF_HOME` for a
non-default Hugging Face cache). The voice list in the popover comes from the Kokoro model in that cache.
## Connect your agents
**Claude Code** (if you did not use the plugin): add the MCP server and the session hook (the hook labels the tab with its folder and title):
```bash
claude mcp add brain-speak -- /path/to/brain-speak/bin/brain-speak mcp
```
```jsonc
// ~/.claude/settings.json
{
"hooks": {
"SessionStart": [{ "hooks": [{ "type": "command", "command": "/path/to/brain-speak/bin/brain-speak register --event session --remind" }] }],
"UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "/path/to/brain-speak/bin/brain-speak register --event prompt --remind" }] }],
"Notification": [{ "matcher": "permission_prompt|elicitation_dialog", "hooks": [{ "type": "command", "command": "/path/to/brain-speak/bin/brain-speak notify" }] }]
}
}
```
`--remind` tells the model to use the `speak` tool and passes its session id; `notify` speaks approval requests. Typing "quiet this session"
or "voice on" as a prompt mutes or unmutes that tab.
**Codex**: `codex mcp add brain-speak -- /path/to/brain-speak/bin/brain-speak mcp`. Codex sets
`CODEX_THREAD_ID`, so each thread gets its own row.
**OpenCode**: add an MCP entry to `opencode.json`:
```json
{ "mcp": { "brain-speak": { "type": "local", "command": ["/path/to/brain-speak/bin/brain-speak", "mcp"] } } }
```
**Anything else** can shell out: `brain-speak say "text" --session-id <id> --background`.
## FAQ
**How do I make my terminal talk to me?** Install Brain Speak (above). Your agent calls its `speak` tool and
you hear the update through your speakers. From any script: `bin/brain-speak say "Deploy finished"`.
**Can Claude Code read its responses out loud?** Yes. Claude Code's built-in `/voice` is speech-to-text (you
talk, it types). Brain Speak is the other direction: Claude talks back. It speaks a short spoken version
chosen by the model, not the whole reply with code and markdown.
**How do I get a voice notification when Claude Code (or Codex) finishes?** The plugin's hook tells Claude to
speak when it finishes something meaningful, fails, or needs your input. You hear it even when another app is in front.
**Does it work with several agents at once?** That is what it is for. Updates take turns through one voice;
an update that arrives while another is playing is saved as skipped (the menu-bar icon counts them), so
stale progress never piles up and nothing is lost. Each tab can be muted on its own.
**Is it free? Does it send my code anywhere?** Free and MIT-licensed. Speech is generated on your Mac
(Kokoro through MLX-Audio, or macOS `say`). Nothing is sent to a server.
**Which voices?** All Kokoro voices in your local model (American and British English and more), picked in
the menu bar. Playback speed 0.8× to 2×.
**Can I answer by voice?** Yes, with OpenWhispr installed and its local model selected (it runs the
transcription server Brain Speak uses). macOS asks once for microphone access. Replies go to Claude Code
tabs in iTerm2 or Terminal; turn the mic button in the popover off to stop listening after updates.
**Linux or Windows?** The engine is portable Python; the menu-bar app and the defaults (`say`, `afplay`) are macOS only for now.
**How do I stop it?** Press ⌃⌥. to stop the current update or ⌃⌥P to pause (new updates are saved while
paused). Say "quiet this session" in the chat, flip the tab's switch in the menu bar, or press Mute all.
## How it works
```
agent ──speak──▶ brain-speak engine ──────────────▶ Brain Speak.app (menu bar)
│ quiet? busy? duplicate? │ plays the WAV (AVAudioPlayer):
│ Kokoro / say → recent/<id>.wav │ pause, seek, speed, waveform
└ requests/<id>.json ─────────────┘ reports playback.json
(no app running → afplay)
```
The engine and the app share one folder, `~/Library/Application Support/Brain Speak/voice`
(override with `BRAIN_SPEAK_HOME`): `sessions/` (one file per agent session: tab, folder, title, mute, how
it was launched; closed ones are forgotten after two days), `recent/` (the last 20 updates and their WAVs,
skipped ones marked), `settings.json` (voice, speed, announce, hold for mic), `control.json` (pause),
`playback.json` (what is playing). A file lock gives one speaker; the app's heartbeat (`app.json`) decides
whether it or `afplay` plays.
Open tabs come from Claude Code's live session registry (`~/.claude/sessions`) and from each agent process
still alive on its terminal; a `/clear` keeps the tab's mute.
## Develop
```bash
python3 -m unittest discover -s engine/tests # engine rules
cd app && swift build -c release
.build/release/BrainSpeak --snapshot /tmp/popover.png # render the popover with sample data
```
`docs/design/mock.png` is the design the popover was built from.
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues