/tg-voice:voice-to-text-configfrom tg-voice
Sets up local Whisper-based transcription for Telegram voice messages. Checks faster-whisper installation, downloads the model, and verifies end-to-end hook functionality.
Ships in tg-voice. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Set up local Whisper-based transcription for Telegram voice messages.
Run each step sequentially. Report status clearly after each one.
python -c "import faster_whisper; print(f'faster-whisper {faster_whisper.__version__} installed')" 2>&1
pip install faster-whisper
Verify the install succeeded before continuing.The default model is controlled by the WHISPER_MODEL env var (default: base).
Available sizes: tiny (~40MB, fastest), base (~75MB, good balance), small (~250MB), medium (~750MB, most accurate for CPU).
Ask the user which model size they want if they haven't specified one. Then check if it's cached:
python -c "
import os, sys
from huggingface_hub import try_to_load_from_cache
model = os.environ.get('WHISPER_MODEL', 'base')
cached = try_to_load_from_cache(f'Systran/faster-whisper-{model}', 'model.bin')
if cached:
print(f'Model \"{model}\" is cached at: {cached}')
else:
print(f'Model \"{model}\" is NOT cached yet — needs download')
sys.exit(1)
" 2>&1
If not cached, download it:
python -c "
import os, sys
model = os.environ.get('WHISPER_MODEL', 'base')
print(f'Downloading whisper model \"{model}\"... (this may take a minute)')
from faster_whisper import WhisperModel
m = WhisperModel(model, device='cpu', compute_type='int8')
print(f'Model \"{model}\" downloaded and ready.')
" 2>&1
Important: This download can take 1-3 minutes on first run. Let the user know progress is happening.
If there's a voice file in the Telegram inbox, test transcription against it. This direct Whisper call checks the engine; it does not verify that Claude Code runs the hook or receives its output.
python -c "
import glob, os, sys
from faster_whisper import WhisperModel
inbox = os.path.expanduser(r'~\.claude\channels\telegram\inbox')
files = sorted(glob.glob(os.path.join(inbox, '*.oga')), key=os.path.getmtime, reverse=True)
if not files:
print('No .oga voice files found in inbox to test against.')
sys.exit(0)
f = files[0]
print(f'Testing transcription on: {os.path.basename(f)}')
model_size = os.environ.get('WHISPER_MODEL', 'base')
model = WhisperModel(model_size, device='cpu', compute_type='int8')
segments, info = model.transcribe(f, beam_size=5)
text = ' '.join(seg.text.strip() for seg in segments)
lang = getattr(info, 'language', 'unknown')
prob = getattr(info, 'language_probability', 0)
print(f'Language: {lang} ({prob:.0%})')
print(f'Transcription: {text}')
" 2>&1
Locate this installed SKILL.md through the current host's skill metadata or file tools. Resolve ../.. from its directory to get the absolute plugin root. Read .claude-plugin/plugin.json and resolve its hooks path from that root; if the field is absent, check the default hooks/hooks.json. Verify the registered configuration exists and contains a PostToolUse command targeting mcp__plugin_telegram_telegram__download_attachment.
Check that the command's script exists. A hooks file in an undeclared custom location does not establish registration.
To verify delivery, observe an actual voice attachment download in Claude Code, then confirm the registered hook runs and its hookSpecificOutput.additionalContext contains the transcription. Keep this result separate from the manual engine test. If no actual event has been observed, report delivery as not checked.
Summarize:
Claim voice transcription is ready only after an actual hook event confirms delivery. If the prerequisites pass but delivery is not checked, say: "Transcription setup passed. Send a voice message on Telegram to verify the hook delivers its transcript."
If the user wants a different model size, they can set WHISPER_MODEL in their environment (e.g., in .claude/settings.json env section or system env vars).
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dmitriyyukhanov/agent-plugins --plugin tg-voice