Remote control and teleport
This page documents the remote-session, teleport, and Remote Control surfaces visible in the extracted cli.js.
Source anchors
| Semantic alias | Source | Approximate location | String or symbol | Meaning |
|---|---|---|---|---|
| DisableRemoteControlPolicy | cli.js | line ~185, byte 0x11a7e1 | Disable Remote Control (claude.ai/code, \claude remote-control`, `—remote-control`/`—rc`)` | Managed setting/policy surface for Remote Control. |
| RemoteSessionFlag | cli.js | line ~19550, byte 0xdcb620 | `—remote [description | session_id |
| TeleportSessionFlag | cli.js | line ~19550, byte 0xdcb5ae | --teleport [session] | Teleport session resume flag. |
| RemoteControlFlag | cli.js | line ~19550, byte 0xdcb6df | --remote-control [name] | Hidden Remote Control flag. |
| RemoteControlAliasFlag | cli.js | line ~19550, byte 0xdcb772 | --rc [name] | Alias for Remote Control. |
| BridgeMainEntrypoint | cli.js | line ~7679, byte 0xb4b41d | bridgeMain | Remote/bridge headless process entry. |
| ReplBridgeInitializer | cli.js | line ~9335, byte 0xc148bc | initReplBridge | Interactive REPL bridge initialization. |
| RemoteSessionConfig | cli.js | line ~9573, byte 0xcd6d9b | remoteSessionConfig | Interactive app receives remote-session configuration. |
| TeleportProgressFlow | cli.js | line ~19375, byte 0xdb5933 | teleportWithProgress | Teleport progress UI/path. |
| SessionAccessToken | cli.js | line ~2624, byte 0x6519e7 | CLAUDE_CODE_SESSION_ACCESS_TOKEN | Session ingress token source. |
Remote runtime map
flowchart TD Root[Root action] --> RemoteFlag{remote path?} RemoteFlag -->|--remote| RemoteSession[create or attach remote session] RemoteFlag -->|--teleport| Teleport[teleportWithProgress] RemoteFlag -->|remote-control / --rc| Control[Remote Control bridge] RemoteSession --> App[Interactive session loop with remoteSessionConfig] Teleport --> App Control --> Bridge[initReplBridge / bridgeMain] Bridge --> Tokens[CLAUDE_CODE_SESSION_ACCESS_TOKEN]Remote surfaces
| Surface | Runtime role |
|---|---|
| `—remote [description | session_id |
--teleport [session] | Resumes a teleport session; helper strings validate clean git state and matching checkout. |
remote-control / rc | Hidden command that starts Remote Control for local sessions. |
--remote-control [name] / --rc [name] | Hidden root flags enabling Remote Control on an interactive session. |
remoteSessionConfig | Propagates remote-session configuration into the interactive app. |
bridgeMain | Headless bridge process entry for remote/session transport. |
initReplBridge | Interactive bridge initialization for inbound messages, permission responses, interrupts, model changes, and thinking-token changes. |
CLAUDE_CODE_SESSION_ACCESS_TOKEN | Bearer-like session ingress token source and refresh variable. |
Permission and control bridge
Remote Control is not just display streaming. The permission_response anchor in the headless/bridge code and initReplBridge callback list show bidirectional control: inbound messages, permission responses, interrupts, model updates, thinking-token updates, and other state changes can be bridged into a running session.
For the lower-level frame families (control_request, bridge_state, permission_request/permission_response, IDE ws:// or .../sse endpoints, provider text/event-stream, and MCP JSON-RPC methods), see Runtime communication protocols.
Teleport-specific guardrails
Teleport helpers include user-facing errors such as:
Git working directory is not clean. Please commit or stash your changes before using --teleport.You must run claude --teleport ... from a checkout of ...
These strings confirm that teleport is tied to repository/session consistency, not merely an arbitrary transcript download.
Related docs
Created and maintained by Yingting Huang.