[FEATURE] Richer permission-prompt notifications — sharing a workaround (ref #32952, #29827)
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
When Claude Code needs permission or finishes a task, the only signal is watching the terminal directly. This was previously raised in #32952 and #29827, but both were auto-closed as stale and then locked before landing. The core issue remains: the Notification hook payload for permission_prompt doesn't include what tool or command is actually pending, so a desktop or Slack alert can only say "Claude needs approval" instead of something actionable like "wants to run git push origin master."
Proposed Solution
Ideally, the Notification hook payload would include tool_name and a short tool_summary field when notification_type is permission_prompt, as originally proposed in #32952. In the meantime, I built a workaround: a script that reads the session transcript directly to extract this detail, and distinguishes a genuine blocking approval (Notification/permission_prompt) from a clean task completion (Stop), posting both to Slack with real context.
Alternative Solutions
Workaround I'm using now: https://github.com/imranashrafai/claude-code-notify — hooks into Notification and Stop, parses the transcript for the pending command/file path, posts to Slack. No core changes required, but a built-in tool_summary field would make this unnecessary.
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
I run Claude Code in a VM while doing other work on one screen. Without this, I have to keep switching back just to check if it's stuck waiting or still running. With the transcript-based workaround, I get a Slack message showing exactly what it's asking for, so I can decide whether to switch back immediately or finish what I'm doing.
Additional Context
Repo: https://github.com/imranashrafai/claude-code-notify
Implementation notes for anyone trying this or considering a similar approach:
- Reads transcript_path from the hook payload and walks backward through the JSONL to find the most recent tool_use block (for permission_prompt) or the last text block (for Stop), since neither is included directly in the current payload.
- Distinguishes Stop (clean completion — shows the actual final message, including any question Claude asked) from permission_prompt (genuine blocking approval), so a finished task doesn't read like an emergency.
- Always exits 0 regardless of whether the Slack call succeeds — this hook is informational only and should never block Claude Code.
- No dependencies beyond the Python standard library.
Happy to answer questions or take suggestions if anyone wants to extend it (other notification types, different destinations besides Slack, etc.).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗