# Loopsy

> Control Claude Code, Cursor, Codex, or any shell on your laptop from your phone via a self-hosted Cloudflare Workers relay with no port forwarding required.

Loopsy is an open-source tool that lets you control any terminal on your laptop from your phone, self-hosted on Cloudflare Workers. It connects your phone and laptop through a lightweight Cloudflare Worker relay using WebSockets, requiring no port forwarding, public IP, or VPN. It also enables agent-to-agent communication across machines on a LAN via MCP, allowing AI coding agents like Claude Code, Codex CLI, Gemini CLI, and Opencode to drive remote machines directly.

- **Phone-to-terminal control**: *Install the npm package, deploy your relay in ~30 seconds with `npx @loopsy/deploy-relay`, and pair your phone by scanning a QR code.*
- **Full PTY support**: *Real terminal with ANSI rendering, scrollback, resize, and TUI support — sessions persist across tab switches, lock screens, and signal loss.*
- **Voice input**: *Dictate commands via the Web Speech API directly from the mobile web app, with the ability to edit before sending.*
- **Self-hosted relay**: *Deploy your own Cloudflare Worker relay so no third party sees your terminal content; the free tier covers personal use comfortably.*
- **LAN agent-to-agent MCP tools**: *Daemons discover each other via mDNS and expose MCP tools (`loopsy_execute`, `loopsy_transfer_file`, `loopsy_context_set`, etc.) so AI agents can drive remote machines, share state, and pass messages.*
- **Persistent PTY sessions**: *Spawn long-running sessions on remote machines, poll them later from your laptop or phone, and tear them down when done.*
- **Shared key-value context store**: *Agents on different machines can read and write shared state, enabling multi-agent pipelines without direct coordination.*
- **Secure pairing**: *ECDH (P-256) key exchange with a 6-digit short authentication string for LAN peers; HMAC-signed pair tokens and SHA-256 hashed secrets for phone pairing.*
- **Per-session auto-approve**: *Opt in to skip confirmation prompts on a per-session basis; defaults off and requires macOS user password to enable.*
- **Cross-platform CLI**: *Works on macOS, Linux, and Windows; supports launchd, systemd, and Task Scheduler for auto-start on login.*

## Features
- Phone-to-terminal control via Cloudflare Workers relay
- Full PTY with ANSI, scrollback, resize, and TUI support
- Persistent sessions across tab switches and signal loss
- Voice input via Web Speech API
- Self-hosted relay deployment in ~30 seconds
- LAN agent-to-agent communication via MCP
- MCP tools for remote command execution, file transfer, and shared state
- mDNS peer discovery on local networks
- Shared key-value context store for multi-agent pipelines
- Agent messaging protocol with delivery, ACKs, and retries
- Per-session auto-approve for AI agent permissions
- ECDH P-256 key exchange for LAN peer pairing
- HMAC-signed pair tokens and SHA-256 hashed secrets
- Per-IP rate limiting and bearer auth with constant-time compare
- npm provenance via OIDC Trusted Publisher
- Auto-start via launchd, systemd, or Task Scheduler
- Configurable execution denylist and file transfer path restrictions
- Audit log at ~/.loopsy/logs/audit.jsonl

## Integrations
Claude Code, Cursor, Codex CLI, Gemini CLI, Opencode, Cloudflare Workers, Cloudflare Durable Objects, MCP (Model Context Protocol), Web Speech API, mDNS

## Platforms
WINDOWS, MACOS, LINUX, ANDROID, IOS, WEB, API, CLI

## Pricing
Open Source

## Version
v1.0.43

## Links
- Website: https://github.com/leox255/loopsy
- Documentation: https://github.com/leox255/loopsy/blob/main/AGENTS.md
- Repository: https://github.com/leox255/loopsy
- EveryDev.ai: https://www.everydev.ai/tools/loopsy
