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.4.0.tar.gz (12.2 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.4.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claude_tts_hook-0.4.0.tar.gz
  • Upload date:
  • Size: 12.2 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.4.0.tar.gz
Algorithm Hash digest
SHA256 c1a669586ae08410a20e6c6a06c9d9644751785ac9a37d9027c7efff89795192
MD5 337df8b03095a0319c3864917c68acbf
BLAKE2b-256 a7a9fa2121ebcb0802f24243b857584816998d69033c3c6f26f0961749c715b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: claude_tts_hook-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77ec8b970439d264830d0584bac009cd8bd1eab2051f238680cf9890fc351a23
MD5 68cc50ebbd28be388f76a4ffcf049102
BLAKE2b-256 938b28ee8b1169bb587e91822b1d2e401244ef4f8afc580cc41f8536c6f0b1e0

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