What it does
Claude Code runs a hook when it finishes responding and when it is waiting on you. This one sends a note to your own inbox, as a note to self: the subject is Claude Code and the project folder, and the body says that Claude Code in that project finished responding or is waiting for your permission or input. It carries nothing from the conversation. The note shows under Notes in the app, with the time it arrived. Homing sends no push notification of its own; see the last section for a ping.
When it fires
Stop runs each time Claude finishes responding, so a session sends one note per turn, including turns that only answer a question. The Notification hook, matched on permission_prompt and idle_prompt, runs when a permission prompt has waited about six seconds, and about a minute after Claude finished with nothing typed since. Leave the Stop hook out of the settings if you want only the waiting notes.
- Log every Claude Code session with a hook: A different job: one record per finished session, with its length and token counts, for a sheet or a database.
What you need
A Homing account, and curl, jq and perl.
- 1 Create a key named Claude Code hook: in the app, open API keys, enter the Key name and choose Generate. The key is shown once. In a terminal, run the command below, paste the key, press Return, then Control-D. Revoke this key to stop the notes.
mkdir -p ~/.config/homing && (umask 077; cat > ~/.config/homing/hook-key)
Save the script
- 1 In a terminal, run: mkdir -p ~/.claude/hooks && cat > ~/.claude/hooks/homing-note.sh
- 2 Copy the script below, paste it into the terminal, press Return, then Control-D.
- 3 Run: chmod +x ~/.claude/hooks/homing-note.sh
#!/usr/bin/env bash # Stop and Notification hook: one note to self when Claude Code finishes or is waiting for you. # Needs curl, jq and perl. The key is read from ~/.config/homing/hook-key. Exits 0 always. # The work runs detached, so Claude Code is never delayed. To see Homing's reply, run: # printf '%s' '{"session_id":"…","transcript_path":"…","cwd":"…","hook_event_name":"Stop"}' | ~/.claude/hooks/homing-note.sh work if [ "${1:-}" != work ]; then in=$(cat) { printf '%s' "$in" | perl -MPOSIX -e 'POSIX::setsid(); exec @ARGV' bash "$0" work; } >/dev/null 2>&1 & exit 0 fi key=$(cat "$HOME/.config/homing/hook-key" 2>/dev/null) in=$(cat) get() { printf '%s' "$in" | jq -r "$1 // empty"; } sid=$(get .session_id); ev=$(get .hook_event_name); kind=$(get .notification_type); tp=$(get .transcript_path) { [ -n "$key" ] && [ -n "$sid" ]; } || exit 0 case "$ev" in Stop) what="finished responding"; text=$(get '.last_assistant_message[0:150]') ;; Notification) case "$kind" in permission_prompt) what="is waiting for your permission" ;; idle_prompt) what="is waiting for your input" ;; *) what="needs you" ;; esac text=$(get '.message[0:150]') ;; *) exit 0 ;; esac project=$(basename -- "${CLAUDE_PROJECT_DIR:-$(get .cwd)}") body="Claude Code in $project $what." [ "${HOMING_HOOK_TEXT:-0}" = 1 ] && [ -n "$text" ] && body="$body $text" last=$(grep '"timestamp"' "$tp" 2>/dev/null | tail -n 1 | jq -r '.timestamp // empty' 2>/dev/null) [ -n "$last" ] || last=$(printf '%s' "$in" | cksum) if command -v sha1sum >/dev/null; then sha=sha1sum; else sha=shasum; fi h=$(printf 'claude-code-hook:%s:%s:%s:%s:%s' "$ev" "$kind" "$sid" "$(get .prompt_id)" "$last" | $sha | cut -c1-32) id="${h:0:8}-${h:8:4}-5${h:13:3}-8${h:17:3}-${h:20:12}" jq -nc --arg id "$id" --arg subject "Claude Code: $project" --arg body "$body" ' {jsonrpc: "2.0", id: 1, method: "tools/call", params: {name: "send_message", arguments: {message_id: $id, subject: $subject, message: $body}}}' | curl -sS -K <(printf 'header = "Authorization: Bearer %s"\n' "$key") --connect-timeout 3 --max-time 10 \ -w '\n%{http_code}\n' -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \ --data-binary @- https://api.tryhoming.com/mcp || true exit 0
Add the hooks
Add this under hooks in ~/.claude/settings.json, keeping any hooks already there. Claude Code normally picks up the change on its own; if no note arrives, start a new session.
{ "hooks": { "Stop": [ { "hooks": [ { "type": "command", "command": "~/.claude/hooks/homing-note.sh" } ] } ], "Notification": [ { "matcher": "permission_prompt|idle_prompt", "hooks": [ { "type": "command", "command": "~/.claude/hooks/homing-note.sh" } ] } ] } }
Test it
Run this in a project folder. It sends one real note and prints Homing's reply. A good reply holds "status":"delivered" and ends in 200. A 200 with "isError":true is a refusal, and the receipt says why. A 401 means the key file is wrong or the key was revoked. Running it again sends no second note: Homing answers with the first receipt and "idempotent_replay":true.
printf '%s' '{"session_id":"test-1","cwd":"'"$PWD"'","hook_event_name":"Stop"}' | ~/.claude/hooks/homing-note.sh work
How it stays quiet
The hook returns at once and finishes on its own, so Claude Code is never held up. With no key, no session id or no network, nothing is sent and nothing is retried. It always exits 0. The id of each note comes from the event, the session, the prompt and the last time in the transcript, so the same event sent twice is one note, while a second permission prompt in the same session is a second note.
What the note carries
By default, the project folder name and the sentence. To add text, set HOMING_HOOK_TEXT=1 for the hook: a Stop note then adds the first 150 characters of Claude's last reply, and a Notification note adds the first 150 characters of the notification's text, such as the tool Claude asks to use. Both can hold anything from your session. Set it before the first note of an event: the same event sent again with different text is refused as message_id_conflict. Sends are limited to 30 a minute and 2,500 messages a month for the account, shared with everything else the account sends; past that a note is refused and not retried, and so are your agent's own sends while the account is over it.
Be told when your inbox needs you
The hook above tells your inbox about Claude Code. The Homing plugin does the reverse: /homing:watch polls your inbox from the session and raises a desktop notification for each new thread that needs you. Every few minutes by default (you can pass your own number of minutes, at least 2), it asks for the threads that need you since the last check, lists the new ones in the chat and, on macOS, shows a notification with the sender's name and the subject, never the message text. Elsewhere it lists them in the chat only. It never opens, answers or changes a thread: you decide in the chat. If the account is over its limit for inbox calls, a check waits for the time Homing names and does not retry. It stops on /homing:watch stop, after 8 hours or when the session ends. Names and subjects are written by other people, so the plugin treats them as data and never as instructions. It needs the Homing plugin for Claude Code and a signed-in homing server in the session.
Watch my Homing inbox with /homing:watch. List what needs me now, then tell me and show a desktop notification (sender and subject only) when a new thread needs me. Do not open or answer any thread until I say so.
Get a ping on your phone
- 1 Open the app in a browser on your phone and choose Notes. There is nothing to install.
- 2 For a ping, add a Telegram or Slack integration under Settings, Integrations. On its Payload tab, set Which messages to Notes to self. As of November 2026, the free plan allows three integrations on at a time.