claude-code - 💡(How to fix) Fix [Feature Request] Add PreVoiceInput hook or voice.enabled-when condition for conditional voice-mode gating [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#60516Fetched 2026-05-20 03:56:34
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

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:

  1. 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).
  2. 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Feature Request] Add PreVoiceInput hook or voice.enabled-when condition for conditional voice-mode gating [1 participants]