Skip to main content

Claude Code hook that reads assistant messages aloud via a local TTS engine

Project description

claude-tts-hook

Claude Code hook that reads assistant messages aloud via a local TTS engine.

Features

  • Plugs into Claude Code's MessageDisplay hook — no polling, no transcript parsing needed
  • Splits long responses into chunks and speaks them sequentially
  • Cleans Markdown before speaking (strips code blocks, headings, links, etc.)
  • Converts English words / camelCase identifiers to katakana for natural Japanese TTS
  • Multi-backend: drop in your preferred local TTS engine

Supported backends

Backend OS Free Notes
Voisona Talk Win / Mac REST API on localhost:32766
VoiceVox Win / Mac / Linux REST API on localhost:50021

Installation

uv tool install claude-tts-hook

Or run without installing:

uvx claude-tts-hook --help

Setup

1. Create config

uvx claude-tts-hook init

This creates ~/.config/claude-tts-hook/config.json (Windows: %APPDATA%/claude-tts-hook/config.json). Edit it to set your backend and credentials:

{
  "backend": "voisona",
  "max_text_len": 500,
  "debug": false,
  "voisona": {
    "language": "ja_JP",
    "voice_name": null,
    "voice_version": null,
    "auth": "username:password",
    "poll_interval": 0.5,
    "poll_timeout": 60.0
  },
  "voicevox": {
    "speaker_id": null
  }
}

2. Pick a voice

uvx claude-tts-hook pick

3. Register as a Claude Code hook

uvx claude-tts-hook register

Or add manually to ~/.claude/settings.json:

{
  "hooks": {
    "MessageDisplay": [
      {
        "matcher": "",
        "hooks": [{ "type": "command", "command": "uvx claude-tts-hook" }]
      }
    ]
  }
}

CLI

claude-tts-hook init [--force]          # create default config
claude-tts-hook show                    # show config (password masked)
claude-tts-hook set KEY VALUE           # update a config value
claude-tts-hook voices                  # list voices from the API
claude-tts-hook pick                    # interactive voice picker
claude-tts-hook register [--command ] # register as Claude Code hook
claude-tts-hook unregister [--command ] # remove hook registration

Setting config values

Top-level keys (backend, max_text_len, debug) are set directly:

claude-tts-hook set backend voicevox
claude-tts-hook set debug true

Backend-specific keys use backend.field notation:

claude-tts-hook set voisona.auth "user:pass"
claude-tts-hook set voicevox.speaker_id 1

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_tts_hook-0.3.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_tts_hook-0.3.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file claude_tts_hook-0.3.1.tar.gz.

File metadata

  • Download URL: claude_tts_hook-0.3.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for claude_tts_hook-0.3.1.tar.gz
Algorithm Hash digest
SHA256 13cea2283c091a70917d61123c4ff4f1ad7facaa0ccb9223aa32ed51429db969
MD5 a35e98bb09f88abc162030a070997c49
BLAKE2b-256 47f7843403ea1aa08982e3a60d252a1fb58f60f4a9aa230b1e30a048af6846e0

See more details on using hashes here.

File details

Details for the file claude_tts_hook-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: claude_tts_hook-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for claude_tts_hook-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 29dc13867e11f61192b3f867e096b041e3dfb80c37785db9f2080bb5ab29f315
MD5 8ef189d27b12dcb9febdacdf377a40e5
BLAKE2b-256 9d860e2f98c9b1ee8355d427659c773071fbb7bad1052e3de9079a268216049c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page