blog /

Avoid Agent Notification Fatigue with Coding Agents

Say you have three agents running: one editing the login form, one running the test suite, one sitting on a permission prompt you have not seen. Every completion pings, so you stop looking, and the one prompt that needed you waits an hour. That is agent notification fatigue: more signals than attention, so the important ones drown. The fix is not muting everything. Decide which events deserve an interruption and which get recorded quietly, then set each tool to match.

Why agent notification fatigue happens

One agent is easy: it finishes, it pings, you look. Three agents change the math. Each emits progress, completions, questions, failures and permission prompts, and most setups send all of it to the same desktop banner. Pings scale with events while your attention stays fixed, so you mute the channel, and the next blocking prompt sits unseen.

The way out is classification before routing. If you run several agents from one inbox for every agent, the same sorting applies there.

The priority matrix: suppress, notify, escalate

Put each event your agents emit into exactly one row, then wire each row to a different channel: a log file, one desktop ping, or a prompt that waits for your word.

EventExamplesAction
Routine progressFile edits, test retries, plan updatesSuppress: never wire these to a ping
HousekeepingClaude Code auth_success, quota_auto_resume_fired, elicitation_completeSuppress: append to a log
Finished, result wants reviewClaude Code idle_prompt, Codex agent-turn-complete, Gemini CLI "Session complete", OpenCode session.idleNotify once
Needs you nowClaude Code permission_prompt, Codex approval-requested, Gemini CLI "Action required", OpenCode permission.askedNotify with the reason
Stuck or failedClaude Code StopFailure, quota_auto_resume_stale, OpenCode session.errorNotify with the reason
Irreversible or outward facingDelete data, release, publish, spend money, send a messageEscalate: a deny or ask rule, never an auto-approve

Two rules keep it honest. A finish earns a ping only when you must act on it: review, merge, answer or redirect. A green test run on throwaway work is a log line. And a log is not optional: it is how you find the event you never classified.

Which signal each tool gives you

Every event name below comes from the tool's official docs, linked in the sources.

ToolNeeds youFinishedNotes
Claude CodeNotification with permission_prompt after about six seconds, or a PermissionRequest hook right awayidle_prompt about 60 seconds after it finishes, or a Stop hookStopFailure fires when a turn ends on an API error
Codextui.notifications with approval-requested, or a PermissionRequest hooknotify (only agent-turn-complete), or a Stop hooknotify works only in user-level config
Gemini CLI"Action required""Session complete"Experimental, off by default
OpenCodepermission.asked plugin eventsession.idle, session.error plugin eventsThe desktop app can notify on its own when a response is ready or a session errors

The six-second and 60-second gaps in Claude Code are a free debounce: a prompt you answer quickly never pings. The docs also say that in terminal sessions these types only show up when you appear to be away.

Configure the signals

Claude Code: log everything, ping selectively

An empty matcher runs your hook for every notification type. Use that to your advantage: one script writes every event to a log and pings only for the rows that need you. This is an example script, not an official one.

#!/bin/bash
# Claude Code Notification hook: log every event, ping only for the ones that need you.
# Notification hooks cannot block, so a failure here only drops a ping.
log="${AGENT_EVENT_LOG:-$HOME/.agent-events.ndjson}"
input=$(cat)

# Log first, so the log shows events that never pinged.
jq -c --arg ts "$(date -u +%FT%TZ)" \
  '{ts: $ts, tool: "claude", type: .notification_type, cwd: .cwd, msg: .message}' \
  <<<"$input" >>"$log" || exit 0

case $(jq -r '.notification_type' <<<"$input") in
  permission_prompt | idle_prompt | elicitation_dialog | elicitation_url_dialog | quota_auto_resume_stale | quota_auto_resume_disabled)
    msg=$(jq -r '.message // "Needs your attention"' <<<"$input")
    if command -v osascript >/dev/null; then
      osascript -e 'on run argv' -e 'display notification (item 1 of argv) with title "Claude Code"' -e 'end run' "$msg"
    elif command -v notify-send >/dev/null; then
      notify-send "Claude Code" "$msg"
    fi
    ;;
esac
exit 0

Register it in ~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      {
        "matcher": "",
        "hooks": [
          { "type": "command", "command": "$HOME/.claude/hooks/agent-notify.sh" }
        ]
      }
    ]
  }
}

The payload carries notification_type, message and cwd, which is all the script reads. The message goes to osascript as an argument, so a quote in the text cannot break the AppleScript. Housekeeping types such as auth_success and quota_auto_resume_fired land in the log and stay silent. agent_needs_input and agent_completed are left out on purpose: they fire for background sessions only while agent view is open.

Codex, Gemini CLI and OpenCode

Codex has two paths. The notify program runs with the event JSON as one command-line argument but sees only agent-turn-complete, so use it for finishes. For approvals, restrict the built-in TUI notifications in ~/.codex/config.toml:

[tui]
notifications = ["approval-requested"]
notification_condition = "unfocused"

notification_condition already defaults to unfocused, so pings arrive only when the terminal is not in front of you. tui.notification_method defaults to auto.

Gemini CLI needs one setting, and its two types, action required and session complete, are all it sends. It delivers through OSC 9 with a terminal bell fallback.

{
  "general": {
    "enableNotifications": true
  }
}

OpenCode routes through plugins. This one pings for approvals and errors and leaves session.idle to the log or the desktop app. It uses the macOS command from the OpenCode docs; swap in notify-send on Linux.

export const QuietNotify = async ({ $ }) => {
  return {
    event: async ({ event }) => {
      if (event.type === "permission.asked" || event.type === "session.error") {
        await $`osascript -e 'display notification "OpenCode needs you" with title "opencode"'`;
      }
    },
  };
};

What can go wrong: false positives and missing events

False positives come from an empty matcher that pings on every type, finish pings for scratch work nobody reviews, and housekeeping types wired to the same banner as approvals. The matrix fixes all three.

Missing events are the dangerous side:

  • Claude Code's agent_* matchers stay dark unless agent view is open.
  • Codex notify never sees an approval request.
  • Gemini CLI notifies nobody until you turn the setting on.
  • A hook command can fail silently. The Claude Code docs warn that osascript fails silently when Script Editor lacks notification permission, and that notify-send needs a notification daemon, which headless servers, SSH sessions and most containers do not have. Run the command by hand first.

This is why the script logs before it pings. A row in the log with no ping beside it points at a broken channel, and a gap in the log points at a broken hook. Test with sample JSON on stdin, then break it on purpose: feed it bad JSON, remove jq, and confirm it exits quietly rather than wedging the agent.

When a notification should become a decision

A notification asks for your eyes. A decision asks for your word and blocks progress until it gets it. Promote an event to a decision when the action is irreversible or outward facing: deleting data, releasing, publishing, spending money, sending mail. A Notification hook cannot make that call, because it has no decision control. The permission layer does.

In Claude Code, rules are evaluated deny first, then ask, then allow, so put destructive commands in deny or ask and keep allow for low-risk ones. In OpenCode the last matching rule wins, so put the catch-all first and the strictest rule last. Be careful with hooks that auto-approve: the Claude Code docs warn that a PermissionRequest hook returning allow with an empty matcher would auto-approve every prompt, including file writes and shell commands. Before you wire a finish signal to auto-merge or auto-push, read how to tell whether a coding agent is actually done, because a done claim deserves verification. And how to know when a coding agent is waiting for input covers the detection side of the row that matters most.

Doing this with qoop

The matrix is the same whatever you run. qoop handles the interrupting half of it. Its agents column marks each agent's state and puts the one waiting for an answer in a row at the top, so triage can start before any ping. It raises a desktop note only when an agent is blocked, failed or finished. Nothing goes out while you are on that pane or the window has focus, and a one-second recheck drops flickers, so several agents finishing together make one note.

Away from the desk, the phone gets the same news: sign in with the same account at qoop.si/app and the agent waiting on you sits first. Push notifications need the qoop phone app, which is Android today; on an iPhone the browser page shows the same list but cannot push.

For the routine questions, qass sits above your agents and is told when one stops. It reads that agent's task record, plan file and repo rules, settles the routine ones as you would, and turns the rest into cards where one key answers. Deleting, releasing, production, money and anything external such as an email, a post or a publish always becomes a card, and it never picks "always allow".

If fewer pings and the questions still reaching you sounds right, sign up at qoop.si.