[BUG] queryCompleted idle notification suppressed even when app is not focused

Resolved 💬 3 comments Opened May 6, 2026 by superokajun Closed May 9, 2026

What's Wrong?

When a Claude Code response completes (queryCompleted event), the desktop notification is never shown if that chat session is the "focused session" within the app — even when the Claude app itself is in the background and another application has focus.

In the queryCompleted event handler (app.asar → .vite/build/index.js), the notification is suppressed based solely on getFocusedSession():

Fi.on("queryCompleted", c => {
  // ...
  Fi.getFocusedSession() === c || Rc.showIdleNotification(...)
});

getFocusedSession() tracks which chat tab is open inside the Claude app, not whether the app window is actually focused. So if a user has a chat open, switches to another app, and waits for Claude to finish — the notification is silently suppressed because that session is still the "focused session."

In contrast, the permission notification handler correctly checks both conditions using isAppFocusedAndVisible() (mainWindow.isVisible() && mainWindow.isFocused()).

The queryCompleted handler should also check isAppFocusedAndVisible() before suppressing the idle notification.

What Should Happen?

When the Claude app is in the background (not focused) and a response completes, a desktop notification should appear. The notification should only be suppressed when the user is actually looking at that session (app focused AND session open).

Steps to Reproduce

  1. Open a chat in the Claude desktop app
  2. Send a message that takes some time to complete (e.g., a task involving shell commands)
  3. Immediately switch to another application
  4. Wait for Claude to finish responding
  5. No desktop notification appears, even though the app is not visible/focused

Environment

  • Claude Desktop v1.5354.0
  • Claude Code v2.1.121
  • macOS 26.4.1 (Darwin 25.4.0, Apple M2 Ultra)
  • macOS notification settings for Claude: fully enabled (desktop, notification center, lock screen, sound, badge all ON)
  • Focus mode: off
  • dockBounceEnabled: true in config

Found by inspecting app.asar → .vite/build/index.js (class HUn / NotificationService, queryCompleted listener).

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗