Long tasks are where I would drift off to another window. The agent then sits there, patient and blocked, asking for permission.
The Notification event fires when Claude Code sends a notification, such as when it is waiting for input or a permission answer. Add this to ~/.claude/settings.json (macOS version):
{
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"
}
]
}
]
}
}
If the file already has a hooks key, add Notification next to the existing events instead of replacing the whole object. Check it with /hooks.
With this you can leave the terminal alone and still know the moment your input is needed. The hook is a plain shell command, so you can swap the notification for a sound, a message to your phone or whatever you already use.
The caveat: on macOS nothing appears until you allow notifications for Script Editor in System Settings, under Notifications. Linux and Windows use different commands; the hooks guide lists them.
Further reading: Automate actions with hooks – Claude Code docs, On this site: let a PostToolUse hook run Prettier after every Claude edit, On this site: block edits to .env with a PreToolUse hook that exits 2