Skip to content

feat: the pill names a session that speaks out of sight - #419

Merged
znat merged 2 commits into
feature/claude-voicefrom
voice/session-pill
Nov 7, 2026
Merged

znat merged 2 commits into
feature/claude-voicefrom
voice/session-pill

Conversation

@znat

@znat znat commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

When a Claude Code or Codex session speaks and its window is not in front, the pill now names it, with a "Go to session ›" action. The name is the project folder and two or three words about the task, like parrotflow · fixing the glow. A click raises the session's window and brings its app to the front. It is always on: there is no config key, because the claude: section becomes voice: in the next PR. Check first how the pill gives way to a dictation: PillHUD.session(_:) and the onPill closure in AppDelegate.

PR A6 of the Codex + mini-swe-agent voice train. Checks: scripts/check-claude-voice.sh 263/263 (220 before), scripts/check-schema.sh 89/89.

How it behaves: shown only on a free pill, while the session speaks out of sight
  • Task words. The answer's rewrite call returns one more JSON field, task. There is no extra model call. ClaudeSpeakable.taskLabel keeps it only when it is 2 or 3 plain words. It is lowercased, and a trailing period is dropped. A missing, long, one-word or path-like label is no label, and say is never touched. Each session keeps its latest label. Before the first answer, taskWords takes the first 3 content words of the last request. It skips stop words, the project name, paths and tokens.
  • Name. sessionName(project:task:) gives folder · words. A folder over 24 characters keeps 23 and ends in ….
  • When. ClaudeVoice.pillFor runs when speakingSession changes. While a session speaks, checkPill runs each second. It shows the name when the session has a host app, and watching(id) is false. It hides the name when the window comes to the front. The name stays 1.8 s after the voice stops, then goes. When the speaker changes, the name moves to the new session.
  • Dictation wins. AppDelegate passes a name on only when nothing is recording, no run is in flight and no offer is up. PillHUD.session(name) sets the state only on a pill that is not on screen, or one that already shows a session. session(nil) fades only the session state. So a dictation state is never covered or delayed. The next check brings the name back while the session still speaks.
  • Click. goToPillSession raises the pinned window with kAXRaiseAction, then calls activate() on the host app. For a pane, the window comes from the pane's AXWindow. That is the only new AX call: SpeakingFrame.window(of:). Tabs in one window cannot be told apart, so the window comes up, as for the glow. After a click, that session is not named again until it stops speaking.
  • Look. It is a notice-sized row: a waveform symbol, the name, and the action drawn as a lit chip in feedback.primary_color. It is the one non-offer state besides the alert that takes the mouse. Hovering it does nothing.
What is not checked here: the prompt change and the activation
  • No model was called, so the new task field in rewritePrompt is not measured. A model that leaves it out falls back to the request words.
  • activate() from a non-activating panel click is subject to macOS cooperative activation. A refusal is logged as claude voice: went to <project> in <app>, but the app did not come to the front.
  • checkPill runs watching(id) each second while a session speaks. That is up to two AX reads with the 0.5 s timeout from SpeakingFrame, the same reads prefix(for:) makes per line.
  • Sessions with no host app get no pill: tmux, and Codex TUI under the shared daemon. There is nowhere to go.
Manual test list
  1. Start a Claude Code session in Ghostty or Terminal and send a prompt. Switch to another app. When it answers, the pill shows <folder> · <task words> and "Go to session ›". The log says claude voice: pill names ….
  2. Click "Go to session". The session's window comes up in front, and the pill goes. The log says claude voice: went to ….
  3. While a background session speaks and the pill shows, hold the hotkey and dictate. The recording pill takes the place at once. The voice stops, so the name does not come back.
  4. Send a prompt to two sessions and leave both in the background. When the second one speaks, the name moves to it.
  5. With the session's window in front, let it speak. No pill shows.
For A4 (Codex glow)
  • Desktop Codex should reach ChatGPT.app through the pid walk, so host(of:) gives the app to activate. This is inferred, not tested.
  • inFront(project:) is the fallback when there is no host, and claudeHosts has no ChatGPT.app bundle id. The pill needs a host anyway.
  • If A4 adds a title-match window for terminal Codex, set Session.hostPid and Session.window. Then the pill shows and its click raises that window with no change here.
Review notes
  • Local CodeRabbit CLI on 61b0f71: 0 findings. On ee376ef (the key taken out): 1 finding, to keep claude.pill: false working for existing configs. Not applied: the key never shipped, so no config has it. Remote CodeRabbit was rate-limited.
  • --panel-sheet draws two session pills, a short name and a long folder, beside the notices. --panels session puts one on screen.
  • The set() change merges the alert branch into the else branch. The only difference between them was ignoresMouseEvents.
  • Docs: a "Which session, on screen" bullet in docs/configuration.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y

When a Claude Code or Codex session speaks and its window is not in front,
the pill shows its name and "Go to session ›". The name is the project
folder and two or three words about the task, like
"parrotflow · fixing the glow".

- The task words come from the answer's rewrite call: its JSON gains a
  `task` field. A missing, long or odd label is no label. Before the first
  answer, the name uses the first content words of the request.
- The pill shows only while the session speaks, its window is not in front,
  and it has an app to go to. It goes 1.8 s after the voice stops, or on a
  click. It is checked each second, so it moves with the speaker and goes
  when the window comes to the front.
- A dictation always takes the pill. The session state is shown only on a
  free pill, and its nil hides only that state. It comes back after the
  dictation while the session still speaks.
- The click raises the pinned window with AX and activates its app.
- `claude.pill` turns it off. `--panel-sheet` draws it, `--panels session`
  shows it.

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
@greptile-apps

greptile-apps Bot commented Nov 7, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@znat

znat commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8124b3ff-e26b-419c-bca2-1bea41698ee3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@znat

znat commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Remote CodeRabbit answered "Review limit reached". The local CodeRabbit CLI review over 61b0f71 (base 95fb649) is the gate for this PR: 0 findings.

The `claude:` section is renamed to `voice:` in the next PR, so this one
adds no `claude.*` key. The session pill is always on for now.

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12hNR5fNp7ZEWwqC9y
@znat
znat merged commit 2c14819 into feature/claude-voice Nov 7, 2026
6 checks passed
@znat
znat deleted the voice/session-pill branch November 7, 2026 18:56
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.

1 participant