Notification click should focus the correct terminal window (multi-window support)

Resolved 💬 2 comments Opened Mar 4, 2026 by JackChen-me Closed Apr 2, 2026

Problem

When using Claude Code inside Cursor (or Warp), push notifications appear correctly when Claude needs user input (permission prompts, questions, task completion, etc.). However, clicking the notification does not navigate to the corresponding terminal window.

This is especially painful when running multiple Cursor windows, each with its own Claude Code session. The user has no way to jump directly to the session that needs attention.

Current Behavior

  1. Claude Code triggers a notification (e.g., "Permission required" or "Task complete")
  2. User clicks the notification
  3. Nothing happens — the correct Cursor/Warp window is not focused

Expected Behavior

Clicking the notification should:

  1. Activate the correct host application (Cursor / Warp / Terminal / iTerm2)
  2. Focus the specific window where the Claude Code session is running (matched by project/workspace name)
  3. Ideally scroll to or highlight the pending prompt

Environment

  • macOS (Darwin)
  • Claude Code running inside Cursor (Electron-based, multiple windows) and Warp
  • Using claude-notifications-go plugin with clickToFocus: true
  • terminalBundleId config exists but only supports a single app, not multi-window targeting

Workaround

I wrote a custom hook script that:

  1. Reads cwd from the hook input JSON
  2. Detects the terminal app via TERM_PROGRAM env var
  3. Uses AppleScript to find the window whose title contains the project folder name
  4. Brings that specific window to front

This works but is fragile and platform-specific. Native support would be much better.

Suggestion

  • Include window/session identifier in notification metadata
  • On macOS, use NSUserNotification (or UNUserNotification) with an activation handler that focuses the correct window
  • Support multi-window scenarios where multiple Claude Code sessions run simultaneously
  • Consider deep-link or callback URL scheme for cross-app navigation

View original on GitHub ↗

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