Skip to content

feat: remote SSH notification support (forward notifications to Windows/Linux over SSH tunnel) #26

Description

@mlz11

Problem

When Claude Code runs on a remote Mac accessed via SSH (e.g., from VSCodium on Windows), notifications only appear on the Mac — but the user is looking at their Windows/Linux screen.

Proposed Solution

A TCP-based notification pipeline over SSH reverse tunnel:

[Mac]                              SSH reverse tunnel              [Windows/Linux]
Claude Code hook → notify.sh → TCP localhost:19223 ─────────────→ listener → desktop notification

Components

  1. Scripts/notify-remote.sh — Lightweight bash script (zero macOS deps) that sends JSON over TCP instead of calling claude-notifier. Multiple send methods for compatibility (nc, bash /dev/tcp, socat, curl). Silent failure to never block Claude Code hooks.

  2. Scripts/claude-notifier-listener.ps1 — Windows PowerShell listener using WinRT toast API (zero external deps, Windows 10+). Listens on 127.0.0.1:19223, receives JSON, shows Windows toast notifications.

  3. claude-notifier setup --remote — Setup command that:

    • Prints step-by-step setup guide (SSH config, script installation, listener setup)
    • --print-script: outputs raw notify-remote.sh to stdout (for piping)
    • --print-listener: outputs raw PowerShell listener to stdout (for copying to Windows)
  4. Doctor integration — Informational check detecting if remote mode is active.

User Setup Flow

# On Mac (one-time):
claude-notifier setup --remote --print-script > ~/.claude/notify.sh && chmod +x ~/.claude/notify.sh

# On Windows (one-time):
# Copy listener script, then:
powershell -ExecutionPolicy Bypass -File claude-notifier-listener.ps1

# SSH config (on Windows, ~/.ssh/config):
Host mac-host
  RemoteForward 19223 localhost:19223

JSON Protocol

Newline-terminated JSON over TCP:

{"title":"Claude Code","subtitle":"my-project","message":"Task completed","sound":"default"}

Files to Create

  • Scripts/notify-remote.sh
  • Scripts/claude-notifier-listener.ps1

Files to Modify

  • Sources/ClaudeNotifier/Setup.swift — add runRemoteSetup()
  • Sources/ClaudeNotifier/ArgumentParser.swift — parse setup --remote
  • Sources/ClaudeNotifier/main.swift — route new command
  • Sources/ClaudeNotifier/Doctor.swift — informational remote mode check
  • Makefile — generated file targets for embedded scripts

Use Case

User runs VSCodium on Windows with Remote SSH into a Mac where Claude Code runs. They want desktop notifications on Windows when Claude Code needs input or completes a task.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions