You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rework hooks to notification-only: no blocking, terminal still works
- on-stuck.sh: sends TG notification when AskUserQuestion fires, passes through
- on-approve.sh: sends TG notification for tool uses (Bash/Edit/Write), passes through
- Both hooks run notify in background (fire-and-forget) so terminal is never blocked
- Add `prompt` command to index.js (inline keyboard support for future use)
- Update telegram-recv to also handle callback_query updates
- User can approve/answer from terminal OR Telegram — both work
Copy file name to clipboardExpand all lines: CLAUDE.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,13 +43,12 @@ A `PreToolUse` hook intercepts `AskUserQuestion` calls:
43
43
1. Claude gets stuck and tries to ask a question
44
44
2. Hook (`~/.claude/tools/grog/hooks/on-stuck.sh`) intercepts it
45
45
3. Question is sent to Telegram via `grog notify` (includes folder name + full path)
46
-
4. Hook calls `telegram-recv` and waits ~90s for the user's reply
47
-
5. If reply arrives: hook returns it in the `reason` field → Claude continues with the answer
48
-
6. If no reply: hook tells Claude to make its best judgment and keep working
46
+
4. Hook passes through — the terminal prompt still works normally
47
+
5. User can answer in the terminal OR on Telegram
49
48
50
-
Fully bidirectional — Claude never stops, never needs to manually call `telegram-recv`.
49
+
A second hook (`on-approve.sh`) fires for all tool uses (Bash, Edit, Write, etc.) and sends a notification with tool details. The terminal approval prompt still works normally — notifications are informational.
51
50
52
-
**Requirement:**`telegramBotToken` and `telegramChatId` must be set in `~/.grog/config.json`. If not configured, the hook passes through and `AskUserQuestion` works normally.
51
+
**Requirement:**`telegramBotToken` and `telegramChatId` must be set in `~/.grog/config.json`. If not configured, both hooks pass through silently and everything works normally.
if [ "$RESPONSE"="[no message]" ] || [ -z"$RESPONSE" ];then
47
-
# No reply — block and tell Claude to state the blocker and continue without an answer
48
-
ESCAPED=$(echo "No response from Telegram after ~90s. State the blocker clearly in the terminal output, then make your best judgment call and continue working. Do NOT call AskUserQuestion again for the same question."| jq -Rs .)
0 commit comments