Expose remote control URL via file/env var for scripting
Problem
When remoteControlAtStartup is enabled (or /remote-control is run), the remote control URL is only available in-memory and displayed in the UI. There's no way to programmatically access it from:
- A file on disk
- An environment variable
- Debug logs
- Session files
- Any CLI command
This makes it impossible to build automation around remote control, such as a custom skill that automatically sends the remote control URL to a Google Chat webhook.
Current workaround (doesn't fully work)
- Enable
remoteControlAtStartupvia/settings - Run
/remote-controlmanually to display the URL in the conversation - Run a custom skill to send it to Google Chat
The user still has to run two commands. The URL from remoteControlAtStartup is never exposed to the conversation or any accessible location.
Proposed solutions (any one would unblock this)
- Write the remote control URL to a file (e.g.,
~/.claude/sessions/<pid>.jsonor a dedicated file like~/.claude/remote-control-url) when remote control connects - Set an environment variable (e.g.,
CLAUDE_REMOTE_CONTROL_URL) in the shell environment available to hooks and skills - Include the URL in
SessionStarthook stdin data whenremoteControlAtStartupis enabled - Add a CLI flag like
claude --remote-control-urlthat prints the URL of the current session's remote control - Allow skills to invoke built-in slash commands so a skill could call
/remote-controlprogrammatically
Use case
I have a custom skill (/remote-control-send-to-chat) that sends the remote control URL to a Google Chat space via webhook. I want it to be a single command — run the skill and it handles everything. Currently this is impossible because the URL is trapped in-memory.
🤖 Generated with Claude Code
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗