Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 6 min read

Let Claude Code operate remote computers as if they were local (Codex and Gemini CLI too)

Disclosure: this post is from the RockDesk team. RockDesk is the tool the setup below uses. Claude Code, Codex and Gemini CLI work well on the machine they run on. This guide lets them operate your other computers and d

Disclosure: this post is from the RockDesk team. RockDesk is the tool the setup below uses.

Claude Code, Codex and Gemini CLI work well on the machine they run on. This guide lets them operate your other computers and devices the same way:

  • run shell scripts on them across networks
  • mount a remote project and edit it in place
  • see the screen through screenshots
  • forward ports

It works by machine ID, with nothing to open on the router, and takes about five minutes to set up. The other machine can be a Windows PC, a Mac, a Linux server without a screen, a robot or dev board running Linux, or an Android phone (screen, taps and typing).

1. Run shell scripts across networks

The other machine can sit behind a home router, on the office network or on a mobile connection. The agent runs commands there the way it runs them locally and gets the real exit code back, so &&, || and if behave as they do over ssh. A local script can be piped in, and long jobs keep running after the call returns.

rds 123456789 shell -c "uptime; df -h /"
cat deploy.sh | rds 123456789 shell -c "bash -s"
rds 123456789 spawn "cd ~/proj && make -j8"      # detached: prints the pid and its log file

On a Windows machine shell -c runs PowerShell, so the agent writes PowerShell there.

2. Mount a remote project and edit it in place

rds 123456789 mount :/home/me/project ~/remote-project

The remote project now looks like an ordinary local folder. The agent's usual file tools, searches, editors and builds work on it directly, and every change is written straight to the remote machine. When it is done: rds 123456789 umount ~/remote-project.

Linux mounts it with FUSE, macOS needs nothing extra, and on Windows the installer brings what is needed and the mount can be a drive letter (Z:). For one-off transfers there are rds <id> cp and rds <id> sync.

3. See the screen

For apps that have no command line, the agent takes a screenshot, reads it, clicks and types, then takes another screenshot to check the result.

rds 123456789 screenshot -o shot.png
rds 123456789 click 812 440
rds 123456789 type "quarterly report"
rds 123456789 key Return

4. Forward ports

rds 123456789 forward 15432:db.internal:5432

A database, a web UI or a device that only the remote machine can reach is now on 127.0.0.1:15432 here. The host name is resolved on the remote side, so names that only exist on that network work. rds 123456789 unforward 15432 stops it.

There is more: clipboard, file copy and sync, serial ports, USB devices and a VPN to the remote network. Here it is on a Windows PC and on a Mac:

How it works, in three sentences

Every machine that runs RockDesk gets a 9-digit ID. The rds command line hands each command to the RockDesk service on your own machine, which keeps one encrypted connection per peer: direct when it can get through the NAT, through a relay otherwise. Nothing has to be opened on the router and the other machine needs no sshd, and that machine decides who may connect.

Step 1: install RockDesk on both machines

Download it from rockdesk.io. There are builds for Windows, macOS (Apple silicon and Intel), Linux (.deb, x86_64 and arm64) and Android. Install it on the computer your agent runs on and on every computer you want it to work on. New devices start with a free trial.

Note the 9-digit ID shown on the machine you want to control.

On a Linux machine without a screen (a server, a robot, a dev board):

sudo systemctl enable --now rockd   # starts at boot
sudo rds status                     # prints this machine's ID
sudo rds otp                        # prints a one-time password

Step 2: give your agent the skill

The skill is a single file that teaches the agent the rds commands. It also tells the agent to check that RockDesk is installed and to send you to the download page if it isn't.

Claude Code:

/plugin marketplace add rockdesk-io/rockdesk-skill
/plugin install rockdesk@rockdesk

Codex:

codex plugin marketplace add rockdesk-io/rockdesk-skill
codex plugin add rockdesk@rockdesk

Gemini CLI:

gemini extensions install https://github.com/rockdesk-io/rockdesk-skill

Any other agent that reads agent skills:

npx skills add rockdesk-io/rockdesk-skill

If you prefer MCP: rds mcp is an MCP server over stdio with 18 tools (shell, spawn, copy, ls, screenshot, click, type, key, scroll, clipboard, port forwarding and more). Screenshots come back as images.

claude mcp add -s user rockdesk -- rds mcp
codex mcp add rockdesk -- rds mcp

rds is not on the PATH on macOS and Windows. Use /Applications/rockd.app/Contents/MacOS/rds or C:\Program Files\rockd\rds.exe there.

Step 3: let it in

The machine being controlled decides who gets in, and an ID on its own doesn't get anyone in. Pick whichever suits you:

  • Click "allow" on the other machine when the first command arrives. It covers that one connection.
  • A one-time password, shown on the other machine's home screen (sudo rds otp on a headless Linux box). It changes after each use.
  • A fixed password: run rds <id> auth once and it is remembered.
  • A key pair, like ssh: rds key gen on your machine, then rds authorize "<the public line>" on the other one. After that you get in with no password.

Mounting folders, port forwarding and the other features can be switched on or off on the other machine.

Step 4: ask

Some things to try:

  • "123456789 is my build server. Run ./scripts/release.sh there and tell me if anything fails."
  • "Mount ~/app from 123456789 and fix the failing test."
  • "Take a screenshot of 123456789 and tell me what is open."
  • "Forward the Postgres on 123456789 to port 15432 here and list its tables."

The first command to a machine takes a moment to connect. Later commands reuse the same connection and are almost instant.

Staying safe

  • The agent can only reach machines that let it in (step 3).
  • The skill tells the agent to say what it will run and wait for your OK before anything destructive or hard to undo: deleting or overwriting files, restarting services, sending messages.
  • Clipboard history can contain passwords and codes. The skill tells the agent not to pass it to third-party services unless you ask.

Skill or MCP?

Use whichever you like. The skill works in any agent that can run shell commands, and it also covers things that aren't MCP tools yet: mounting folders, file sync, the VPN, serial ports and USB. MCP gives you native tools in clients that support it, and screenshots arrive as images. You can install both.

FAQ

Do both machines need to be on the same network? No. That's the point of the ID: it works across NATs and between networks, and falls back to a relay when a direct path isn't possible.

Does the other machine need a screen? No. On headless Linux use the commands from step 1.

Is there a web version? Yes, at rockdesk.io/web, for people. Agents need the rds command line, which comes with the desktop app.

What does it cost? New devices start with a free trial. See pricing.

Links

If you try it, tell us what you'd like your agent to do on your other machines. We read every comment.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.