Skip to content

Add AskUserQuestion hook#42

Open
novarii wants to merge 1 commit into
warpdotdev:mainfrom
novarii:add-ask-user-question-hook
Open

Add AskUserQuestion hook#42
novarii wants to merge 1 commit into
warpdotdev:mainfrom
novarii:add-ask-user-question-hook

Conversation

@novarii
Copy link
Copy Markdown

@novarii novarii commented May 12, 2026

Summary

  • Wires a PreToolUse hook matched to AskUserQuestion so Claude pausing to ask the user a question triggers a Warp notification.
  • Reuses the existing question_asked event already defined in Warp's CLI agent protocol (CLIAgentEventType::QuestionAsked, mapped to Blocked status in cli_agent_sessions/mod.rs) — no Warp-side change needed.
  • New script follows the same pattern as on-permission-request.sh: extracts the first question's text as summary, truncates to 200 chars, sends via warp-notify.sh.

Motivation

AskUserQuestion is one of the most frequent ways Claude blocks waiting for the user, but it currently produces no Warp notification. Users running Claude in the background miss prompts entirely unless they're already focused on the Warp pane. The Warp side has supported the question_asked event since v1 of the protocol — the plugin just hasn't been emitting it.

Test plan

  • tests/test-hooks.sh passes (40/40, including new silent-exit assertion for the script)
  • Manual payload inspection — build_payload produces:
    {"v":1,"agent":"claude","event":"question_asked","session_id":"abc","cwd":"/tmp/foo","project":"foo","summary":"Which option do you prefer?"}
    which matches the shape v1::parse expects in event/v1.rs.
  • End-to-end test in Warp (would appreciate a maintainer running this — I can confirm payload + OSC emission but can't reproduce the full Warp UI loop locally).

Wires up a PreToolUse hook for AskUserQuestion that emits a structured
'question_asked' event (already defined in Warp's CLI agent protocol
and mapped to Blocked status). Without this, AskUserQuestion calls fire
no Warp notification, so users miss prompts when not focused on Warp.
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