How to get notified when Claude Code needs your input

Posted . Visible to the public.

It's quite frustrating to come back to a coding agent after a while only to see that it needed user input only 10 seconds into the task.

You can set up notification hooks Show archive.org snapshot to trigger a Desktop notification (or similar) whenever the Claude Code agent halts.

Image

This is my configuration:

# ~/.claude/notify.sh
# Note: You need to `chmod +x` this

#!/bin/bash
INPUT=$(cat)

TITLE=$(echo "$INPUT" | jq -r '.title // "Claude Code"')
MSG=$(echo "$INPUT" | jq -r '.message // "Needs your input"')

notify-send "$TITLE" "$MSG" --icon=dialog-question
# ~/.claude/settings.json
{
  "hooks": {
    "Notification": [
      {
        "matcher": "permission_prompt|elicitation_dialog",
        "hooks": [
          {
            "type": "command",
	    "command": "bash ~/.claude/notify.sh"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "notify-send 'Claude Code' 'Finished its current task' --icon=dialog-information
          }
        ]
      }
    ]
  },
}
Profile picture of Michael Leimstädtner
Michael Leimstädtner
Last edit
Michael Leimstädtner
License
Source code in this card is licensed under the MIT License.
Posted by Michael Leimstädtner to makandra dev (2026-03-27 14:11)