Skip to main content
Claw Code exposes five simulated runtime modes that mirror Claude Code’s remote execution branches. Each mode accepts a target string and returns a structured report describing what would happen if the real runtime were invoked. These are placeholder implementations — they exercise the harness plumbing without establishing actual connections.

What remote modes are

Claude Code supports several remote execution paths: remote control, SSH proxying, Teleport session resume/create, direct-connect, and deep-link launch. Claw Code mirrors each of these as a named CLI command backed by a small dataclass, allowing the routing and reporting infrastructure to be tested without a live remote target.

CLI commands

python3 -m src.main remote-mode <target>
Simulates remote control runtime branching.
mode=remote
connected=True
detail=Remote control placeholder prepared for <target>

Report dataclasses

The five modes split across two report types.

RuntimeModeReport — remote, SSH, and Teleport

Defined in src/remote_runtime.py:
@dataclass(frozen=True)
class RuntimeModeReport:
    mode: str       # "remote" | "ssh" | "teleport"
    connected: bool # always True in the placeholder
    detail: str     # human-readable description

    def as_text(self) -> str:
        return f'mode={self.mode}\nconnected={self.connected}\ndetail={self.detail}'
Defined in src/direct_modes.py:
@dataclass(frozen=True)
class DirectModeReport:
    mode: str    # "direct-connect" | "deep-link"
    target: str  # the target argument passed on the CLI
    active: bool # always True in the placeholder

    def as_text(self) -> str:
        return f'mode={self.mode}\ntarget={self.target}\nactive={self.active}'
RuntimeModeReport uses a detail field for the connection description, while DirectModeReport echoes the target directly. The two formats are intentionally different to mirror the structural split between the remote-proxy modes and the local-launch modes in the original TypeScript source.

Mode reference

remote-mode

Remote control runtime. Represents the branch taken when Claude Code is being driven from a remote control interface. Reports connected=True with a detail string naming the target.

ssh-mode

SSH proxy runtime. Represents the branch taken when connecting through an SSH tunnel. Reports connected=True with a detail string naming the target.

teleport-mode

Teleport resume/create runtime. Represents the branch taken when resuming or creating a Teleport session. Reports connected=True with a detail string naming the target.

direct-connect-mode

Direct-connect runtime. Represents the branch taken for a direct connection launch. Reports active=True and echoes the target.

deep-link-mode

Deep-link runtime. Represents the branch taken when Claude Code is launched via a deep link URL. Reports active=True and echoes the target.

Placeholder behavior

All five implementations are stubs. Each function constructs its report dataclass directly without performing any I/O:
# src/remote_runtime.py
def run_remote_mode(target: str) -> RuntimeModeReport:
    return RuntimeModeReport('remote', True, f'Remote control placeholder prepared for {target}')

def run_ssh_mode(target: str) -> RuntimeModeReport:
    return RuntimeModeReport('ssh', True, f'SSH proxy placeholder prepared for {target}')

def run_teleport_mode(target: str) -> RuntimeModeReport:
    return RuntimeModeReport('teleport', True, f'Teleport resume/create placeholder prepared for {target}')

# src/direct_modes.py
def run_direct_connect(target: str) -> DirectModeReport:
    return DirectModeReport(mode='direct-connect', target=target, active=True)

def run_deep_link(target: str) -> DirectModeReport:
    return DirectModeReport(mode='deep-link', target=target, active=True)
These modes do not establish real connections, start processes, or communicate with any remote service. They exist to validate that the harness plumbing — CLI argument parsing, dispatch, report serialization — works end-to-end.

Use cases

  • Testing runtime branching logic: Confirm that each mode is reachable from the CLI and returns a correctly shaped report without needing a real remote target.
  • Validating harness plumbing: Use in CI to ensure the dispatch table in main.py correctly routes each subcommand to its handler and that the as_text() serialization produces the expected output format.
  • Incremental porting: The placeholder structure makes it straightforward to replace each stub with a real implementation once the corresponding TypeScript runtime slice is ported.

Build docs developers (and LLMs) love