2618
AI & Machine Learning

Connecting Your Machines with Loopsy: A Comprehensive Guide to Cross-Device Terminal Communication

Overview

Have you ever wished your two laptops could naturally collaborate? Many of us run multiple machines—a MacBook for work, another for personal tasks, or a desktop and a laptop. Often one sits idle while you toil on the other, which feels like wasted potential. Loopsy is a tool designed to bridge that gap, allowing terminals and AI agents on different machines to talk to each other over a local network or even the internet.

Connecting Your Machines with Loopsy: A Comprehensive Guide to Cross-Device Terminal Communication
Source: hnrss.org

Loopsy started as a simple file transfer system over LAN and evolved into a command execution platform. You can run coding agents from one machine on another, or continue a Claude AI session from your phone while at the gym by connecting through a Cloudflare worker. This guide will walk you through setting up Loopsy, from local networking to remote access, so you can unify your computing environment.

Prerequisites

Hardware and Software Requirements

  • Two or more machines (MacBooks, Linux, or Windows) with network connectivity.
  • SSH access enabled on all machines (or alternative authentication).
  • Node.js (v14 or later) installed for running Loopsy.
  • npm or yarn package manager.
  • Cloudflare account (optional, for remote access) and a configured worker.
  • Local network that allows inter-device communication (e.g., same Wi‑Fi).

Knowledge

  • Basic command-line skills.
  • Familiarity with SSH keys and port forwarding.

Step‑by‑Step Installation and Configuration

Step 1: Install Loopsy on All Machines

Clone the Loopsy repository from GitHub onto each machine you want to connect.

git clone https://github.com/yourusername/loopsy.git
cd loopsy
npm install

Alternatively, if Loopsy is published as an npm package, use npm install -g loopsy. Verify installation with loopsy --version.

Step 2: Configure Local Network Communication

Loopsy uses a peer-to-peer model over your local network. On the machine that will act as the server (the one you want to connect to), start Loopsy in server mode:

loopsy server --port 3000

On the client machine, connect using the server’s IP address and port:

loopsy connect --host 192.168.1.10 --port 3000

You should see a confirmation message. At this point, you can transfer files using commands like loopsy send myfile.txt or run remote commands with loopsy exec "ls -la".

Step 3: Enable Command Execution and AI Agent Support

Loopsy can relay commands to a shell on the remote machine. To allow an AI agent—such as Claude or a custom agent—to run on the remote host, configure the agent’s prompt to use Loopsy for command execution. For example, if you have a Claude session on your work MacBook, you can send coding tasks to your home machine by invoking loopsy exec "python script.py".

Ensure both machines have the agent’s dependencies installed. The agent output flows back seamlessly.

Step 4: Set Up Remote Access via Cloudflare Worker

To reach your local machine from outside your home network—say, from your phone at the gym—you need a public endpoint. Cloudflare Workers provide a secure tunnel.

  1. Create a Cloudflare Worker that listens for HTTPS requests and forwards them to your Loopsy server. Below is a minimal worker script (worker.js):
addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
  const loopsyUrl = 'http://localhost:3000';  // your local Loopsy server
  const forwardedRequest = new Request(loopsyUrl + new URL(request.url).pathname, {
    method: request.method,
    headers: request.headers,
    body: request.body
  });
  return fetch(forwardedRequest);
}
  1. Deploy the worker using the Cloudflare dashboard or Wrangler CLI. Take note of the worker’s public URL (e.g., https://my-loopsy-tunnel.workers.dev).
  2. Update your Loopsy client to use this URL. On your phone or remote machine, run:
loopsy connect --host my-loopsy-tunnel.workers.dev --port 443 --ssl

Make sure your local laptop is plugged in and the Loopsy server is running.

Step 5: Continue Claude Sessions Remotely

With the tunnel active, you can open Claude on your phone (or any browser) and point it to my-loopsy-tunnel.workers.dev. Loopsy proxies the conversation to your local machine where Claude is running. You can continue your session uninterrupted.

Common Mistakes and Troubleshooting

Network Discovery Failures

If the client cannot find the server, ensure both machines are on the same subnet. Check firewall settings—Loopsy uses a custom port (3000 by default). Open it using sudo ufw allow 3000 on Linux or macOS’s firewall settings.

Authentication Issues

Loopsy initially trusts all connections on the local network for simplicity. For security, consider adding SSH key authentication or editing the config file (~/.loopsy/config.json) to whitelist allowed IPs.

Cloudflare Worker Not Responding

Ensure your local machine is reachable from the worker. If behind NAT, you may need to forward port 3000 in your router. Test with curl localhost:3000/health first. Also verify the worker’s fetch permissions—Cloudflare Free plan has a limit on requests.

Agent Commands Hang or Time Out

Long‑running commands may exceed default timeouts. Increase the timeout in Loopsy’s client config: loopsy config set timeout 60000 (milliseconds). On the server side, consider using nohup or tmux for persistent sessions.

Summary

Loopsy transforms idle machines into productive partners. By following this guide, you have learned to install Loopsy, set up local networking for file and command transfer, integrate AI agents, and establish a secure remote tunnel via Cloudflare Workers. The tool continues to evolve—end‑to‑end encryption is on the roadmap, and an iOS companion app is in review. With Loopsy, you no longer leave computing power on the table; every device becomes an extension of your workflow.

💬 Comments ↑ Share ☆ Save