OpenCode Plugin
Humans interrupt, clarify, and change direction mid-sentence. AI should too. Interrupt lets you speak at any moment without losing context or waiting for the AI to finish.
Without interrupt — you wait. It never hears you.
you actually make it recursive
ai ...prev, curr, and next. You initialise prev as None, curr as head, then...
↪ You wait 30 seconds for the AI to finish explaining the wrong thing. It never heard you. Now you start over.
With interrupt — mid-sentence pivot
you actually make it recursive
interrupt /ptt typed · abort + record · whisper transcribed
ai Recursive approach: base case when node is None. Recurse on the rest, update the next pointer...
↪ The AI pivoted mid-sentence. It heard you. No waiting. No repeating.
Live demo
What you get
Free
Walkie-talkie mode
Type /ptt the moment the AI goes off track — generation stops, TTS cuts, mic opens. Speak your correction, type /ptt again, and the AI pivots mid-sentence. Transcripts are auto-cleaned — filler words, stutters, and false starts are stripped. When OPENAI_API_KEY is set, AI polishing extracts your final intent and fixes sentence structure like Wispr. Free: 20 interrupts/day.
Free
Streaming TTS
Speaks responses as they arrive via edge-tts neural voices. No waiting for the full response — audio plays the moment a sentence is detected. Built in, no separate plugin needed.
Free
Privacy-first
All audio processing is local — no audio or conversation data ever leaves your machine. The only outbound call is license validation.
Pro
Unlimited interrupts
No daily cap. Interrupt as often as you need — every correction, every redirect, every mid-sentence pivot. The only limit is your conversation.
Pro
Whisper model selection
Choose small, medium, or large for better accuracy on non-native accents and noisy environments. Free is locked to base. Set whisperModel in config.
Pro
TTS voice + auto-language
Pick your edge-tts voice via ttsVoice config. Auto-language detection switches TTS voice on the fly — speak in French, get a French voice. Free uses the default voice only.
~30%
Tokens saved per interrupt — no need to restate context
0
Context restatements needed. The AI catches up mid-sentence.
10×
Mic samples per second. Zero impact on OpenCode performance.
How it works
Walkie-talkie — free
Streaming TTS starts playing
Plugin hooks text parts as they arrive from the AI, buffers into sentences, generates audio via edge-tts, and plays immediately — no waiting for the full response.
Type /ptt to interrupt
Type /ptt — generation aborts, TTS stops, mic starts recording via sox. The recording stays active until you type /ptt again.
Speak your correction
Audio is captured to a WAV file at 16kHz mono. Speak your correction — the recording continues until you type /ptt again.
Release → transcribe → send
/ptt again → audio is transcribed by local whisper.cpp (or OpenAI API fallback). Transcript is auto-cleaned — filler words stripped, stutters removed, false starts corrected. With OPENAI_API_KEY, LLM polishing extracts your final intent and fixes sentence structure like Wispr. Clean text is sent via session.prompt().
Model pivots with full context
The AI sees your spoken correction as a new user message. It responds directly to what you said — no restarting, no repeating context.
Voice architecture
interrupt includes a built-in streaming TTS engine powered by edge-tts. No separate TTS plugin needed — it speaks responses as they arrive. sox is likely already on your machine. No additional dependencies needed.
/ptt to interrupt — recording starts, generation aborts, type /ptt again to transcribe and redirect.
Made for the way you work
Voice users
You speak to OpenCode all day. Walkie-talkie makes conversations feel natural — type /ptt to cut in mid-response, speak your correction, type /ptt again to redirect the AI. No more waiting for it to finish.
TTS-heavy workflows
You rely on spoken output. When you need to redirect mid-explanation, type /ptt to abort playback, speak over it, and type /ptt again to send your spoken correction via whisper transcription.
Developers
Pair programming with the AI? When the AI goes down the wrong path mid-sentence, type /ptt to stop it, speak the correction, type /ptt again to continue. No wasted back-and-forth retracing steps.
Pricing
Free
$0
20 interrupts/day — no license needed
/ptt)Pro
$29
One-time · No subscription · 3 machines
small, medium, largeCheckout via Polar.sh · Key emailed instantly
Installation
Install sox
The voice monitor uses sox for microphone RMS sampling. Install it:
Add the plugin to opencode.json
No npm install needed — OpenCode downloads plugins automatically.
Add this entry to opencode.json in your project root or ~/.config/opencode/opencode.json:
speech-opencode handles mic input. The interrupt plugin provides streaming TTS and the /ptt walkie-talkie slash command.
Install whisper.cpp for speech-to-text
The walkie-talkie needs local transcription. Save and run this script (clones, builds, downloads ~140MB base model). Set MODEL=small for better accuracy with non-native accents:
Re-run with MODEL=small or MODEL=medium for better accuracy.
Or set OPENAI_API_KEY in your environment — preferred for accent accuracy (used first when available).
Restart OpenCode & verify
Kill the session and run opencode. OpenCode downloads
the plugins from npm and loads them. Free mode activates automatically.
Verify with opencode plugin list.
Install sox
Same as free tier — required for mic monitoring.
Buy a license
Purchase at Polar.sh → You'll receive a license key by email.
Add plugins with licenseKey
No npm install needed. Same npm package, just add the licenseKey option:
Install whisper.cpp for speech-to-text
The walkie-talkie needs local transcription. Save and run this script (clones, builds, downloads ~140MB base model). Set MODEL=small for better accuracy with non-native accents:
Or set OPENAI_API_KEY — preferred for accent accuracy (used first when available).
Restart OpenCode & verify
On first boot you'll see license validation and the walkie-talkie /ptt command active.
Verify with opencode plugin list.
Pro configuration options
FAQ
"opencode-interrupt-plugin" to your opencode.json plugins array. Install whisper.cpp (copy-paste the install script from the install section) or set OPENAI_API_KEY. Restart OpenCode — type /ptt to abort AI generation and start recording, speak your correction, type /ptt again to transcribe and send. The AI responds to your spoken correction.
~/.cache/opencode/interrupt-count.json with a tamper-evident checksum — honest users hit the cap and see a toast. It resets daily. Pro ($29 one-time) removes the cap entirely. This is a gentle nudge, not DRM — the file can be deleted to reset, but we trust you not to.Waiting for AI to finish talking so you can correct it. Interrupt makes that feeling obsolete. See what others think: