Skip to content
williycolePublic

About

Hear your AI coding agent instead of reading it. macOS, zero deps, queues across panes, global hush hotkey.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

say

Hear your AI coding agent instead of reading it. macOS, zero dependencies beyond what ships with the OS (say, afplay, afinfo) and jq.

Built for a terminal with many agent panes open: replies queue instead of talking over each other, each one is prefixed with the repo it came from, a global hotkey hushes everything, and nothing speaks unless you asked it to.

Commands

Command What it does
/say Speak a short, plain-English version of the last reply
/say:full Speak the whole last reply
/say:on / /say:off Auto-read a one-line spoken summary of every reply
/say:stop Cut off speech now (also Ctrl+Cmd+S with the hotkey installed)
/say:quiet Mute/unmute this pane only (needs a HERDR_PANE_ID-style pane id)
/say:test Speak a test line and show the last log lines

Default is silent. /say is on demand. /say:on turns on auto mode: the agent is asked to end every reply with one 🔊 line, a 1-3 sentence spoken summary, and only that line is spoken, prefixed with the repo name. Sending a new prompt does not cut speech; only /say:stop or the hotkey does.

Install

Requires macOS, Claude Code, and jq (brew install jq).

git clone https://github.com/williycole/say
cd say && ./install.sh

Then restart Claude Code and run /say:test. If you keep several config dirs, run CLAUDE_CONFIG_DIR=~/.claude-work ./install.sh for each.

Or point your agent at this repo and say "install this". AGENTS.md tells it what to do.

What install does

  • copies hooks/say-reply.sh and commands/say*.md into ~/.claude
  • adds two hooks to ~/.claude/settings.json (Stop, UserPromptSubmit); the exact JSON is in hooks/claude-settings.hooks.json
  • nothing else. Uninstall = delete those files and the two hook entries.

The stop hotkey is separate and optional: hotkeys/README.md.

How it works

One bash script, hooks/say-reply.sh, driven by two Claude Code hooks.

  • Stop hook gets the finished reply as JSON, strips markdown and code blocks, saves it for /say:full, and in auto mode queues the 🔊 line.
  • UserPromptSubmit hook injects the "end with a 🔊 line" instruction when auto mode is on. No extra model call: the summary is written in the same reply.
  • Playback renders to an AIFF with say -o, checks the file has length, then plays it with afplay. An empty render means macOS's speechsynthesisd is wedged (a known state where say exits 0 and plays nothing); the script restarts it and renders once more. A 1.2s leading silence lets a sleeping Bluetooth headset wake before the first word.
  • Queue is a pid-owned lock directory in $TMPDIR. Concurrent sessions take turns; a dead owner is recovered. Playback is detached into its own process group so it survives the hook being reaped.
  • Silent on purpose for claude -p runs (CLAUDE_CODE_ENTRYPOINT is not cli), SAY_QUIET=1, a muted pane, or auto mode off. Autonomous overnight loops stay quiet.
  • Log: every decision is one line in ~/.claude/say.log, bounded. Read it before guessing why something was silent.

Script modes:

say-reply.sh            Stop-hook mode, JSON on stdin
say-reply.sh --prompt   UserPromptSubmit-hook mode
say-reply.sh --last F   speak file F now (any agent can use this)
say-reply.sh --test     speak a fixed line through the full path
say-reply.sh --stop     flush queue, cut speech
say-reply.sh --on|--off auto mode toggle
say-reply.sh --quiet    toggle mute for this pane

Test

./test.sh                              # the repo copy
./test.sh ~/.claude/hooks/say-reply.sh # the installed copy

Plays silence only. Queues three replies, fires --stop the way a hotkey tool does (bare environment, no TMPDIR), and fails if any waiter, the player, or the lock survives, or if the live Karabiner rule no longer runs --stop. Run it after touching the script or the hotkey. It cuts any speech playing at the time.

Other agents

Only the hook-mode input parsing is Claude-specific (field names last_assistant_message, cwd, scratchpad_dir, transcript_path). --last FILE and --stop work from anything that can run a shell command. Adapters for OpenCode, Pi and Codex are on the backlog.

Roadmap

Backlog lives in openspec/backlog/: Linux support, agent adapters, spoken alerts for questions and permission prompts, better voices, and a rewrite in C.

License

MIT

About

Hear your AI coding agent instead of reading it. macOS, zero deps, queues across panes, global hush hotkey.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages