Skip to content

Add a Claude voice button, and a name and places for each voice button - #5

Merged
devXpro merged 8 commits into
devXpro:mainfrom
kostilal:feat/claude-voice-button
Nov 18, 2026
Merged

devXpro merged 8 commits into
devXpro:mainfrom
kostilal:feat/claude-voice-button

Conversation

@kostilal

Copy link
Copy Markdown
Contributor

Summary

A second voice button, the Claude twin of the ChatGPT one (#2): one tap in Paseo starts Claude's own voice mode in the Claude desktop app, so you talk to Claude with your claude.ai account, its memory and the God Mode connector. Off until Claude voice in Paseo is turned on. It never calls an Anthropic API or sees the conversation.

Also: both voice buttons now have their name and where they show on God Mode's screen, folded behind an Edit row.

Why Accessibility

Anthropic publishes no link, keyboard shortcut, menu item, AppleScript dictionary or Shortcuts action that starts voice mode in Claude desktop (its "Voice shortcut" and "Dictation shortcut" only dictate). The only way in is the composer's voice button, so the button presses it through Accessibility, with the same Paseo permission the ChatGPT button already needs. Without it, or when nothing matches, Claude is left in front and the toast says why ("tap its voice button").

How it finds the button (server/voice-button/claude-ax.ts)

A JXA script in two parts: DECIDE_SOURCE is pure (a flat snapshot of the window in, a decision out) and is unit-tested under Node; COLLECT_SOURCE reads the tree, presses, recovers and verifies.

  • The right window. The claude.ai page is an inner AXWebArea inside the app's own file:// page, and Claude Code opens windows of its own, so it takes the window that is on a chat and raises it.
  • Several signals, not only the label. A button of the composer that holds the message box, icon-only, labelled "Use voice mode" or a known translation (RU «Включить голосовой режим», UK), never one of the known others (send, stop, dictation, attachments, model, tools, read aloud). With an unknown label it takes the icon right after the dictation button, which is where voice mode sits.
  • Recovery. Escape (only while that Claude is frontmost) closes what covers the chat: settings, menus, dialogs. Claude hides everything under a modal. Then a new chat: the sidebar's New chat (only on a chat screen, since on Claude Code's screen the same button starts a Code session), or claude://claude.ai/new when only one instance runs.
  • Verification. The microphone control must appear after the press. When voice is already on, the button says so and does not toggle it off.
  • Profiles. profile: "evo" targets the instance started with --user-data-dir=~/.claude-evo-data/electron, and starts it that way when it is not running.

Two traps worth knowing, both fixed and pinned by tests:

  1. JXA's $.kCFBooleanTrue is refused by AX (-25200), so AXManualAccessibility was never actually set. Use $.NSNumber.numberWithBool(true).
  2. Every set of AXManualAccessibility restarts Electron's ~2 s build of the page's tree. Setting it every 300 ms kept a freshly started Claude blind for good, so it is set once and re-set only after 4 s.

The whole press fits Paseo's 30 s plugin RPC limit.

Phone

There is nothing to press from outside: the Claude app has no Shortcuts action, link or intent that starts voice mode. The button opens https://claude.ai/new (a link the app claims) and the user taps voice, or runs an Apple Shortcut if iosShortcutName is set. In a car, Claude's own CarPlay icon already starts voice.

Settings on the screen

The 1.0 screen reduced the voice button to one switch. This brings back two of the hidden settings for each button, behind an Edit row that shows a summary ("Jarvis: Workspace header, Command Center, /jarvis"):

  • Name, saved 0.5 s after the last key.
  • Where it shows: header, every chat, sidebar, Command Center, slash command.

The Mac mode and the iPhone shortcut name stay off the screen. If you would rather keep the one-switch screen, client/voice-button-section.tsx is self-contained and can be dropped without touching the Claude button.

client/voice-button.tsx became a small factory used by both buttons. The ChatGPT button's ids (voice), RPCs and stored settings are unchanged.

Test plan

  • npm run check: typecheck and 376 tests (34 new). They cover the decision on snapshots modelled on the live tree (EN/RU/UK, unknown labels, drafts, send/stop/dictation never pressed, Code screen, modal), the launcher flows (profiles, cold start, no Accessibility, open mode, every script outcome), and guards for both traps above.

  • Live on macOS with Claude 5.11492.5 (Russian UI), pressing the Paseo header button:

    Case Voice on in
    Claude running in the background ~2 s
    Claude closed (3 out of 3 runs) 5.3 / 9.2 / 5.9 s
    A Claude Code window focused 0.9 s
    Settings open over the chat ~3 s

    The already-on case answers without toggling.

  • The settings screen renders, collapses and expands, and save goes through the RPC.

  • Not run live: non-default profiles, iPhone, an English Claude UI.

Known limit, not ours: Claude's voice mode currently sees one tool per custom connector and asks for every write (anthropics/claude-ai-mcp#1316, #1144).

🤖 Generated with Claude Code

Illia Kostiikevych and others added 8 commits November 17, 2026 13:54
…cessibility

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The claude.ai page sits inside the desktop app's own file:// web area,
the voice button is next to dictation (send keeps its own spot), Claude
Code opens windows of its own, and settings cover the chat as a modal.
Pick the claude.ai area of the window on a chat, raise it, close what
covers it with Escape, open a new chat with the sidebar's button or the
link, and bring Claude forward by pid, since AXFrontmost is ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A freshly started Claude publishes its page to Accessibility only for a
window that exists while it is frontmost, so keep it in front (open -b
when that cannot pick another instance, since macOS may refuse a plain
activation) and set the flag again until the page shows. Wait for the
button a moment after the page loads, run every recovery (the attempt
count shrank as recoveries were used), compare AX counts as numbers, and
fit the whole press in Paseo's 30 s plugin RPC limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JXA passes $.kCFBooleanTrue as something AX refuses (-25200), so the flag
that makes Electron publish its page was never set by the script; it only
worked where something else had set it before. Use an NSNumber bool, and
set the flag once: every set starts Electron's build of the page over, so
setting it every 300 ms kept a fresh Claude blind for good. Measured from
the Paseo button with Claude closed: 5.3, 9.2 and 5.9 s to voice on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The icon after dictation is taken for voice mode only while the message
  box is empty: with a draft, send can sit there under a label we do not
  know. A voice-mode label counts only inside the composer.
- A draft ends the attempt: no new chat, the toast says why.
- The button's label is read again right before the press.
- One deadline for the whole script, from what is left of Paseo's 30 s; the
  script always answers (timeout included) instead of being killed.
- Claude is brought forward once while its page loads, then only right
  before a key or a press, not every 300 ms.
- With only a profile running, the default Claude starts beside it (open -n).
- The name saved after a pause merges into the latest settings; each card has
  its own placeholder; the two buttons never take the same slash command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kostilal
kostilal force-pushed the feat/claude-voice-button branch from 5c3106c to 871e15f Compare November 17, 2026 19:03
@kostilal

Copy link
Copy Markdown
Contributor Author

An independent review on another model (Fable 5.1) found three P1s and five P2s. All are fixed in 871e15f:

P1

  • The fallback could press send. The "icon right after dictation" rule now applies only while the message box is empty, because with a draft send can sit in that spot under a label we don't know. A voice-mode label now counts only inside the composer, so a settings row or a help card is never pressed.
  • A draft got left behind. A draft in the box now ends the attempt: no new chat is opened, and the toast says why.
  • The time limit wasn't enforced. The whole script now runs against one deadline, taken from what is left of Paseo's 30 s RPC limit. It always answers, with a new timeout result, instead of being killed after a press.

P2

  • The label is read again right before the press, so a composer that re-rendered gives press-failed: changed.
  • Claude is brought forward once while its page loads, and again only right before a key or a press, not every 300 ms.
  • With only a profile running, the default Claude starts beside it (open -n -b) instead of the profile being brought forward.
  • A name saved after the typing pause now merges into the latest settings, so it no longer reverts a switch flipped during that pause.

P3

  • Each card has its own placeholder.
  • The two buttons never take the same slash command: ChatGPT keeps it, Claude falls back to /claude-voice.

The return of the name and placements UI (1.0 had one switch) is your call, see the description.

Tests: 382 pass, with new ones for each fix. Live after the fixes, through the Paseo header button:

Case Voice on in
Claude closed (two runs) 9.3 s, 5.4 s
Claude running 3.8 s

🤖 Generated with Claude Code

@devXpro
devXpro merged commit 1fb9d52 into devXpro:main Nov 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants