spawn-cc-remote
Spawn a detached interactive `claude --remote-control` session locally and return the claude.ai/code session URL. Use when the user wants to pair a Claude Code session from claude.ai/code web, their p
Files1
View on GitHubSKILL.md.claude/skills/spawn-cc-remote/SKILL.md
GitHubspawn-cc-remote
Purpose
Start another local Claude Code session with Remote Control enabled,
detached from the current shell, and return the claude.ai/code/session_...
URL the user can open from any browser or phone. The spawned process
keeps running after the current CC session ends.
Why a skill (not just a command)
claude --remote-control is a TUI. Run from inside another CC session
via the Bash tool, it has no TTY → falls into --print mode → exits
demanding a prompt. This skill wraps script(1) to provide a
pseudo-TTY so the spawned claude boots interactive anyway.
Inputs
- Optional
nameargument → session name (also names the log file). - Default name:
rc-<unix-ts>.
Steps
- Run
bash bin/spawn-cc-remote.sh [name]. - Script prints four
key=valuelines on success:url=https://claude.ai/code/session_...name=<session-name>pid=<pid-of-claude-process>log=/tmp/cc-rc-<name>.log
- Surface the
urlto the user as a clickable line. Also report the pid so they can kill it later. - If the script prints
FAILED:and a log tail, surface the failure verbatim — don't retry blindly. Common causes:claudeCLI not in PATH for non-login shells.- User not authenticated (run
claude /loginonce manually first). - Working directory denied by workspace-trust prompt — answer yes once in a real terminal, then this skill will work.
Cleanup
kill <pid>orpkill -f "claude --remote-control <name>".- Log files at
/tmp/cc-rc-<name>.logpersist until reboot. Safe to delete after the remote session ends.
Caveats / known
- Spawned session inherits the current working directory of the
caller. If you want it rooted elsewhere,
cdfirst or pass the dir through the calling shell. - Hooks/MCP servers configured in
.claude/settings.jsonload in the spawned session normally — Semgrep / IDE-extension warnings are non-blocking. - Spawning two sessions with the same
namewill collide in the log file. Either pass a unique name or let the timestamp default fire.
Verification
After surfacing the URL, optionally run:
ps -o pid,ppid,etime,command -p <pid>
to confirm the process is alive. Three-process chain expected:
zsh → script → claude.