From tkm
Configures tokenmon remote sound relay for SSH/Docker/WSL environments. Detects remote setup, reads config, presents status, and prompts to enable/change/disable audio relay to local machine.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tkm:relay-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up or modify tokenmon remote sound relay configuration.
Set up or modify tokenmon remote sound relay configuration.
export CLAUDE_PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$(ls -d ~/.claude/plugins/marketplaces/tkm 2>/dev/null || ls -d ~/.claude/plugins/cache/tkm/tkm/*/ 2>/dev/null | sort -V | tail -1)}"
echo "CLAUDE_PLUGIN_ROOT=${CLAUDE_PLUGIN_ROOT}" && test -n "${CLAUDE_PLUGIN_ROOT}" && test -f "${CLAUDE_PLUGIN_ROOT}/package.json" && echo "OK" || echo "FAIL"
OK → proceed to Step 1.FAIL → inform the user: tokenmon is not installed. Install first via /plugin install tkm@tkm.Run the following to detect the current environment:
node -e "
const fs = require('fs');
const env = {
ssh: !!(process.env.SSH_CONNECTION || process.env.SSH_CLIENT || process.env.SSH_TTY),
docker: fs.existsSync('/.dockerenv') || (fs.existsSync('/proc/1/cgroup') && fs.readFileSync('/proc/1/cgroup','utf8').includes('docker')),
wsl: false,
remote_container: !!process.env.REMOTE_CONTAINERS,
};
try { env.wsl = /microsoft/i.test(fs.readFileSync('/proc/version','utf8')); } catch {}
env.is_remote = env.ssh || env.docker || env.remote_container;
env.is_local_wsl = env.wsl && !env.ssh;
console.log(JSON.stringify(env));
"
Parse the JSON output.
TSX="${CLAUDE_PLUGIN_ROOT}/bin/tsx-resolve.sh"
"${TSX}" "${CLAUDE_PLUGIN_ROOT}/src/cli/tokenmon.ts" config-dump 2>/dev/null || node -e "
const fs = require('fs');
const home = process.env.HOME || require('os').homedir();
const gcPath = home + '/.claude/tokenmon/global-config.json';
const gc = JSON.parse(fs.readFileSync(gcPath, 'utf8'));
const gen = gc.active_generation || 'gen4';
const cfgPath = home + '/.claude/tokenmon/' + gen + '/config.json';
const cfg = fs.existsSync(cfgPath) ? JSON.parse(fs.readFileSync(cfgPath, 'utf8')) : {};
console.log(JSON.stringify({
relay_audio: cfg.relay_audio || false,
relay_host: cfg.relay_host || 'localhost',
relay_sound_root: cfg.relay_sound_root || '',
peon_ping_port: cfg.peon_ping_port || 19998,
}));
"
Based on the detected environment and current config, present the situation to the user using AskUserQuestion.
If remote environment detected (SSH or Docker) AND relay_audio is currently false:
I detected you're running in a remote environment ({ssh/docker/remote_container}). Tokenmon sounds won't play here because there's no audio output.
I can enable relay mode to route sounds to your local machine via the peon-ping relay (localhost:{port}).
Current config:
- relay_audio: {value}
- relay_host: {value}
- relay_sound_root: {value}
Options:
If local environment (WSL, not SSH):
You're running locally on WSL. Tokenmon can play sounds directly. Relay mode is typically for remote environments.
Current relay config: relay_audio={value}
Options:
If relay_audio is already enabled:
Relay mode is currently active.
Current config:
- relay_audio: true
- relay_host: {relay_host}
- relay_sound_root: {relay_sound_root}
- port: {peon_ping_port}
Options:
Based on the user's choice:
Enable relay (default settings):
TSX="${CLAUDE_PLUGIN_ROOT}/bin/tsx-resolve.sh"
"${TSX}" "${CLAUDE_PLUGIN_ROOT}/src/cli/tokenmon.ts" config set relay_audio true
"${TSX}" "${CLAUDE_PLUGIN_ROOT}/src/cli/tokenmon.ts" config set relay_sound_root tkm-sounds
Enable with custom settings:
Ask the user for:
relay_host (default: localhost) — "What host is the relay running on?"relay_sound_root (default: tkm-sounds) — "What's the symlink name in the peon-ping directory?"Then apply each with config set.
Disable relay:
TSX="${CLAUDE_PLUGIN_ROOT}/bin/tsx-resolve.sh"
"${TSX}" "${CLAUDE_PLUGIN_ROOT}/src/cli/tokenmon.ts" config set relay_audio false
curl -sf --max-time 2 http://localhost:19998/health 2>/dev/null && echo "RELAY_OK" || echo "RELAY_FAIL"
RELAY_OK → Tell the user: "Relay is reachable. Sounds will play on your local machine."
RELAY_FAIL → Tell the user: "Relay is not reachable from this environment. Check that:
peon relay --daemon)ssh -R 19998:localhost:19998 <host>)ls ~/.claude/hooks/peon-ping/tkm-soundsFor one-click local setup, run on your LOCAL machine:
./scripts/setup-relay-local.sh <REMOTE_HOST>"
Ask the user if they want to hear a test sound:
curl -sf --max-time 3 -H "X-Volume: 0.5" "http://localhost:19998/play?file=tkm-sounds%2Fsfx%2Fgacha.wav" 2>/dev/null && echo "SOUND_OK" || echo "SOUND_FAIL"
SOUND_OK → "Did you hear a sound on your local machine?"SOUND_FAIL → "Sound test failed. The symlink or sound files may be missing on the local side."After all steps, show a summary:
Relay Configuration:
relay_audio: {true/false}
relay_host: {value}
relay_sound_root: {value}
port: {peon_ping_port}
relay status: {OK/unreachable}
To change later:
/tkm:relay-setup — Re-run this wizard
tokenmon config set ... — Set individual values
npx claudepluginhub thunderconch/tkm --plugin tkmEnables voice conversations with Claude Code using speech-to-text and text-to-speech. Includes setup, diagnostics, and MCP-based voice interaction.
Manages echook audio notifications for Claude Code, Cursor, and Codex: installs, configures, snoozes, mutes, tests, troubleshoots, and monitors context window usage.
Manage Claude Code sound feedback — select, enable/disable sound packs, adjust volume, mute/unmute, play test sounds, and view status.