[FEATURE] No way to programmatically start a Remote-Control-visible session from an already-running session (blocks automated handoff-to-phone)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
There's no supported mechanism for a running Claude Code session (e.g. from a hook, or another CLI invocation) to spawn a new session that shows up in the Remote Control session list on mobile. This blocks a natural workflow: auto-handing-off a long session to a fresh one and continuing from your phone, without walking back to the desktop to manually start a new Remote Control session.
Proposed Solution
either (a) make --bg sessions registry-visible to Remote Control, or (b) let --remote-control work headless (no PTY required), or (c) document/support a URI or CLI call that creates a new registry-visible session with a given name/cwd that the desktop app picks up automatically.
Alternative Solutions
What I tried, all from a script/hook with no attached TTY:
claude --bg — starts a background agent (claude agents lists it), but it never registers in the Remote Control / CCD session registry. Confirmed via mcp__ccd_session_mgmt__list_sessions — the spawned session never appears.
claude --remote-control [name] — per --help, this "starts an interactive session with Remote Control enabled." But run headless (no real PTY — i.e. from a hook, cron, or background script), it doesn't fall back to background/headless mode — it just errors out demanding --print input, identical to a plain one-shot call. So it's unusable for any kind of automated/scripted handoff.
The claude-cli:// URI protocol handler (registered at HKCU\Software\Classes\claude-cli\shell\open\command → claude.exe --handle-uri "%1") only recognizes the bare scheme — no documented params for spawning a new session with a given cwd/name that the desktop app would then surface to Remote Control.
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
I run long Claude Code sessions on a desktop and want to use Remote Control from my phone to keep working without returning to the machine. When a session's context fills up and gets handed off (e.g. via a PreCompact hook that saves a summary), I'd like the desktop to automatically start the successor session in a way that's immediately visible/switchable from the phone — rather than requiring me to physically be at the desktop to start a new Remote Control session by hand.
Additional Context
Environment: Claude Code 2.1.187, Windows 11, CLI installed at ~/.local/bin/claude.exe, desktop app session driving via bundled CLI at %APPDATA%\Claude\claude-code\<version>\claude.exe.