/media-os:obs-websocket [request]from media-os
Remote-control OBS Studio via WebSocket RPC: authenticate with SHA-256 challenge/salt, send requests (scene switching, record/stream toggle, source filters, audio levels), subscribe to live events (CurrentProgramSceneChanged), and batch operations atomically.
Ships in media-os. 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.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
Remote-control a running OBS Studio instance via the bundled obs-websocket plugin (WebSocket RPC, protocol v5, default URL ws://localhost:4455). Scope: the WIRE PROTOCOL — auth handshake, Requests, Events, RequestBatch. For C++ plugins see obs-plugins; for Python/Lua inside OBS see obs-scripting; for installing/configuring OBS itself see obs-config.
Before you claim a Request, Event, or OpCode exists, confirm it against the live protocol docs:
# If you have the obs-docs skill installed separately, use its search command \
search --query "<RequestOrEvent>" --page obs-websocket-protocol --limit 3
Every name/field/status in this skill was verified against obs-websocket-protocol (5.x) at authoring time. Do NOT invent Request names — the server closes the connection with UnknownRequestType (204).
SetCurrentProgramScene)StartRecord / StopRecord / ToggleStream)eventSubscriptions = Scenes)CurrentProgramSceneChanged, RecordStateChanged, etc., from a monitor dashboard.If the user needs code that runs INSIDE OBS's own Python/Lua VM, use obs-scripting instead. If they need a native source / output / encoder, use obs-plugins.
OBS 28+ ships obs-websocket v5 BUNDLED. Older OBS needs the plugin installed manually from the obs-websocket GitHub repo.
4455.Test that the port is open:
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py check
v5 handshake (NOT v4.x — protocol completely changed, v4 is EOL).
Client ─── HTTP Upgrade ──▶ Server
Client ◀── OpCode 0 Hello ─ Server (authentication.{challenge,salt} if password set)
Client ── OpCode 1 Identify ▶ Server (rpcVersion=1, authentication=<hash>, eventSubscriptions=<mask>)
Client ◀── OpCode 2 Identified ─ Server (connection ready)
Auth algorithm (exact — verified against protocol spec):
secret = base64( sha256( password + salt ) )
auth = base64( sha256( secret + challenge ) )
Both base64 calls use STANDARD base64 (not URL-safe). SHA-256 is invoked twice. If authentication is absent from Hello, NO password is set — omit the field in Identify.
Minimal Python (websocket-client):
import json, base64, hashlib, uuid, websocket
ws = websocket.create_connection("ws://localhost:4455")
hello = json.loads(ws.recv())
d = hello["d"]
auth_field = {}
if "authentication" in d:
c, s = d["authentication"]["challenge"], d["authentication"]["salt"]
secret = base64.b64encode(hashlib.sha256(("pw" + s).encode()).digest()).decode()
auth_field["authentication"] = base64.b64encode(hashlib.sha256((secret + c).encode()).digest()).decode()
ws.send(json.dumps({"op": 1, "d": {"rpcVersion": 1, **auth_field, "eventSubscriptions": 4}}))
identified = json.loads(ws.recv())
assert identified["op"] == 2
req = {
"op": 6,
"d": {
"requestType": "SetCurrentProgramScene",
"requestId": str(uuid.uuid4()),
"requestData": {"sceneName": "Starting Soon"}
}
}
ws.send(json.dumps(req))
resp = json.loads(ws.recv()) # op=7 RequestResponse
assert resp["d"]["requestStatus"]["result"] is True
requestId is client-generated and echoed verbatim in the response — use it to correlate async replies. If a Request has no fields, omit requestData entirely (or send {}).
Via the helper CLI (see scripts/wsctl.py). The CLI is fully automatic — URL and password are discovered from OBS's own plugin_config/obs-websocket/config.json. No --url / --password flags exist. Override via OBS_WEBSOCKET_URL / OBS_WEBSOCKET_PASSWORD env vars (e.g. remote host):
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py ping
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py scene-switch --scene "Starting Soon"
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py record --action toggle
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py request --type GetStats
Events arrive unsolicited once you're Identified and subscribed. Pass eventSubscriptions as a bitmask in the Identify message (or later in Reidentify, OpCode 3).
Categories (verified):
| Bit | Name | Value |
|---|---|---|
| 0 | General | 1 |
| 1 | Config | 2 |
| 2 | Scenes | 4 |
| 3 | Inputs | 8 |
| 4 | Transitions | 16 |
| 5 | Filters | 32 |
| 6 | Outputs | 64 |
| 7 | SceneItems | 128 |
| 8 | MediaInputs | 256 |
| 9 | Vendors | 512 |
| 10 | Ui | 1024 |
| 11 | Canvases | 2048 |
| — | All | 4095 (OR of the above) |
| 16 | InputVolumeMeters (high-volume) | 65536 |
| 17 | InputActiveStateChanged (high-volume) | 131072 |
| 18 | InputShowStateChanged (high-volume) | 262144 |
| 19 | SceneItemTransformChanged (high-volume) | 524288 |
HIGH-VOLUME events (bits 16–19) are NOT in All. Opt in explicitly by ORing them in.
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py events --subscribe scenes,outputs
Event frame shape:
{"op": 5, "d": {"eventType": "CurrentProgramSceneChanged",
"eventIntent": 4,
"eventData": {"sceneName": "Main", "sceneUuid": "..."}}}
Atomic or parallel fan-out of multiple Requests in one message.
{"op": 8, "d": {
"requestId": "batch-1",
"haltOnFailure": false,
"executionType": 0,
"requests": [
{"requestType": "SetCurrentProgramScene", "requestData": {"sceneName": "BRB"}},
{"requestType": "SetInputMute", "requestData": {"inputName": "Mic", "inputMuted": true}}
]
}}
executionType: -1 None, 0 SerialRealtime (default, ordered, gap for realtime tick), 1 SerialFrame (ordered, lockstepped to video frame), 2 Parallel (faster, NO ordering guarantee).
Helper:
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py batch --requests-file scene-reset.json
obs-websocket-py must be v1.0+.+/=), not URL-safe.password + salt, outer hash = base64(inner) + challenge.All mask is 4095, not 2047. The enum includes Vendors (512) and Canvases (2048) in addition to the bit-0..bit-10 categories. High-volume bits (16–19) are deliberately excluded — add them manually if you need volume meters, active/show state, or scene-item transform change events.InputVolumeMeters fires every 50 ms. Only subscribe if you'll consume.requestId is yours. Client-generated, returned verbatim. Use it for request/response correlation in async clients.GetVersion, GetStats, GetSceneList) take no requestData — omit the key entirely.sceneName vs sceneUuid. Most scene Requests accept EITHER sceneName (string) or sceneUuid. Prefer name unless scenes can be renamed at runtime.GetSceneItemId (query by source name) or iterate GetSceneItemList.coreaudio_input_capture (macOS) vs wasapi_input_capture (Windows) vs pulse_input_capture (Linux). Always call GetInputKindList before creating an input programmatically.SetInputVolume accepts inputVolumeMul (0–20) OR inputVolumeDb (-100–26). Pass only one.OutputRunning (500) is the error code; stop the output first.CallVendorRequest is how plugins like StreamFX expose custom RPC — it's NOT an error, it's a passthrough channel.4009 AuthenticationFailed means wrong password; 4010 UnsupportedRpcVersion means you advertised an rpcVersion the server doesn't speak; 4007 NotIdentified means you sent a Request before Identified.executionType=2 is fastest but do not rely on sequencing between requests. Use 0 if order matters.wsctl.py has NO --url / --password flags. URL (from server_port) and password (from server_password when auth_required=true) are read straight from the local OBS's plugin_config/obs-websocket/config.json. To point at a remote or non-default instance, set OBS_WEBSOCKET_URL / OBS_WEBSOCKET_PASSWORD in the environment. Config paths: ~/Library/Application Support/obs-studio/... on macOS, %APPDATA%/obs-studio/... on Windows, ~/.config/obs-studio/... on Linux.# bind MIDI note 36 to switch to scene "Wide"
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py scene-switch --scene "Wide"
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py mute --input "Mic/Aux" --action toggle
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py replay-buffer --action save
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py events --subscribe scenes,outputs \
| jq 'select(.d.eventType=="CurrentProgramSceneChanged")'
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py request \
--type GetSceneItemTransform \
--data '{"sceneName":"Main","sceneItemId":42}'
OBS_WEBSOCKET_URL=ws://10.0.0.42:4455 \
OBS_WEBSOCKET_PASSWORD=hunter2 \
uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py ping
references/protocol.md — OpCodes, RequestStatus (100–703), close codes (4000–4012), EventSubscriptions bitmask, RequestBatch executionType, auth pseudocode, commonly-used Requests/Events grouped by category, client snippets for Python/Node/Go/browser, handshake diagram, keepalive strategy.connection refused on port 4455Cause: obs-websocket server disabled, OBS not running, or bound to a different interface.
Solution: Tools → obs-websocket Settings → Enable WebSocket server. Verify port with uv run ${CLAUDE_SKILL_DIR}/scripts/wsctl.py check.
Cause: Discovered password doesn't match the running server — usually because the user rotated the password from Tools → obs-websocket Settings but the file on disk hasn't been reloaded.
Solution: The helper reads plugin_config/obs-websocket/config.json at call time; if OBS hasn't flushed the config yet, restart OBS or override once with OBS_WEBSOCKET_PASSWORD=.... For custom clients: verify STANDARD base64 and hash TWICE (inner: pw+salt, outer: b64secret+challenge).
Cause: You advertised rpcVersion the server doesn't speak — usually a v4 client hitting a v5 server.
Solution: Use rpcVersion: 1 and a v5-compatible client library.
Cause: Sent a Request (OpCode 6) before receiving Identified (OpCode 2). Solution: Wait for the OpCode 2 message. Never pipeline Requests ahead of identification.
Cause: Typo or v4-era name. Common trap: SetCurrentScene (v4) vs SetCurrentProgramScene (v5).
Solution: Verify via the obs-docs search command before sending.
Cause: Bad sceneName, inputName, or sceneItemId.
Solution: Enumerate with GetSceneList, GetInputList, or GetSceneItemList first.
Cause: Tried to mutate encoder/output state while output was in the wrong state.
Solution: Stop the output (StopStream/StopRecord), reconfigure, then restart.
Cause: Subscribed to high-volume events (InputVolumeMeters fires every 50 ms).
Solution: Re-Identify (OpCode 3) with a narrower eventSubscriptions mask.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub damionrashford/media-os --plugin media-os110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
Other plugins' skills for the same job