aws / aws/amazon-q-developer-cli

[Feature Request] Add hook event for tool approval prompt (e.g., awaitingApproval)

Open
#3,748 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

## Problem

When the assistant requires user approval to execute a tool, there is no hook event to notify the user that approval is pending. This makes it difficult to know when Kiro is waiting for input, especially when working in another window or away from the terminal.

## Current Behavior

The existing hook events are:
- `agentSpawn` - agent initialization
- `userPromptSubmit` - user submits a prompt
- `preToolUse` - before tool execution (after approval)
- `postToolUse` - after tool execution
- `stop` - assistant finishes responding

None of these fire when the approval prompt is displayed.

## Proposed Solution

Add a new hook event (e.g., `awaitingApproval`) that fires when the TUI displays a tool approval prompt. The hook event could include:

```json
{
"hook_event_name": "awaitingApproval",
"cwd": "/current/working/directory",
"tool_name": "fs_write",
"tool_input": { ... }
}
```

## Use Case

Users can configure a notification (e.g., macOS `say` command, terminal bell, desktop notification) to alert them when Kiro needs approval:

```json
{
"hooks": {
"awaitingApproval": [
{
"command": "say 'Approval required'"
}
]
}
}
```

## Context

In the previous CUI mode, users could use iTerm2 Triggers to detect approval prompts via regex matching on terminal output. With the TUI, terminal output is no longer directly matchable, making a built-in hook the only viable approach.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.