[FEATURE] Allow hooks for asking users questions
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I have a use case where I'm wrapping all Claude Code Bash tool calls in a custom command prefix to capture commands. I then need to perform an action once the command completes, including asking the user a question using Claude's native question dialogue.
Proposed Solution
I need this question/answer to be deterministic, without an LLM being involved. Here's a more concretely outlined workflow:
- Run a Bash command
- If specific output requirements are met, ask the user a predefined question with predefined answers (the user CANNOT input a custom answer in my use case)
- Depending on what the user selects, perform a custom action (involving a custom script I write, like with a hook)
Alternative Solutions
I can use the pre-tool hook to inject my own custom command prefix. I can then wrap Claude's inference behind a proxy that forces it to ask the user a question, with a question + answer I force Claude's inference to generate. However, this still allows users to enter a free-form answer, which is specifically not allowed in my use case.
Priority
Critical - Blocking my work
Feature Category
Interactive mode (TUI)
Use Case Example
_No response_
Additional Context
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗