Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Claude Code slash commands for on-demand voice mode lifecycle (install/teardown) #307

@jlmalone

Description

@jlmalone

Motivation

Voicemode is great when you need it, but leaving it permanently installed has real overhead:

  • Kokoro TTS and Whisper STT run as persistent launchd services, consuming CPU and memory even when you're not using voice at all
  • The MCP server auto-starts with every Claude Code session, adding startup latency
  • For sessions that are purely text-based coding (the majority), this is wasted resources

I wanted a way to spin up voice mode on demand and tear it down completely when I'm done — no lingering processes, no launchd agents respawning behind my back.

The solution: 3 slash commands

I created a set of Claude Code slash commands (~/.claude/commands/) that handle the full lifecycle:

/voice-on

Registers the voicemode MCP server with claude mcp add. Includes the setuptools<71 pin that's required for webrtcvad to actually work (since pkg_resources was removed in setuptools 71+, VAD silently falls back to fixed-duration recording without it).

/voice-standby

Persistent listen loop with two VAD modes — permissive (vad_aggressiveness: 0) when idle so it catches faint speech, switching to responsive (vad_aggressiveness: 2) during active conversation. Silently cycles the mic on blank audio instead of ending the session. Stays open indefinitely until the user says "exit voice mode."

/voice-off

Full teardown — not just claude mcp remove, but also:

  1. launchctl unload on both com.voicemode.kokoro and com.voicemode.whisper agents
  2. pkill -9 -f voicemode to catch anything still running
  3. Verification step to confirm clean shutdown

Without the launchd unload + kill steps, claude mcp remove alone leaves Kokoro and Whisper running as zombie services that respawn on their own.

Gist

https://gist.github.com/jlmalone/5bc93bbb57fa34b1b3767994913568b4

Drop all 3 files into ~/.claude/commands/ and they appear as /voice-on, /voice-off, /voice-standby slash commands in Claude Code.

Suggestion

It might be worth considering an official on-demand mode or at least documenting the teardown steps (launchd unload + process kill) — the claude mcp remove alone isn't sufficient for a clean shutdown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions