Skip to content

Commit 76a1587

Browse files
garyshengclaude
andcommitted
feat: add PermissionRequest hook support for IDE users
The Notification hook (permission_prompt) only fires in the CLI, not in VSCode/IDE. The PermissionRequest hook fires in both environments. This adds PermissionRequest handling so IDE users hear the permission sound and get notifications when Claude needs approval. Closes #11 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3bc7038 commit 76a1587

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ peon_entry = {
215215
}
216216
217217
# Events to register
218-
events = ['SessionStart', 'UserPromptSubmit', 'Stop', 'Notification']
218+
events = ['SessionStart', 'UserPromptSubmit', 'Stop', 'Notification', 'PermissionRequest']
219219
220220
for event in events:
221221
event_hooks = hooks.get(event, [])

peon.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,17 @@ case "$EVENT" in
468468
exit 0
469469
fi
470470
;;
471+
PermissionRequest)
472+
# Fires in IDE (VSCode) when a permission dialog appears.
473+
# Notification with permission_prompt only fires in CLI, so this
474+
# ensures IDE users also hear the permission sound.
475+
CATEGORY="permission"
476+
STATUS="needs approval"
477+
MARKER=""
478+
NOTIFY=1
479+
NOTIFY_COLOR="red"
480+
MSG="$PROJECT — Permission needed"
481+
;;
471482
# PostToolUseFailure — no sound. Claude retries on its own.
472483
*)
473484
exit 0

0 commit comments

Comments
 (0)