Per-type, presence-aware notification control in settings (silence 'idle' without losing focus-gating on the rest)
What I'm trying to do
I want control over which Claude Code notifications reach me on the terminal (iTerm2) channel:
- Never the idle "waiting for input" notification — it's noise; I'm the one who stepped away.
- Permission-required and agent-done notifications: yes, but only when they add value — i.e. when I'm not already looking at the terminal. Native notifications are already focus-aware (the idle one only fires when the terminal is blurred), so this is really about which types fire while keeping that focus-awareness.
I'm currently (partly) working around this with a hook, but ideally this is a settings-level capability, so no hook workaround is needed at all.
Why current settings don't cover it
- There's no per-type control to disable only the idle notification while keeping the others. The idle "waiting for input" banner has no user-facing off switch, and
inputNeededNotifEnabled/agentPushNotifEnabledgate mobile push (Remote Control), not the terminal banners. - So the only way to silence idle is to disable the entire native channel (
preferredNotifChannel: "notifications_disabled") and rebuild the notifications I want by other means.
The workaround, and where it breaks
✅ With the native channel off, I re-emit the notifications I want from a Notification hook (OSC 9 to the interactive claude PTY → iTerm2 banner). Filtering by notification_type — drop idle_prompt, keep the rest — works.
❌ But hooks fire regardless of focus/presence. Claude already computes this (there's a presence check that suppresses push notifications when you're present — CLAUDE_CODE_DISABLE_NOTIFICATION_PRESENCE_CHECK, and the client logs [presence] pulse skipped (terminal blurred)), but it isn't applied to hook-driven notifications, and focus/presence isn't exposed to hooks (no field on the payload, and no local file — the presence pulse is POSTed to the remote API). So I get permission/done banners even while looking at the session — exactly the noise I was trying to avoid.
What would solve it
Ideal — via settings, no hook needed: per-type control over terminal notifications that keeps the existing focus/presence-awareness. For example:
- a way to disable just the idle notification (or per-
notification_typeenable/disable for the iTerm2/terminal channel), and - have the retained types respect presence (fire only when the terminal is blurred), the way the idle notification and push notifications already do.
Fallback — if the hook route is the intended path: expose focus/presence to hooks (e.g. a terminal_focused field on the hook payload, an opt-in presence gate for hook-driven notifications, or an env var / local presence file), so a hook can suppress when focused.
Related
- #69406 — presence file / notification-suppression docs.
Environment
Claude Code 2.1.215, Linux container, iTerm2 on the macOS host.
🤖 Generated with Claude Code — Claude Opus 4.8