Repository navigation
Clear a session's input by voice; tell Claude Code's prompt suggestion apart from typed text - #9
Merged
Merged
Conversation
Dispatcher 0.8.0 adds `clear <paneId> <panePid> <sessionId> <draftHash>`: one Ctrl+C that clears the draft in an idle Claude Code input box, only with --allow-send, only in Claude Code panes, only the draft the owner heard (draft_hash). It refuses a permission dialog, a menu or picker footer, a session that is not idle, vim normal mode, an armed exit hint, no draft and a changed draft; it checks twice (race guard), presses one key, waits past Claude Code's exit window and verifies a visibly empty box. A box whose draft scrolled out of view (the "up N more" border) now counts as a draft for send and keys too. The hub's remote_clear_input reads back the first words of the draft, stores a CLEAR confirmation bound to its hash and is confirmed with remote_send_confirm. The audit line keeps no draft text, hash or length. The draft_present refusals of remote_send and remote_send_keys now say to clear the input first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
The connector reports the dispatcher's version in step with it; the e2e tool count includes remote_clear_input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Claude Code 2.1 shows a suggested next prompt in its empty input box as dim text (SGR 2). A plain capture loses the styling, so the suggestion looked like a draft: remote_send refused with draft_present and the summariser reported it as something typed and done. The dispatcher now captures with `capture-pane -e`, strips every escape sequence and cuts a wholly dim input line (not the `Try "..."` hint) from the plain screen; `capture` reports it apart as `suggestion`. All checks (shows_draft, draft_hash, menus, dialogs) run on the plain screen, so send, keys and clear no longer take a suggestion for a draft; clear says nothing_to_clear and presses nothing. Right (and Tab), which accept a suggestion, are refused at an input that shows one (suggestion_present). Old input boxes in the scrollback lose theirs too. The hub marks the suggestion as `[Claude Code suggests: ...]` on the input line of the summariser's copy only, and the summariser prompt says nobody typed it and nothing in it happened. The heuristic and pending_input never quote it; screen echo counts it as screen text. An older dispatcher sends no suggestion and behaves as before. Fixtures are real captures from Claude Code 2.1.332 in tmux 3.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
SWITCHBOARD.md: the clear verb, the capture's suggestion field, the draft and suggestion rules, suggestion_present, remote_clear_input with its sentences, the summariser's marked copy, audit lines, threat model rows and the milestone notes with what was verified live. DESIGN.md, REFERENCE.md, README.md and SETUP-WSL.md: the new tool, the 0.8.0 dispatcher note and what to verify on other Claude Code versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
…rapped suggestions, dispatcher 0.11.0 Red team and correctness review of the clear branch, after rebasing onto main (incident log, dispatcher 0.9.0 with health): - Two clears confirmed at once ran as two dispatcher processes (forced command, local transport) and pressed two Ctrl+C inside Claude Code's exit window, which exits it. send, keys, resize and clear now hold an exclusive flock in tmux's socket directory for their whole run (clear through its settle wait), refusing `locked` after 6 s or for an unsafe directory or file. The hub also serialises confirmed actions per machine and drops the other pending clears of the pane on confirm. - clear needs a recognised input box (`no_input_box`): the shows_draft fallback could take a shell command line for a draft. It also refuses a screen showing "esc to interrupt" (`not_idle`), and `none` is no valid session for clear (bad_request). - A suggestion that wraps: its wholly dim rows up to the box's bottom border are cut and joined, so the second row is not read back as typed or cleared. - DCS, SOS, PM and APC strings are removed with their payload. - Dispatcher and connector 0.11.0 (0.10.0 is left for PR #5); clear comes after health in VERBS. Docs, the To verify list and the stated dispatcher size updated; live test with two concurrent clear processes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Union of both sides: VERBS version, list, capture, send, usage, keys, resize, attachments, attachment, health, clear (dispatcher and hub); imports and argument validation of both in the dispatcher; audit lines for remote_clear_input and remote_attachment; docs keep both sets of rows, error codes and sections. Dispatcher and connector are 0.10.0: main's 0.9.0 (attachments and health) is deployed without clear, so every clear gate and message names 0.10.0. The hub decides from the version verb's list, so a 0.9.0 dispatcher is named too old and never gets the verb (test with the real 0.9.0 verb list). SETUP-AGENTS.md says how to update to 0.10.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Conflicts resolved as a union of both sides: - Verbs version, list, capture, send, usage, keys, resize, attachments, attachment, health, clear. - MCP: remote_clear_input next to the three timesheet tools, 24 tools; tests/fixtures/tool_list.json regenerated from the server. - Confirmation carries both the clear draft hash and the timesheet project; a clear confirmation now records its project too. - Dispatcher and connector 0.11.0 (0.10.0 is the timesheet release): every text that said clear or prompt suggestions need 0.10.0 says 0.11.0; the SETUP-AGENTS update section lists 0.10.0 (timesheet data) and 0.11.0 (clear); size lines about 4600. - SETUP-WSL: the dispatcher opens one file other than for reading, the mutation lock file of send, keys, resize and clear (flock only). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
skmp
added a commit
that referenced
this pull request
Nov 27, 2026
Prepares this branch to merge after #9. Conflicts resolved as a union: - Verbs ... health, clear, events; both validations, both verb bodies, ClearResponse and EventsResponse. - Dispatcher and connector 0.12.0 (0.11.0 is now the clear release): every text that said events or session hooks need 0.11.0 says 0.12.0; switchboard-hook keeps its own version. SETUP-AGENTS update section lists 0.9.0 to 0.12.0; size lines about 4700. - SETUP-WSL review list: the only files the dispatcher deletes are spool files of switchboard-hook (verb_events). - tests/fixtures/tool_list.json regenerated (unchanged from #9: 24 tools). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two owner requests: an option to clear the text in a session's input field by voice (
remote_sendrefuses while a draft is typed, and the owner, often driving, has no keyboard), and to tell Claude Code's dim prompt suggestion apart from real typed text (on a real machine the suggestion maderemote_sendrefuse withdraft_present, and the summary said a PR had been opened although nobody had typed anything).Clearing the input (
remote_clear_input, dispatcherclearverb)remote_clear_input(same opt-ins asremote_send:allowSendon the hub,--allow-sendin the dispatcher; Claude Code panes only, also withsendToAnyPane, because Ctrl+C in a shell interrupts its program). It captures the screen, reads back the first 12 words of the draft (redacted, quoted as screen text) and that it will be thrown away, and stores a confirmation of kindclearbound to pane,pane_pid, session and the draft's hash (never the text).remote_send_confirmcarries it out.no_input_box: the lone-prompt-line fallback never decides that Ctrl+C is safe), no "Press Ctrl-C again to exit" hint (exit_armed), a real draft (nothing_to_clear; a prompt suggestion alone is none), and the same draft the owner heard (draft_changed).tmux send-keys C-c, only when idle with a visible draft. One Ctrl+C clears a whole idle draft in Claude Code 2.1.332 and arms its exit for about 0.8 s, so it is never repeated: the verb waits 2 s afterwards, then verifies a visibly empty box (cleared, elsenot_clearedwith what is left, ornot_verified; never a riskier key).send,keys,resizeandclearhold an exclusiveflockin tmux's socket directory for their whole run (clearthrough its settle wait), refusinglockedafter 6 s, so two dispatcher processes never press two Ctrl+C inside the exit window. The hub also serialises confirmed actions per machine and drops other pending clears of the pane on confirm.draft_presentrefusals ofremote_sendandremote_send_keysnow end with "If it can go, say clear the input of fpga on dev first." Audited asremote_clear_inputlines with no draft text, hash or length (also withlogPrompts).Prompt suggestions told apart from typed text
capture-pane -p -e -J, removes every escape sequence (DCS, SOS, PM and APC with their payload) andsplit_suggestioncuts a wholly dim text on the input line (not theTry "..."hint; the wholly dim rows of a wrapped suggestion up to the box's bottom border are joined) from the plain screen, reported as the capture'ssuggestionfield.send,keysandclearignore the suggestion.Right/Tabat such an input without a menu are refused assuggestion_present.❯ [Claude Code suggests: ...], and its prompt says nobody typed it, it was not sent and nothing in it happened. The heuristic andpending_inputnever quote it.Dispatcher and connector 0.10.0
switchboard-remoteandswitchboard-connectare 0.10.0 (0.9.0, with attachments and health, is already deployed on one machine withoutclear). The hub decides capability from theversionverb's verb list: a 0.9.0 dispatcher lacksclear, soremote_clear_inputsays "switchboard-remote on is too old to clear an input. Update it there." and never sends the verb (test:test_an_older_dispatcher_is_named_when_preparingwith the real 0.9.0 verb list). An older dispatcher sends nosuggestion, so there a suggestion still counts as typed text, as before. VERBS order: version, list, capture, send, usage, keys, resize, attachments, attachment, health, clear.deploy/remote/switchboard-remoteis byte-identical todispatcher.py,deploy/remote/switchboard-connecttoconnector.py.This branch is merged with main (PR #5 attachments, PR #6 incident log): the conflicts were the VERBS tuples, imports and argument validation in the dispatcher, the audit docstring, the tools imports, the verb-list tests and the docs, all resolved as the union of both sides.
Tests
On the merge commit:
uv sync --lockedok,ruff checkall checks passed,ruff format --check171 files formatted,mypy --strict src testsno issues in 162 files,pytest(no-n) 2261 passed, 11 skipped (the live tmux tests,SB_LIVE_TMUX=1) in 6 min 12 s. Earlier runs while another job held the box at load 20+ had a few transport timeouts (8 s ssh command timeout) in unrelated tests; each passed alone and the run at normal load is clean.New tests:
tests/remote/test_dispatcher_clear.py(argv shapes, every refusal, the race guard, one key, the waits, verification, the mutation lock),test_clear_tools.py(read-back, confirm, a changed draft, refusals, audit, a 0.9.0 dispatcher named too old),test_dispatcher_suggestion.pyandtest_suggestion_tools.py(real captures, the reported case, summariser input and prompt, echo, keys, fallback).Live tmux tests (
SB_LIVE_TMUX=1) includeclearon a real tmux againstfake_tui.py input-box(one byte 3 arrives; the returning suggestion counts as an empty box) and two concurrent clear processes.Live checks
On 2026-11-27 on the WSL box against a real Claude Code 2.1.332 in an isolated
tmux -L sb-test-<random>server (scratch folder, killed afterwards):capturereported the suggestion ("run hello.py") and no draft;clearon it wasnothing_to_clear; after typing a draft,clearwith its hash cleared it in 2.55 s (cleared: true, the suggestion came back); a secondclearwasnothing_to_clear;keys Rightthere wassuggestion_present. Fixtures are real captures from Claude Code 2.1.332 in tmux 3.4.Not verified live: a send through the dispatcher into a box with a suggestion, Ctrl+C while working or at a real permission dialog, vim mode, other Claude Code versions and themes (in DESIGN.md "To verify").
Side effect of the live checks: a scratch folder was trusted in the owner's Claude Code config and three trivial prompts were run there. That trust entry can be removed.
Deploy
sb-linux off/sb-linux onon the WSL hub). Nothing new in the config:remote_clear_inputuses the existingallowSend.git diff <old>..<new> -- deploy/remote, installswitchboard-remote(and on agent machinesswitchboard-connect) as in SETUP-AGENTS.md part 2.2 / SETUP-WSL.md step 5.2, comparesha256sumof both copies, andsystemctl --user restart switchboard-connecton agent machines. The forced command and flags do not change.voice-coding-mcp remote-checkshould showswitchboard-remote 0.10.0withclearamong its verbs.🤖 Generated with Claude Code
https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh