server

module
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: MIT

README

Loomux

One chat for your coding agents, across your own machines. Loomux starts Claude Code or Codex in tmux on your servers, or on machines it creates on your own Docker or Kubernetes. It tells you when an agent is stuck, and you can attach to the live session whenever you want.

Self-hosted and MIT-licensed. Not to be confused with loomux.dev, an unrelated commercial product.

What it is

loomuxd is a small server for people who run coding agents in tmux on more than one machine and have too many panes to watch. You write in a chat, in any browser. A small router model you choose reads the message and picks the machine and the workspace. Loomux starts the agent there in its normal interactive mode, or passes the message to the one already running, and the answer comes back into the conversation.

  • Your machines, or machines it makes.
    • Register any host you reach over SSH. Loomux scans and pins its host key and keeps its own key for it.
    • Or let the bundled Docker or Kubernetes plugin create a container or pod per machine, with a persistent volume.
  • Real sessions, not a wrapper. Agents run as the CLI you already use, in tmux, as the machine's user. Attach to any of them and look or type; nothing runs headless.
  • Blocked prompts reach you. When an agent stops at a screen Loomux recognises (a permission request, the agent's own question, folder trust, an expired login, a usage limit), you get a card with Approve / Deny / Reply, and a push notification through ntfy if you set it up.
  • Policy per machine: which agents may run there, whether new work needs your confirmation, the agents' permission mode, and how much of their output the router model sees (relay: full | last_message | none).
  • A credential vault. API keys and tokens for the agents are stored encrypted and handed to the agent's environment at launch, never on a command line.
  • Verifiable images. The server and agent images carry GitHub build-provenance attestations, and each release names its image digests.

What it isn't

  • Not for teams. One user, one password, in v1.
  • Not a hosted service. You run it; nothing passes through a Loomux service. The router-model provider you pick, and the agents' own providers (Anthropic, OpenAI), still receive what they process.
  • Not a native mobile app. The web client works in a phone's browser.
  • Not headless automation. Agents run interactively, and some of their prompts wait for you.

Status

Pre-alpha. Expect rough edges:

  • every release is a pre-release, and the API may still change before 1.0;
  • the router model is a third-party API unless you run an OpenAI-compatible endpoint that supports forced tool calls (tool_choice) yourself;
  • the images are Linux/amd64 only;
  • the terminal client, loomux/tui, isn't usable yet.

Quickstart

One Linux host with Docker, about 10 minutes to a signed-in agent on a 50 Mbit/s connection. You need a router-model API key (Anthropic, or any OpenAI-compatible endpoint that supports forced tool calls) and a Claude Code or Codex account. The full walkthrough, with troubleshooting and how to remove it all, is docs/quickstart.md.

[!WARNING] This gives Loomux your Docker engine, which is root on that host. Use a machine or VM you don't mind that for.

mkdir loomux && cd loomux
curl -fsSLO https://raw.githubusercontent.com/Loomux/server/main/deploy/quickstart/compose.yaml
LOOMUX_VERSION=0.3.155    # the newest release
printf 'Choose a Loomux password: '; stty -echo; read -r PW; stty echo; echo
printf 'Router model API key: '; stty -echo; read -r KEY; stty echo; echo
HASH=$(printf '%s\n' "$PW" | docker run --rm -i ghcr.io/loomux/server:$LOOMUX_VERSION -hash-password)
umask 077
cat > .env <<EOF
LOOMUX_VERSION=$LOOMUX_VERSION
DOCKER_GID=$(stat -c %g /var/run/docker.sock)
LOOMUX_AUTH_PASSWORD_HASH='$HASH'
LOOMUX_MASTER_KEY=$(head -c 32 /dev/urandom | base64)
LOOMUX_ROUTER_PRIMARY_PROVIDER=anthropic
LOOMUX_ROUTER_PRIMARY_MODEL=claude-haiku-5-5
LOOMUX_ROUTER_PRIMARY_API_KEY=$KEY
EOF
unset PW KEY HASH
docker compose up -d

Loomux starts at http://localhost:8080 and creates one machine, dev, pulling the 2 GB agent image. Once Machines shows dev running, sign the agent in once:

docker exec -it $(docker ps -qf label=loomux.io/target-name=dev) claude auth login

Open the link, approve, then paste the code once and press Enter: it doesn't show as you paste.

Then start a conversation: "In a new workspace called hello on dev, create hello.txt containing "hi"." To watch the agent work, docker exec -it $(docker ps -qf label=loomux.io/target-name=dev) tmux -L loomux attach.

Your own servers over SSH, or Kubernetes: Installing Loomux.

How it compares

  • Claude Code's Remote Control, the Codex app: they bring one agent session to the vendor's app, through the vendor's service. Loomux runs on your hardware, routes one conversation across many machines and both CLIs, and can create the machines.
  • Remote-control wrappers such as Happy: they wrap the CLI and relay it to a phone app. Loomux leaves the CLI untouched in tmux, and adds deciding where work goes.
  • tmux dashboards and session managers: they show and drive the sessions you start. Loomux also starts them, on the machine the conversation calls for, and keeps the conversation's history.
  • Coder, Codespaces and other dev-environment platforms: they make the machines. Loomux makes them too, on a much smaller scale, but is mostly about the agents running on them.

Security

Loomux v1 is single-user: one password protects everything. Whoever logs in, or holds a session token, can:

  • start agents and run shell commands on every machine you registered, as that machine's user;
  • create and destroy machines through the plugins. The Docker plugin uses its Docker engine, which is root on that host.

So don't expose it to the internet as it is. Keep it on localhost, a VPN or a tailnet, or put an authenticating proxy with multi-factor login in front: Loomux has no MFA of its own.

What else to know:

  • Logins. The password is a bcrypt hash; failed logins back off. A login gets a bearer token that stays valid for 30 days after its last use and 90 days at most (LOOMUX_SESSION_TTL, LOOMUX_SESSION_MAX_AGE). Settings → Devices lists them and logs any one out.
  • Agents run with your accounts, on your machines. Each agent is the real Claude Code or Codex CLI, signed in with your account (or given a key from the vault), running as the machine's user. Their default permission modes are Claude Code's --permission-mode auto (its classifier lets routine edits and commands through and stops risky ones for approval, which Loomux shows you) and Codex's --ask-for-approval on-request --sandbox workspace-write. A machine can be set stricter (permission_mode); Loomux never uses a bypass mode.
  • Machines are not a network sandbox. A Docker machine reaches whatever its host reaches, LAN and tailnet included. A Kubernetes machine gets internet egress unless you ask for none.
  • The router model sees what you send. Every chat message goes to the router-model provider you configure, and so does the agents' output, as the machine's relay says: all of it with full (the default), only each agent's final message with last_message, nothing with none (the default only for a machine whose purpose is work). Pick a provider you're comfortable with.
  • Credentials. API keys and tokens in the vault, plugin secrets and the machines' SSH keys are encrypted with AES-256-GCM under LOOMUX_MASTER_KEY, each bound to its record and scope (AEAD additional data). A credential is handed to the agent's environment at launch, so the agent can read it. Known values are redacted from what Loomux relays and stores, as a best effort, not a guarantee.
  • What is checked. SSH host keys are pinned: scanned and confirmed by you for your own hosts, generated and pinned before a machine a plugin makes exists. The web client is served with a strict Content Security Policy and X-Frame-Options: DENY, and HSTS behind a TLS proxy that sets X-Forwarded-Proto: https. The server and agent images carry GitHub build-provenance attestations: gh attestation verify oci://ghcr.io/loomux/server:X.Y.Z -R loomux/server.
  • Logs never contain message text, but error text is logged as it is, and can name hosts, users and paths.

Report a vulnerability privately, as SECURITY.md describes; please don't open a public issue.

Documentation

Quickstart one Docker host, a machine Loomux creates
Installing a real deployment: secrets, configuration, TLS in front, checks
Your own hosts, SSH preparing a machine Loomux reaches over SSH
Plugins machines on Docker or Kubernetes
Configuration every environment variable, the image, health probes, metrics
Operations, backup and restore upgrades, rotation, restores
Design how it works and why, decision by decision

Project

Repository What it is
loomux/server loomuxd: the API, routing, the agents' tmux sessions, plugins, the images
loomux/web the web client, served by loomuxd
loomux/tui loomux, the terminal client (in progress, not usable yet)

Each directory of this repository is a component of the design, with a README saying what belongs there. Contributing: CONTRIBUTING.md. License: MIT.

Directories

Path Synopsis
Package agents holds the agent-type adapters: what Loomux knows about launching each supported agent CLI (design spec §6 — "each registered agent-type supplies a launch command template and a completion-detection adapter").
Package agents holds the agent-type adapters: what Loomux knows about launching each supported agent CLI (design spec §6 — "each registered agent-type supplies a launch command template and a completion-detection adapter").
api
Package api is Loomux's client-facing HTTP surface (design spec §9, §10 axis 1): a versioned /api/v1/...
Package api is Loomux's client-facing HTTP surface (design spec §9, §10 axis 1): a versioned /api/v1/...
apitest
Package apitest runs a real api.Server for tests in another module (LOOM-270, docs/design/tui-client-design.md "How it pins and tests against the server's API").
Package apitest runs a real api.Server for tests in another module (LOOM-270, docs/design/tui-client-design.md "How it pins and tests against the server's API").
Package app is Loomux's composition root: it wires the workspace registry, TargetExecutor, orchestrator, completion detection, credential vault, and router dispatch pipeline (design spec §2-§7) into a runnable App with a single Dispatch operation.
Package app is Loomux's composition root: it wires the workspace registry, TargetExecutor, orchestrator, completion detection, credential vault, and router dispatch pipeline (design spec §2-§7) into a runnable App with a single Dispatch operation.
cmd
loomux-plugin-fake command
loomux-plugin-fake is the fake plugin's executable (LOOM-178): a loomux-plugin/1 plugin with nothing behind it, for the host's tests and the conformance suite.
loomux-plugin-fake is the fake plugin's executable (LOOM-178): a loomux-plugin/1 plugin with nothing behind it, for the host's tests and the conformance suite.
loomux-routereval command
loomux-routereval scores a router tier on the routing-evaluation fixtures (LOOM-187): accuracy, latency, tokens and cost.
loomux-routereval scores a router tier on the routing-evaluation fixtures (LOOM-187): accuracy, latency, tokens and cost.
loomuxd command
Command loomuxd is the Loomux server process: a thin wrapper around app.Build's fully wired domain layer and api.NewServer's client-facing HTTP surface (design spec §9, §10 axis 1, LOOM-9).
Command loomuxd is the Loomux server process: a thin wrapper around app.Build's fully wired domain layer and api.NewServer's client-facing HTTP surface (design spec §9, §10 axis 1, LOOM-9).
Package completion implements the real tiered CompletionDetector (design spec §5) behind orchestrator.CompletionDetector: tiers 1+2 (native hook / prompt-engineered self-report) share one marker-watching mechanism (marker.go); tier 3 (idle-time heuristic, the true last resort) polls a task's pane for CapturePane output going quiet (idle.go).
Package completion implements the real tiered CompletionDetector (design spec §5) behind orchestrator.CompletionDetector: tiers 1+2 (native hook / prompt-engineered self-report) share one marker-watching mechanism (marker.go); tier 3 (idle-time heuristic, the true last resort) polls a task's pane for CapturePane output going quiet (idle.go).
Package credentials implements the "everything else" half of design spec §7's hybrid credential model: GitHub/GitLab PATs, MCP tokens, and custom API keys, resolved with workspace/agent-type scoping precedence on top of the vault registry.Store owns (§8 groups the registry tables and the credential vault under one storage interface).
Package credentials implements the "everything else" half of design spec §7's hybrid credential model: GitHub/GitLab PATs, MCP tokens, and custom API keys, resolved with workspace/agent-type scoping precedence on top of the vault registry.Store owns (§8 groups the registry tables and the credential vault under one storage interface).
Package dispatch runs chat dispatches as jobs that outlive the HTTP request which submitted them (LOOM-80, design spec docs/design/async-dispatch-design.md).
Package dispatch runs chat dispatches as jobs that outlive the HTTP request which submitted them (LOOM-80, design spec docs/design/async-dispatch-design.md).
internal
health
Package health implements Loomux's deep health checks (LOOM-105).
Package health implements Loomux's deep health checks (LOOM-105).
metrics
Package metrics owns Loomux's Prometheus instrumentation.
Package metrics owns Loomux's Prometheus instrumentation.
retention
Package retention deletes rows the server no longer needs once they are old enough (LOOM-193, docs/design/retention-proposal.md): sessions a while after they expired, finished dispatches, resolved confirmations, and ended task holds (LOOM-263).
Package retention deletes rows the server no longer needs once they are old enough (LOOM-193, docs/design/retention-proposal.md): sessions a while after they expired, finished dispatches, resolved confirmations, and ended task holds (LOOM-263).
tmuxtest
Package tmuxtest gives each test a tmux server of its own (LOOM-210).
Package tmuxtest gives each test a tmux server of its own (LOOM-210).
Package notify tells the user about work that finished while they weren't looking (LOOM-102): a turn done, failed, or stopped on a prompt only they can answer.
Package notify tells the user about work that finished while they weren't looking (LOOM-102): a turn done, failed, or stopped on a prompt only they can answer.
Package orchestrator wires the workspace registry (registry.Store) and TargetExecutor together into task lifecycle management: launching a task, sending follow-up input, tearing a task down, and the takeover/release handshake.
Package orchestrator wires the workspace registry (registry.Store) and TargetExecutor together into task lifecycle management: launching a task, sending follow-up input, tearing a task down, and the takeover/release handshake.
detectortest
Package detectortest provides a trivial CompletionDetector stand-in for tests: ManualDetector.Wait blocks until Signal is called for the same task, or the context is done.
Package detectortest provides a trivial CompletionDetector stand-in for tests: ManualDetector.Wait blocks until Signal is called for the same task, or the context is done.
Package plugins is the host side of Loomux's plugin system (LOOM-178, docs/design/target-providers.md §1): the manifest, the catalog of available plugins, the supervisor of a running one, and the manager that installs, configures and runs them.
Package plugins is the host side of Loomux's plugin system (LOOM-178, docs/design/target-providers.md §1): the manifest, the catalog of available plugins, the supervisor of a running one, and the manager that installs, configures and runs them.
attest
Package attest verifies plugin executables for loomuxd (LOOM-218): the plugins.Verifier the catalog asks about plugins from the plugin directory.
Package attest verifies plugin executables for loomuxd (LOOM-218): the plugins.Verifier the catalog asks about plugins from the plugin directory.
fake
Package fake is a plugin for tests (docs/design/target-providers.md §12): no infrastructure behind it, and a configuration that scripts how it behaves, so the host's supervisor, manager and API can be exercised against a real subprocess.
Package fake is a plugin for tests (docs/design/target-providers.md §12): no infrastructure behind it, and a configuration that scripts how it behaves, so the host's supervisor, manager and API can be exercised against a real subprocess.
manifeststamp command
Command manifeststamp writes a release into plugin manifests at build time (LOOM-194; docs/release/versioning.md, "Images"):
Command manifeststamp writes a release into plugin manifests at build time (LOOM-194; docs/release/versioning.md, "Images"):
plugintest
Package plugintest is the conformance suite a loomux-plugin/1 plugin must pass (docs/design/target-providers.md §12): the analogue of registry/storetest and targets/executortest.
Package plugintest is the conformance suite a loomux-plugin/1 plugin must pass (docs/design/target-providers.md §12): the analogue of registry/storetest and targets/executortest.
protocol
Package protocol is the loomux-plugin/1 protocol's vocabulary: the method names the host calls and the parameter and result types they carry (docs/design/target-providers.md §1.3).
Package protocol is the loomux-plugin/1 protocol's vocabulary: the method names the host calls and the parameter and result types they carry (docs/design/target-providers.md §1.3).
rpc
Package rpc is the wire layer of loomux-plugin/1 (docs/design/target-providers.md §1.3): JSON-RPC 2.0 messages in Content-Length frames, the LSP convention, over a subprocess's stdio or a unix socket.
Package rpc is the wire layer of loomux-plugin/1 (docs/design/target-providers.md §1.3): JSON-RPC 2.0 messages in Content-Length frames, the LSP convention, over a subprocess's stdio or a unix socket.
sdk
Package sdk is what a plugin's main calls to speak loomux-plugin/1 (docs/design/target-providers.md §1.3): implement Plugin, hand it to Main, and the plugin serves stdio when started with no arguments or a unix socket with --listen <path> (the sidecar form).
Package sdk is what a plugin's main calls to speak loomux-plugin/1 (docs/design/target-providers.md §1.3): implement Plugin, hand it to Main, and the plugin serves stdio when started with no arguments or a unix socket with --listen <path> (the sidecar form).
Package providers is the host side of the target-provider capability (LOOM-178, docs/design/target-providers.md §1.9, §2): it asks a plugin for a machine and turns it into an ordinary managed remote target, with a Loomux SSH key authorized on it and a host key the host generated and pinned before the machine existed.
Package providers is the host side of the target-provider capability (LOOM-178, docs/design/target-providers.md §1.9, §2): it asks a plugin for a machine and turns it into an ordinary managed remote target, with a Loomux SSH key authorized on it and a host key the host generated and pinned before the machine existed.
Package registry defines the workspace registry's domain types and the Store interface that backend implementations satisfy.
Package registry defines the workspace registry's domain types and the Store interface that backend implementations satisfy.
sqlite
Package sqlite is a registry.Store implementation backed by SQLite via the pure-Go modernc.org/sqlite driver (no cgo), so the server can still build as a single static binary.
Package sqlite is a registry.Store implementation backed by SQLite via the pure-Go modernc.org/sqlite driver (no cgo), so the server can still build as a single static binary.
storetest
Package storetest is the backend-conformance test suite for registry.Store.
Package storetest is the backend-conformance test suite for registry.Store.
Package router wires the workspace registry, orchestrator, completion detection, and credential vault together into the dispatch pipeline (design spec §2, §6): given an incoming chat message, decide which workspace to use (or provision a new one), launch or provision via the orchestrator, and relay the result back.
Package router wires the workspace registry, orchestrator, completion detection, and credential vault together into the dispatch pipeline (design spec §2, §6): given an incoming chat message, decide which workspace to use (or provision a new one), launch or provision via the orchestrator, and relay the result back.
llmrouter
Package llmrouter is a real, LLM-backed implementation of router.RoutingModel (design spec §6): a generic OpenAI-Chat-Completions -compatible client parameterized by a primary and an optional escalation tier, so swapping vendor/model is a config change, not a code change.
Package llmrouter is a real, LLM-backed implementation of router.RoutingModel (design spec §6): a generic OpenAI-Chat-Completions -compatible client parameterized by a primary and an optional escalation tier, so swapping vendor/model is a config change, not a code change.
llmrouter/llmroutertest
Package llmroutertest has fakes of the router model's endpoints for tests and offline evaluation runs: no network, no keys.
Package llmroutertest has fakes of the router model's endpoints for tests and offline evaluation runs: no network, no keys.
llmrouter/routereval
Package routereval scores one router tier against a fixed set of routing and relay decisions (LOOM-187): accuracy, latency, tokens and cost, live against any configured endpoint or offline against a fake.
Package routereval scores one router tier against a fixed set of routing and relay decisions (LOOM-187): accuracy, latency, tokens and cost, live against any configured endpoint or offline against a fake.
routertest
Package routertest provides a deterministic RoutingModel stand-in for tests.
Package routertest provides a deterministic RoutingModel stand-in for tests.
Package targets defines the TargetExecutor interface — the mechanism that runs tmux operations against a registry.Target, either locally or over SSH.
Package targets defines the TargetExecutor interface — the mechanism that runs tmux operations against a registry.Target, either locally or over SSH.
executortest
Package executortest is the shared behavioral test suite for targets.TargetExecutor.
Package executortest is the shared behavioral test suite for targets.TargetExecutor.
sshtest
Package sshtest is test-only infrastructure: a minimal in-process SSH server for exercising the real ssh client binary against a loopback target, satisfying the design spec's requirement that TargetExecutor be testable against a local/loopback SSH target.
Package sshtest is test-only infrastructure: a minimal in-process SSH server for exercising the real ssh client binary against a loopback target, satisfying the design spec's requirement that TargetExecutor be testable against a local/loopback SSH target.
Package version holds loomuxd's own release version (design spec §10 axis 4) — independent of the API version (axis 1, /api/v1/...): a server patch release doesn't force an API version bump, only a breaking API change does.
Package version holds loomuxd's own release version (design spec §10 axis 4) — independent of the API version (axis 1, /api/v1/...): a server patch release doesn't force an API version bump, only a breaking API change does.
Package webbundle keeps the web client loomuxd serves current without rebuilding or redeploying its image (LOOM-118).
Package webbundle keeps the web client loomuxd serves current without rebuilding or redeploying its image (LOOM-118).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL