How it works
PeonPing detects the runtime environment and routes audio accordingly:- SSH — Detected via
SSH_CONNECTION/SSH_CLIENTenv vars → relay atlocalhost:19998 - Devcontainer — Detected via
REMOTE_CONTAINERSenv var → relay athost.docker.internal:19998 - Codespaces — Detected via
CODESPACESenv var → relay athost.docker.internal:19998
SSH setup
Start the relay on your local machine
Connect with port forwarding
-R flag forwards port 19998 from the remote back to your local machine.If PeonPing detects an SSH or container session but can’t reach the relay, it prints setup instructions on
SessionStart.Devcontainers / Codespaces
No port forwarding needed — PeonPing auto-detectsREMOTE_CONTAINERS and CODESPACES environment variables and routes audio to host.docker.internal:19998.
The relay automatically resolves
host.docker.internal to your host machine.
Relay commands
| Command | Description |
|---|---|
peon relay | Start relay in foreground |
peon relay --daemon | Start in background |
peon relay --stop | Stop background relay |
peon relay --status | Check if relay is running |
peon relay --port=12345 | Custom port (default: 19998) |
peon relay --bind=0.0.0.0 | Listen on all interfaces |
Environment variables
| Variable | Default | Description |
|---|---|---|
PEON_RELAY_PORT | 19998 | Port to listen on |
PEON_RELAY_BIND | 127.0.0.1 | Address to bind to |
PEON_RELAY_HOST | localhost | Relay hostname (for clients) |
CLAUDE_PEON_DIR | ~/.claude/hooks/peon-ping | PeonPing install directory |
Relay API
The relay exposes three HTTP endpoints:GET /health
Health check. ReturnsOK if relay is running.
GET /play?category={category}
Recommended. Play a random sound from a CESP category. The relay picks the sound based on the active pack configured on your local machine.session.start— Session startstask.acknowledge— Task acknowledgedtask.complete— Task finishestask.error— Error occursinput.required— Permission neededresource.limit— Rate/token limituser.spam— Rapid prompts
GET /play?file={path}
Legacy. Play a specific sound file (relative toPEON_DIR).
POST /notify
Send a desktop notification.Lightweight remote hooks
If PeonPing isn’t installed on the remote, you can create a minimal hook that only sends category names to the relay:remote-hook.sh
~/.claude/settings.json on the remote:
Troubleshooting
No audio on remote
- Check relay is running:
peon relay --status - Test the connection from remote:
curl http://localhost:19998/health - Check SSH port forwarding:
ssh -R 19998:localhost:19998 ...
Container can’t reach relay
- Verify relay is listening:
peon relay --status - Test from container:
curl http://host.docker.internal:19998/health - On Linux, use
--bind=0.0.0.0and connect to host IP instead ofhost.docker.internal