Add postAllResponses hook to trigger notifications after any Claude response
Description:
Currently, Claude Code only triggers the postResponse hook when the response includes tool usage
(file reads, command execution, etc.). Text-only responses don't trigger any hooks, which limits
the ability to create comprehensive notification systems.
Use Case:
I've built a notification system that plays audio alerts when Claude completes tasks. However, it
only works when Claude uses tools. When working in another window or with multiple monitors, I'd
like to receive an audio notification when Claude finishes any response, not just tool-based ones.
This would greatly improve the workflow for users who multitask.
Proposed Solution:
Add a new hook type that fires after every response:
- postAllResponses - Triggers after any response (text or tool-based)
- Or alternatively: postTextResponse - Triggers only after text responses (complementing the
existing postResponse)
Example configuration:
{
"hooks": {
"postResponse": "...", // Existing: tool-based responses
"postAllResponses": "...", // New: all responses
"notification": "...",
"postSubagentResponse": "..."
}
}
Alternative/Complementary Solution:
It would also be valuable to have built-in sound notification support directly in the Claude Code
CLI. A simple flag like --sound or --notify-sound could play a system sound when responses
complete, eliminating the need for external scripts in basic use cases. This could work alongside
the hooks system, providing a quick out-of-the-box solution for users who just want simple audio
feedback without setting up custom notification systems.
This would allow users to build more comprehensive notification systems and improve the developer
experience when working with Claude Code in the background.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗