Skip to content

Remote control and teleport

This page documents the remote-session, teleport, and Remote Control surfaces visible in the extracted cli.js.

Source anchors

Semantic aliasSourceApproximate locationString or symbolMeaning
DisableRemoteControlPolicycli.jsline ~185, byte 0x11a7e1Disable Remote Control (claude.ai/code, \claude remote-control`, `—remote-control`/`—rc`)`Managed setting/policy surface for Remote Control.
RemoteSessionFlagcli.jsline ~19550, byte 0xdcb620`—remote [descriptionsession_id
TeleportSessionFlagcli.jsline ~19550, byte 0xdcb5ae--teleport [session]Teleport session resume flag.
RemoteControlFlagcli.jsline ~19550, byte 0xdcb6df--remote-control [name]Hidden Remote Control flag.
RemoteControlAliasFlagcli.jsline ~19550, byte 0xdcb772--rc [name]Alias for Remote Control.
BridgeMainEntrypointcli.jsline ~7679, byte 0xb4b41dbridgeMainRemote/bridge headless process entry.
ReplBridgeInitializercli.jsline ~9335, byte 0xc148bcinitReplBridgeInteractive REPL bridge initialization.
RemoteSessionConfigcli.jsline ~9573, byte 0xcd6d9bremoteSessionConfigInteractive app receives remote-session configuration.
TeleportProgressFlowcli.jsline ~19375, byte 0xdb5933teleportWithProgressTeleport progress UI/path.
SessionAccessTokencli.jsline ~2624, byte 0x6519e7CLAUDE_CODE_SESSION_ACCESS_TOKENSession 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

SurfaceRuntime role
`—remote [descriptionsession_id
--teleport [session]Resumes a teleport session; helper strings validate clean git state and matching checkout.
remote-control / rcHidden command that starts Remote Control for local sessions.
--remote-control [name] / --rc [name]Hidden root flags enabling Remote Control on an interactive session.
remoteSessionConfigPropagates remote-session configuration into the interactive app.
bridgeMainHeadless bridge process entry for remote/session transport.
initReplBridgeInteractive bridge initialization for inbound messages, permission responses, interrupts, model changes, and thinking-token changes.
CLAUDE_CODE_SESSION_ACCESS_TOKENBearer-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.

Created and maintained by Yingting Huang.