Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Mastering Remote AI Agents: A Comprehensive Guide to Claude and Codex on Virtual Machines

Description and use

By combining SSH, tmux, vendor‑managed remote control, and Pinggy tunnels, developers can keep AI agents running on VMs while interacting from mobile devices or laptops securely and reliably.

Problem

Developers need to interact with long-running AI coding agents on remote VMs from mobile devices or other computers while handling session management, network constraints, and security.

Outcome

By combining SSH, tmux, vendor‑managed remote control, and Pinggy tunnels, developers can keep AI agents running on VMs while interacting from mobile devices or laptops securely and reliably.

Workflow

  • 1. Configure SSH host in ~/.ssh/config for the VM.
  • 2. Start a tmux session: ssh -t devbox tmux new -A -s agent.
  • 3. Launch the AI agent inside tmux and detach with Ctrl‑b d.
  • 4. For Claude Code: run claude remote-control --name "devbox app" to obtain a session URL or QR code and scan with the mobile app.
  • 5. For Codex: register the VM as an SSH host in the ChatGPT desktop app or start the experimental daemon with codex remote-control start/pair.
  • 6. If behind NAT, expose SSH via Pinggy: ssh -p 443 -R0:localhost:22 [email protected] and use the provided public address.
  • 7. Harden SSH: disable password auth, set PasswordAuthentication no, verify with sshd -T.
  • 8. Monitor resource usage with htop/top and consider Docker isolation if needed.
  • 9. Troubleshoot: use ssh -v, reattach tmux, check ANTHROPIC_BASE_URL, verify Codex versions, restart Pinggy via systemd if network resets.

Evidence

Claude Code 2.1.310 introduces the claude remote-control functionality, which allows developers to bridge a session running on a remote VM directly into the Claude mobile application or via the web interface at https://claude.ai.

Source

OpenAI has advanced its ecosystem with the OpenAI Codex 0.164.0, which includes experimental daemon support and integration with the ChatGPT desktop application.

Source

The most robust way to manage long-running processes on a remote machine is by using tmux.

Source

Pinggy provides an elegant solution to this problem by creating a reverse tunnel from your local box to the public internet.

Source

  • Record date: 2026-11-01T09:14:08.282Z