Skip to content

feat(windows): answer Claude Code's questions from the island - #216

Open
PythonTilk wants to merge 1 commit into
Louis-CFM:mainfrom
PythonTilk:feat/windows-question-picker
Open

PythonTilk wants to merge 1 commit into
Louis-CFM:mainfrom
PythonTilk:feat/windows-question-picker

Conversation

@PythonTilk

@PythonTilk PythonTilk commented Oct 4, 2026 •

Copy link
Copy Markdown

What this adds

When Claude Code asks a question (AskUserQuestion), it reaches Coucou as a permission request, so the island showed the Deny / Allow card with just AskUserQuestion on it — nothing about what was being asked, and no way to answer.

The question view now shows the question and its options as buttons:

  • picking an option sends the answer back to the session;
  • several questions are stepped through one at a time ("1 of 3");
  • pick-several questions get toggles and a Done button;
  • an option's description is its tooltip;
  • Answer in terminal hands the request back, exactly as an unanswered card does today (that is also where a free-text answer goes).

A question the island cannot show in full (cut short by the relay, or without options) is left to the terminal.

Screenshot

How it works

  • The island sends {"answers":{"<question>":"<label>"}} on the relay connection instead of the bare allow / deny.
  • coucou-hook turns that into the documented PermissionRequest output: behavior: "allow" with updatedInput set to the question's own input plus the answers map — the same shape Claude Code's permission prompt fills in.
  • The relay keeps the original tool_input for this (the copy forwarded to the island is truncated), and refuses anything else: answers are only accepted when the tool is AskUserQuestion, only string values, and no other field of the input can be changed. No other tool's input can be changed from the island at all.
  • The log records that a question was answered, never with what.

House rules: still an explicit click for everything; nothing new on the network; the relay never blocks Claude Code (an unanswered question times out to the terminal as before).

Not restyled

The Deny / Allow card is unchanged. The existing question view keeps its look for notification-style questions; with options to pick from it is 40 px taller to fit two rows of buttons.

Tested

  • cargo test -p coucou-hook — two new tests for the answer → updatedInput mapping and for what is refused.
  • tsc --noEmit, cargo check — no new warnings.
  • By hand on Windows 11 with Claude Code 2.1.90: single-choice question answered from the island, answer received by the session.
  • Not tried on Linux. The change is in the shared relay code and the TypeScript, nothing platform-specific.
Screenshot 2026-10-04 235759

AskUserQuestion arrived as a permission request and got the Deny / Allow
card, which says nothing about what is being asked and cannot answer it.

The question view now shows the question and its options as buttons. Picking
one sends the answer back to the session; several questions are stepped
through in turn, pick-several questions get toggles and a Done button, and
"Answer in terminal" hands the request back as before.

The answer travels as {"answers":{...}} on the relay connection. coucou-hook
turns it into an allow whose updatedInput is the question's own input plus
that map, and refuses anything else: no other field and no other tool's
input can be changed from the island.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PythonTilk

Copy link
Copy Markdown
Author

A note on overlap, which I should have put in the description: #172 does the same thing for the Tauri build (and #109 / #71 include it among other features), following #165 on the Mac.

The difference here is scope. This PR is standalone on main (11 files, ~280 lines) and answers through the existing PermissionRequest path, so there is no new hook entry and nothing for users to reinstall. #172 adds a dedicated PreToolUse hook and is stacked on #158 and #171.

If you would rather go with #172, close this one — no hard feelings.

This branch has not been deployed

No deployments
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