feat: remote session notifications via Tailscale, tmux, and ntfy#286
Open
tfriedel wants to merge 2 commits intobacknotprop:mainfrom
Open
feat: remote session notifications via Tailscale, tmux, and ntfy#286tfriedel wants to merge 2 commits intobacknotprop:mainfrom
tfriedel wants to merge 2 commits intobacknotprop:mainfrom
Conversation
Auto-detect Tailscale hostname so remote users can open the plan review server directly in their browser without port forwarding. Server binds to 0.0.0.0 when a reachable hostname is detected, and uses random ports so parallel Claude sessions work. Notification delivery: tmux display-popup (primary), ntfy push notification (optional via PLANNOTATOR_NTFY_TOPIC), stderr (fallback). Short URLs via paste service for compact share links. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #192 — remote Claude Code sessions can now open the plan review UI without port forwarding.
Note: This is not a general-purpose solution — it relies on Tailscale, tmux, and/or ntfy, which are not common dependencies. It's shared as a working proof-of-concept and inspiration for how remote access can work. A more general solution (e.g., a session router on a fixed port, or first-class support for Claude Code surfacing hook messages) is still needed for broad adoption. See #192 for discussion.
What's here
tailscale status --self --json, so the server URL is directly reachable (e.g.http://mybox.ts.net:PORT). Also supports explicitPLANNOTATOR_HOSTNAMEenv var.0.0.0.0binding: Server binds to all interfaces when a non-localhost hostname is detected.$TMUXis set, shows atmux display-popupwith the server URL — works inside Claude Code's TUI since it's a tmux-layer overlay that bypasses Claude's stdio capture.CLAUDE_HOOKS_NTFY_URLis set (compatible with existing claude-code ntfy hooks), sends a push notification with a clickable link.Why this isn't the general solution
The core problem is that Claude Code doesn't surface hook stderr to the user — it captures it to a socket. This means there's no built-in way for a hook to communicate a URL (or anything else) to the user while it's running.
The workarounds here are all external channels:
For users without any of these, the only option remains manual SSH port forwarding (
ssh -L PORT:localhost:PORT), which is fragile since ports are now random.Ideas for a general solution
/session/<id>). Users forward one port, all sessions are accessible. More complex but works without external dependencies.localhost:PORTURL to stderr, VS Code picks it up. This works today for VS Code Remote users — the missing piece is just surfacing the URL.Test plan
http://hostname:port, opens in local browser, full approve/deny works🤖 Generated with Claude Code