Skip to content

denoland/clawssh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clawssh — run Claude Code on remote machines over SSH

Full native TUI, zero installation on the remote. Just
SSH access. Also supports OpenCode via --opencode.

  $ clawssh root@api-pod-7f8d4
  [clawssh] Connected — remote cwd: /app
   ▐▛███▜▌   Claude Code v2.1.84
  ▝▜█████▛▘  Opus 4.6 (1M context) · Claude Max
    ▘▘ ▝▝    /app

  ❯ /healthz is returning 503, debug it

  ⏺ Bash(curl -s localhost:8080/healthz)
    ⎿  {"status":"error","detail":"redis connection refused"}

  ⏺ Edit(src/config.ts)
    ⎿  Changed REDIS_HOST fallback: localhost → redis-svc

  ⏺ Bash(curl -s localhost:8080/healthz)
    ⎿  {"status":"ok"}

HOW IT WORKS

Injects a patch into Claude Code's Node.js runtime via
NODE_OPTIONS=--require. The patch intercepts child_process
and fs calls, routing tool operations through SSH to the
remote machine. Claude's internal operations stay local.

For OpenCode, installs a plugin that replaces built-in
tools with SSH-backed versions. Pass --opencode to use.

FEATURES

  - Zero remote installation — no Node.js, no Claude Code,
    no agent framework on the target. If you can SSH to it,
    clawssh works on it.

  - Agent/environment separation — Claude runs locally with
    your auth, config, and session history. Only tool
    execution (Bash, Read, Write, Edit) hits the remote.
    The agent loop never touches the target machine.

  - Full native TUI — not a headless wrapper. You get the
    real Claude Code interface, keyboard shortcuts, slash
    commands, conversation history, everything.

  - Cross-machine sessions — start a session on your Mac
    against a Linux dev server. Close the laptop, open it
    on your Windows machine, --resume the same session
    against the same server. Sessions live locally, the
    remote is just an execution target.

  - Full flag passthrough — SSH flags before the target,
    Claude flags after. Jump hosts, custom keys, resume,
    model selection, all work.

      clawssh -J bastion -i ~/.ssh/dev dev@internal --resume --model opus

  - Works with any SSH target — bare metal, VMs, containers,
    cloud instances, your coworker's machine, a Raspberry Pi.
    Anything with sshd.

USAGE

  clawssh [--opencode] [SSH-FLAGS...] <USER@HOST> [AGENT-FLAGS...]

  clawssh dev@workstation.internal
  clawssh --opencode dev@server
  clawssh -i ~/.ssh/key -p 2222 dev@server --resume
  clawssh -J jumpbox dev@internal --model opus -c

INSTALL

  curl -fsSL https://denoland.github.io/clawssh/install.sh | sh

  Or build from source:

    deno task compile

Requires Claude Code and Node.js on the local machine.
Nothing needed on the remote.

ENVIRONMENT

  CLAWSSH_CLAUDE_PATH   path to Claude cli.js
  CLAWSSH_NODE_PATH     path to node binary
  CLAWSSH_DEBUG=1       log intercepted tool calls

About

Claude Code over SSH

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors