[BUG] Notification event doesn't work over SSH with MacOS

Resolved 💬 4 comments Opened Jul 12, 2025 by ghostcow Closed Jul 13, 2025

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: <!-- output of claude --version -->1.0.51
  • Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 -->MacOS (local) Ubuntu 22.04 (SSH)
  • Terminal: <!-- e.g. iTerm2, Terminal App -->Ghostty 1.1.3

Bug Description

<!-- A clear and concise description of the bug -->Notification event sends OSC 9 correctly when CC runs locally, yet doesn't send OSC 9 over SSH.

Just to be clear:

Steps to Reproduce

  1. <!-- First step -->Trigger notification event in CC locally (works)
  2. <!-- Second step -->Trigger notification event in CC over SSH (does NOT work)

Expected Behavior

<!-- What you expected to happen -->Notification event triggers MacOS notification from OSC 9 print over SSH

Actual Behavior

<!-- What actually happened -->Doesn't happen over SSH, yet works locally on MacOS

Additional Context

<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->Can use this hook script to make sure the code is printed:

#!/usr/bin/env python3
import json
import sys


def send_osc9_notification(message, title="Claude Code"):
    """Send OSC 9 notification to terminal"""
    # OSC 9 format: \033]9;[message]\033\\
    osc_sequence = f"\033]9;{message}\033\\"
    print(osc_sequence, end="", flush=True)


def main():
    try:
        # Read JSON input from stdin
        input_data = json.load(sys.stdin)
        message = input_data.get("message", "Claude Code notification")

        send_osc9_notification(message)

    except Exception as e:
        # Fallback notification
        send_osc9_notification(f"Claude Code notification (error: {e})")


if __name__ == "__main__":
    main()

View original on GitHub ↗

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