[Feature Request] Add PreVoiceInput hook or voice.enabled-when condition for conditional voice-mode gating
Use case. I'm frequently in a video meeting in Chrome while Claude Code is open in another window. I want voice mode in Claude Code to refuse to start
whenever my microphone is currently being used by another app (or based on any external check), so I can't accidentally speak into Claude Code thinking I'm
muted in the meeting.
Current gap. None of the documented lifecycle hooks (SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, Stop) fire before voice-input activation —
they all run after a prompt has already been submitted. voice.enabled is a static boolean in settings.json, so I can't gate it on a runtime condition.
What would solve it. Either of:
- A new PreVoiceInput hook that fires immediately before voice capture begins. Exit code 0 allows it, non-zero aborts and surfaces stderr to the user (same
contract as existing hooks).
- A voice.enabled-when (or voice.guard) setting that takes a shell command. Voice activates only if the command exits 0. Example:
"voice": {
"enabled": true,
"mode": "hold",
"enabled-when": "test \"$(mic-router --status-chrome)\" != active"
}
Why it matters. Voice mode is great when you're heads-down. It's a foot-gun when you're on a call. A small predicate would close the gap without users
having to wholesale disable the feature. Same shape as existing hook contracts, so it's a low-surface-area addition.
Environment Info
- Platform: linux
- Terminal: gnome-terminal
- Version: 2.1.138
- Feedback ID: 4f68a955-c6c7-445b-8d6b-8a849f9cb7e4
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗