Voice mode doesn't auto-activate on session start when voiceEnabled is persisted
Bug Description
When voiceEnabled: true is persisted in ~/.claude/settings.json (from a previous session where /voice was enabled), starting a new claude session does not auto-activate voice mode. Holding Space does nothing until the user manually runs /voice to disable and then /voice again to re-enable.
Steps to Reproduce
- Start Claude Code (
claude) - Run
/voiceto enable voice mode — confirm "Voice mode enabled. Hold Space to record." - Exit the session (Ctrl+C or
/exit) - Verify
~/.claude/settings.jsoncontains"voiceEnabled": true - Start a new Claude Code session (
claude) - Hold Space — nothing happens (expected: recording should start)
- Run
/voice— outputs "Voice mode disabled." - Run
/voiceagain — outputs "Voice mode enabled. Hold Space to record." - Hold Space — now it works
Expected Behavior
When voiceEnabled: true is already in settings.json, voice mode should be fully active when the new session starts — spacebar should immediately work for recording without needing to toggle /voice off and on.
Root Cause Analysis
Traced through the minified bundle (cli.js v2.1.69):
- Settings loading (
nD1()function): ReadsvoiceEnabledfrom settings and sets a boolean in app state, but does NOT trigger voice subsystem initialization (microphone setup, keyboard listener registration) /voicecommand (jGz()function): Contains the full voice activation path — checks microphone permissions, verifies audio recording dependencies (sox/arecord), registers the spacebar keyboard handler, and callsEO.notifyChange("userSettings")- The gap: On startup, only the boolean flag is set. The actual voice infrastructure (spacebar listener, audio stream) is only initialized when
/voiceis explicitly run
Suggested Fix
During session initialization (in nD1() or equivalent startup path), when voiceEnabled === true is loaded from settings, the same voice subsystem initialization that /voice on performs should be triggered — microphone availability check, keyboard handler registration, etc.
Environment
- Claude Code version: 2.1.68
- OS: macOS (Darwin 25.3.0, arm64)
- Installation: Homebrew
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗