SLOPSHOPPER

cs-radio

Counter-Strike 1.6 radio calls for Claude Code: 'Fire in the hole' on deploys, 'Bomb has been defused' when a long turn lands. /radio to toggle.

guardcommandprocessaudio
★ 2v0.1.0MITupdated 2026-10-18ben-rogerson/claude-counter-strike
A shopper browsing a rack in a slop shop
Preview · a replayed session in a sandbox
claude · ~/work/app · cs-radio
› fix the failing auth test and add an audit log call ⏺ Read(src/auth.ts) ⎿ Read 6 lines ⏺ Update(src/auth.ts) ⎿ Added 2 lines, removed 1 line ⏺ Bash(bun test) ⎿ 3 pass, 1 fail ● Done. refresh now rejects expired claims and logs an audit event. ✻ Worked for 42s · done 4:20 PM › /radio ⎿ cs-radio: Radio off. ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── › ? for shortcuts
README

Claude Counter-Strike

Counter-Strike 1.6 radio calls for Claude Code.

WhenYou hear
Session starts"Locked and loaded"
A long turn finishes (45s+)"Bomb has been defused"
A turn errors"Negative"
You interrupt a turn"Fall back"
A deploy starts"Fire in the hole"
The deploy succeeds"Counter-Terrorists win"
The deploy fails"Terrorists win"

A deploy is any command Claude runs that looks like one: pnpm/npm/yarn/bun run deploy, wrangler deploy, vercel --prod, fly deploy, scripts/deploy.sh.

Install

In Claude Code:

/plugin marketplace add ben-rogerson/claude-counter-strike
/plugin install cs-radio@cs-radio

Or from your terminal:

claude plugin marketplace add ben-rogerson/claude-counter-strike
claude plugin install cs-radio@cs-radio

Function-hook plugins (mods) are early access in Claude Code, so you need a recent build.

Sounds

Claude Counter-Strike looks for sounds in this order:

  1. Valve's originals from your own Counter-Strike 1.6 install (they're not in this repo). It checks the usual Steam folders:
  2. macOS: ~/Library/Application Support/Steam/steamapps/common/Half-Life/cstrike/sound/radio
  3. Linux: ~/.steam/steam/... or ~/.local/share/Steam/... (same path from steamapps on)

If yours is somewhere else, set CS 1.6 radio folder in /config to the cstrike/sound/radio folder.

  1. Bundled soundalikes in sounds/, used when no install is found. They were made for this repo with Kokoro (Apache-2.0) text-to-speech plus a radio filter, so they're free to redistribute. Regenerate them with uv run scripts/make-sounds.py (see the script header).
  2. Your system voice, if a clip can't play.

Clips play on:

  • macOS: built in (afplay)
  • Linux: the first of paplay, pw-play or aplay it finds
  • Windows: PowerShell's SoundPlayer. It also checks C:/Program Files (x86)/Steam/... for a CS 1.6 install

Linux and Windows support is new and only covered by tests so far. If it doesn't play for you, please open an issue.

Commands

  • /radio - toggle on/off (remembered across sessions)
  • /radio on / /radio off
  • /radio test - plays "Counter-Terrorists win" and tells you where the sounds come from

Options (/config)

  • CS 1.6 radio folder - path to cstrike/sound/radio
  • Long turn (seconds) - how long a turn runs before "Bomb has been defused" plays. Default 45.

Develop

claude --plugin-dir .          # load it from this checkout
claude plugin validate .
claude plugin test .

License

MIT for the code and the bundled soundalikes. Counter-Strike and its original sounds are Valve's.

Want something quieter? Try Claude Arcade - 8-bit end-of-turn sounds.

Source 1 files
hooks/register.ts 178 lines
1import type { EngineInterface, Register } from 'claude-code'
2
3// Counter-Strike 1.6 radio calls for Claude Code events. /radio [on|off|test] toggles,
4// kept across sessions.
5//
6//   session start         "Locked and loaded"       locknload.wav
7//   long turn finishes    "Bomb has been defused"   bombdef.wav
8//   turn errors           "Negative"                negative.wav
9//   turn interrupted      "Fall back"               fallback.wav
10//   deploy starts         "Fire in the hole"        ct_fireinhole.wav
11//   deploy ok / failed    "Counter-Terrorists win"  ctwin.wav / terwin.wav
12//
13// Valve's wavs can't ship here, so they're read from your own CS 1.6 install (soundDir
14// option, else the usual Steam folders). Without them it plays the soundalikes in sounds/
15// (scripts/make-sounds.py), and speaks the call if those can't play.
16//
17// The engine's clip player is afplay, so it only plays on macOS. Linux plays clips with
18// paplay, pw-play or aplay and Windows with PowerShell's SoundPlayer.
19
20const CALLS = {
21  locknload: 'Locked and loaded',
22  bombdef: 'Bomb has been defused',
23  negative: 'Negative',
24  fallback: 'Fall back',
25  ct_fireinhole: 'Fire in the hole',
26  ctwin: 'Counter-Terrorists win',
27  terwin: 'Terrorists win',
28} as const
29type Call = keyof typeof CALLS
30
31const STEAM_RADIO = [
32  'Library/Application Support/Steam/steamapps/common/Half-Life/cstrike/sound/radio',
33  '.steam/steam/steamapps/common/Half-Life/cstrike/sound/radio',
34  '.local/share/Steam/steamapps/common/Half-Life/cstrike/sound/radio',
35]
36const WINDOWS_STEAM_RADIO = 'C:/Program Files (x86)/Steam/steamapps/common/Half-Life/cstrike/sound/radio'
37const LINUX_PLAYERS = ['paplay', 'pw-play', 'aplay']
38
39const DEPLOY = /\b(?:pnpm|npm|yarn|bun)\s+(?:run\s+)?deploy\b|\bwrangler\s+deploy\b|\bvercel\s+(?:--prod|deploy)\b|\bfly\s+deploy\b|scripts\/deploy\.sh/
40
41// 'engine': $.audio.play (macOS). A function: the command that plays a wav file.
42// undefined: nothing can play clips here, so calls are spoken.
43type Player = 'engine' | ((file: string) => string[]) | undefined
44
45let soundDir: string | undefined
46let player: Player
47const clips = new Map<Call, string>()
48
49async function isWindows($: EngineInterface) {
50  return (await $.env.get('OS')) === 'Windows_NT'
51}
52
53async function findPlayer($: EngineInterface): Promise<Player> {
54  if (await isWindows($)) {
55    return file => [
56      'powershell', '-NoProfile', '-NonInteractive', '-Command',
57      `(New-Object Media.SoundPlayer '${file.replaceAll("'", "''")}').PlaySync()`,
58    ]
59  }
60  const os = await $.process.run(['uname', '-s']).then(r => r.stdout.trim(), () => '')
61  if (os === 'Darwin' || !os) return 'engine' // !os: can't tell, keep the engine's player
62  for (const bin of LINUX_PLAYERS) {
63    const found = await $.process.run(['sh', '-c', `command -v ${bin}`]).then(r => r.exitCode === 0, () => false)
64    if (found) return file => [bin, file]
65  }
66  return undefined
67}
68
69async function findSoundDir($: EngineInterface, configured: string) {
70  const home = (await $.env.get('HOME')) ?? (await $.env.get('USERPROFILE')) ?? ''
71  const candidates = configured
72    ? [configured.replace(/^~(?=[\/\\])/, home)]
73    : (await isWindows($))
74      ? [WINDOWS_STEAM_RADIO]
75      : STEAM_RADIO.map(p => `${home}/${p}`)
76  for (const dir of candidates) {
77    if (await $.fs.exists(`${dir}/ctwin.wav`)) return dir
78  }
79  return undefined
80}
81
82async function isOn($: EngineInterface) {
83  return (await $.store.get('enabled')) !== false
84}
85
86async function play($: EngineInterface, call: Call) {
87  if (!(await isOn($))) return
88  const fail = (err: unknown) => $.ui.log(`cs-radio: ${err}`, { to: 'debug' })
89  const speak = () => void $.audio.speak(CALLS[call]).catch(fail)
90  if (!player) return speak()
91  if (player !== 'engine') {
92    const file = soundDir ? `${soundDir}/${call}.wav` : `${$.plugin.root}/sounds/${call}.wav`
93    const argv = player(file)
94    void $.process.run(argv, { timeoutMs: 15_000 })
95      .then(r => {
96        if (r.exitCode !== 0) throw new Error(r.stderr.trim() || `${argv[0]} exited ${r.exitCode}`)
97      })
98      .catch(err => (fail(err), speak()))
99    return
100  }
101  if (!soundDir) {
102    return void $.audio.play({ asset: `sounds/${call}.wav` }).catch(err => (fail(err), speak()))
103  }
104  try {
105    let base64 = clips.get(call)
106    if (!base64) {
107      const read = await $.fs.read(`${soundDir}/${call}.wav`, { as: 'bytes' })
108      base64 = read.base64
109      clips.set(call, base64)
110    }
111    void $.audio.play({ base64, mime: 'audio/wav' }).catch(fail)
112  } catch (err) {
113    fail(err)
114    speak()
115  }
116}
117
118export const register: Register = (on, options) => {
119  const longTurnMs = Number(options.longTurnSeconds ?? 45) * 1000
120
121  on('session.start', async ($, e, next) => {
122    soundDir = await findSoundDir($, String(options.soundDir ?? ''))
123    player = await findPlayer($)
124    await $.command.register({
125      name: 'radio',
126      description: 'Toggle Counter-Strike radio calls',
127      argumentHint: '[on|off|test]',
128      immediate: true,
129    })
130    await play($, 'locknload')
131    return next(e)
132  })
133
134  on('command.run', { command: 'radio' }, async ($, e) => {
135    const arg = e.args.trim().toLowerCase()
136    const source = !player
137      ? 'your system voice (no audio player found)'
138      : soundDir
139        ? `wavs from ${soundDir}`
140        : 'the bundled soundalikes (no CS 1.6 radio folder found, set soundDir in /config)'
141    if (arg === 'test') {
142      if (!(await isOn($))) return { text: 'Radio is off - /radio on first.' }
143      await play($, 'ctwin')
144      return { text: `Radio check: Counter-Terrorists win. Using ${source}.` }
145    }
146    if (arg && arg !== 'on' && arg !== 'off') return { text: 'Usage: /radio [on|off|test]' }
147    const now = arg ? arg === 'on' : !(await isOn($))
148    await $.store.set('enabled', now)
149    if (now) await play($, 'locknload')
150    return { text: `Radio ${now ? 'on' : 'off'}.` }
151  })
152
153  on('turn.complete', async ($, e, next) => {
154    if (e.reason === 'aborted') await play($, 'fallback')
155    else if (e.reason === 'error') await play($, 'negative')
156    else if (e.reason === 'answer' && e.durationMs >= longTurnMs) await play($, 'bombdef')
157    return next(e)
158  })
159
160  // deploys Claude runs through Bash
161  on('tool.call', { tool: 'Bash' }, async ($, e, next) => {
162    if (!DEPLOY.test(e.command) || e.run_in_background) return next(e)
163    await play($, 'ct_fireinhole')
164    const ran = await next(e)
165    if (ran.deny === undefined) await play($, ran.isError ? 'terwin' : 'ctwin')
166    return ran
167  })
168
169  // deploys other plugins spawn
170  on('process.spawn', async function* ($, e, next) {
171    if (!DEPLOY.test(e.argv.join(' '))) return yield* next(e)
172    await play($, 'ct_fireinhole')
173    const result = yield* next(e)
174    if (result.deny === undefined) await play($, result.value.code === 0 ? 'ctwin' : 'terwin')
175    return result
176  })
177}
178