/tkm:relay-setupfrom tkm
Configures tokenmon remote sound relay for SSH/Docker environments. Detects remote context, reads current config, and guides enabling/disabling relay audio.
Ships in tkm. 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 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
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub thunderconch/tkm --plugin tkm13 skills in this plugin
/callCall Your PokémonCall a Pokémon by name and it reacts based on bond (EV). Korean: 불러, 불러줘, 야, 이리와, 포켓몬 이름, 반응, 파이숭이야, 불꽃숭이야/doctorTokenmon DoctorTokenmon install diagnostics. Verify dependencies, StatusLine, CLI, data, assets, sprite rendering, multi-gen migration. Korean: doctor, 진단, 설치 확인, 안 돼요/friendly-battleExecuteTokenmon friendly battle. Real PvP turn loop against another player on the same network. Korean: 친선전, 친선 배틀, 배틀, 대전, friendly battleOther plugins' skills for the same job