Claude Code do not disturb: quiet hours and Focus

Updated

Quick answer

Notifications from Claude Code should stay silent in two situations: when you are at the keyboard, and when you are asleep or in a meeting. Handle the first with presence detection, the second with quiet hours in your hook or tool and with Focus on the iPhone. Let a failure or a blocked task through if it cannot wait.

Two kinds of quiet

An alert about Claude Code is useful when it tells you something you don’t know yet. Two situations break that rule.

Claude Code handles the first case for its own notifications. Your hooks don’t, and neither case is handled for you on the phone. The sections below take each in turn.

Quiet hours in your own hook

If you send alerts from hooks, with a desktop command, ntfy or a chat webhook, put the quiet hours in front of them. This wrapper reads the hook’s JSON, stays silent from 22:00 to 08:00, and still lets through the moments that cannot wait: a permission prompt, a form from an MCP server, and a turn that ended on an API error.

Save as ~/.claude/hooks/quiet.sh, then point your hooks at it instead of notify.sh

#!/bin/sh
# Wrapper for Claude Code notification hooks: quiet from 22:00 to 08:00, except when Claude is blocked.
input=$(cat)
hour=$(date +%H)
kind=$(printf '%s' "$input" | jq -r '.notification_type // .hook_event_name')
if [ "$hour" -ge 22 ] || [ "$hour" -lt 8 ]; then
  case "$kind" in
    permission_prompt|elicitation_dialog|StopFailure) ;;
    *) exit 0 ;;
  esac
fi
printf '%s' "$input" | ~/.claude/hooks/notify.sh

StopFailure is the event Claude Code fires instead of Stop when a turn ends on an API error. Add it to your hooks with the same command if you want to hear about failures. Its output is ignored, but the command runs.

Change the list to suit you. Some people want silence all night, permission prompts included, and let the session wait until morning; that is a fine choice, since an unanswered prompt doesn’t decide anything by itself. Others add Stop back for one long overnight task. The point is to decide once, in the script, rather than muting everything and checking by hand.

Focus and scheduled summary on iPhone

On the phone, iOS already has the tools. A Focus, such as Sleep or Work, silences notifications except from the apps and people you allow: add the app that carries your Claude Code alerts to a Focus’s allowed apps if they should break through, or leave it out if they should wait. A scheduled summary, under Settings › Notifications, collects an app’s notifications and delivers them together at the times you choose.

Both work in your favour and both can surprise you. Anthropic’s Remote Control docs list Focus modes and notification summaries as reasons the Claude app’s push can be held back or delayed, and the same is true of any app. If alerts go missing on some evenings and not others, check which Focus was on.

Quiet at the keyboard

Claude Code’s built-in alerts already wait until you look away. A permission prompt triggers one only after about six seconds without a keystroke, and each keystroke pushes it back. A finished turn triggers one about sixty seconds later, and only if you haven’t typed since. The Claude app’s push through Remote Control is skipped while you are typing in, or focused on, the connected terminal; setting CLAUDE_CLIENT_PRESENCE_FILE to a file that a screen-lock tool creates while you are at the computer extends that to every window.

Your own hooks get none of this: Stop runs at once, whether you are watching or not. To add it, check how long the keyboard has been idle before sending. On macOS, ioreg gives the system’s idle time:

At the top of a macOS hook script

idle=$(ioreg -c IOHIDSystem | awk '/HIDIdleTime/ {print int($NF/1000000000); exit}')
[ "$idle" -lt 30 ] && exit 0   # typed in the last 30 seconds: stay quiet

On a Linux desktop with X11, xprintidle returns the idle time in milliseconds. Both measure the whole computer, not the terminal: typing in a browser counts as being there, which is usually what you want.

Quiet hours in Monish

Monish has both kinds of quiet built in, for every computer you pair.

Focus applies on top, as for any app. To set it up, install Monish and run curl -fsSL https://monish.cc/install.sh | sh -s with the 6-digit code it shows; it is free and needs no account.

Questions

Does Claude Code have a do not disturb setting?
Not as such. Setting preferredNotifChannel to notifications_disabled turns off its own desktop notifications, and your hooks still run. Quiet hours are something you add in a hook or in the app that receives the alert.
Will Focus block Claude Code pushes on my iPhone?
It can. A Focus silences apps you haven’t allowed, and a scheduled summary delays them. Allow the app in that Focus if its alerts should come through.
What still gets through Monish’s quiet hours?
Requests still wait in the app, silently, and a failure can still ring. The prompt also keeps waiting in your terminal, so you can answer it in the morning.
Why does my phone stay quiet while I’m coding?
That is Monish’s quiet at the keyboard: while you’re typing in the terminal, Claude asks there as usual and your iPhone gets a silent note instead of an alert.

More guides

New to Monish? The home page shows what lands on your iPhone, and all guides are listed here.

Get Monish on your iPhone

Free, no account. Your 6-digit code is waiting in the app.

Download on the App Store