Repository navigation
Conversation
Owner
|
Thank you. I will take a look at this and test it out. |
Author
|
I've been trying this out since yesterday and for me the the ntfy system works best. I prefer that over the tmux popups. This is the script I use for that: I also use it to get notifications when claude asks for permissions. |
Auto-detect the Tailscale hostname (or PLANNOTATOR_HOSTNAME) so remote users can open the review server directly in their browser — full approve/deny, no port forwarding needed. The user-facing URL hostname is resolved separately from the bind address, and a read-only share.plannotator.ai URL is generated as a fallback when no reachable hostname is available. Notification delivery: ntfy push (optional via CLAUDE_HOOKS_NTFY_URL) with stderr as the fallback. Short URLs via the paste service for compact links. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
tfriedel
force-pushed
the
feat/remote-notifications
branch
from
June 21, 2026 23:18
3fcb6c9 to
6edf06b
Compare
handleServerReady still called openBrowser in remote sessions; when the VS Code IPC bridge was unavailable, openBrowser fell through to xdg-open/open/start and launched a browser on the remote host (e.g. an X-forwarded window over SSH). Remote sessions now bail out after the IPC attempt — the reachable URL is already delivered via stderr + ntfy. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ns to Pi Addresses code-review findings on the remote-notification feature: - remote.ts: guard detectTailscaleHostname with a 3s timeout that kills the subprocess, so a wedged tailscaled can't hang the notification or leak a process. Add resetServerUrlHostnameCache test helper. - share-url.ts: split runtime-agnostic prepareRemoteShareLink (compute) from writeRemoteShareLink (Bun stderr emit); notifyNtfy now honors options.fetchImpl and the duplicated stderr formatting is extracted to emitShareLink. - Port the full feature to the Pi (Node) server: getServerUrlHostname + timeout-guarded tailscale probe and random ports in network.ts; vendor share-url/compress/crypto; surface reachable URL / share-link fallback + ntfy via ctx.ui.notify for plan/review/annotate remote sessions. - Docs/comments: drop stale fixed-19432 remote-port claims (AGENTS.md, in-code doc comments, planAgentInstructions) now that remote uses random ports + resolved hostnames. - Tests: random remote port + getServerUrlHostname (Pi), prepareRemoteShareLink reachable/fallback + ntfy-via-fetchImpl (Bun). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… drift Addresses code-review findings on the remote-notifications work: - Pi openBrowser now never launches a browser on the remote host, even when PLANNOTATOR_BROWSER/BROWSER is set — mirrors the Bun server's remote bail. - Extract hostname resolution (env priority, memoization, DNSName parsing) into packages/shared/hostname.ts, used by both the Bun (remote.ts) and Pi (network.ts) runtimes; only the tailscale spawn stays runtime-specific. - Don't cache the "localhost" fallback, so the long-lived Pi process can still resolve a hostname on a later review if tailscaled wasn't ready at first. - Drop the unproducible "remote-default" portSource from all 5 unions. - Pi notifyRemoteShareLink error path now surfaces the failure reason + paste hint instead of an unreachable localhost URL. - Remove dead !isRemote from browser.ts glimpse condition. - Sweep stale "remote defaults to 19432" claims across READMEs, marketing docs (add Tailscale guidance + PLANNOTATOR_HOSTNAME), header comments, and the manual SSH test doc. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Owner
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