scode SSH Delegate
This skill declares remote capacity; it does not decide whether or what to delegate. Another active skill or the user's instructions own that decision and all task decomposition. This skill only establishes which workers are available, the environment they provide, and the trust boundaries that apply if another workflow uses them.
Four kinds of worker exist. SSH hosts are machines the user already runs and reaches over SSH; registering them is
described in this file. Sprites are Fly.io sandboxes driven through the sprite CLI, and tensorlake sandboxes are
Tensorlake microVMs driven through the tl CLI; for both, the user either names existing instances or lets this session
create them up to a budget. Boat sandboxes are full VMs driven through the boat CLI, and only a budget exists for
them. All kinds end up in the same worker pool with the same trust rules.
This file is deliberately limited to what every invocation needs. Companion files next to it are read on demand so that a session which never touches sprites or sandboxes, or never actually delegates, does not pay for that text:
sprites.md— read it before classifying any argument whenever the invocation mentions sprites in any form: named ones (sprites foo1 foo2, "use the sprites ..."), a budget (sprites:3, "up to N sprites"), the singular, or a trailing remark such as "they're sprites". It covers sprite registration, the Fly.io image, bootstrap, and the lifecycle rules that keep sprites cheap. A sprite mention with neither names nor a number is not a registration; ask the user which they meant. Do not register or touch a sprite without having read the file.tensorlake.md— read it before classifying any argument whenever the invocation mentions tensorlake sandboxes in any form: named ones (sbx foo1 foo2, "use the tensorlake sandboxes ..."), a budget (sbx:3, "up to N tensorlake sandboxes"), or a trailing remark such as "they're tensorlake sandboxes". It covers sandbox registration, the stock image, bootstrap, snapshot templates, and the lifecycle rules that keep sandboxes cheap. The same neither-names-nor-a-number rule applies: ask rather than guess. Do not register or touch a tensorlake sandbox without having read the file.boat.md— read it before classifying any argument whenever the invocation hasboatas a whole argument or aboat:prefix (boat 10,boat:10), or talks about boat sandboxes in natural language ("up to N boat sandboxes"). A hostname that merely contains "boat" is not such a mention. It covers budget registration, sizes, credentials, transfer, and the lifecycle rules that keep boat's per-start pricing cheap. Do not register or touch a boat sandbox without having read the file.using-workers.md— read it before the first command, transfer, install, or credential touches any registered worker, whoever asked for that: another skill, the user's instructions, or a follow-up request in the same conversation. It covers what may be installed on a worker, which credentials may be transferred and how, and how source and results cross the boundary. The rsync transport recorded at registration is not permission to skip it.
After compaction or resume, if the retained context says a sprite, sandbox, or boat budget or such workers were
registered, re-read sprites.md, tensorlake.md, or boat.md before the next operation on them; if workers were in
use, re-read using-workers.md before the next delegation.
Trust rules that always apply
The full rules are in using-workers.md, but these hold from the moment a worker is registered and are repeated here so
that no session can act on a worker without having seen them:
- Never forward the SSH agent or copy home-directory state to a worker. The only credentials that may move are one agent
credential for the selected provider (
~/.codex/auth.json,CLAUDE_CODE_OAUTH_TOKEN, orANTHROPIC_API_KEY), and the transfer is announced. - A worker has no GitHub, cloud, or registry credentials and must not clone, fetch, pull, or push a private remote. Source is pushed from the local checkout.
- Results come back as a small, explicitly selected set of files into local staging, never as a mirror of the remote workspace.
Register SSH hosts
Treat values following the invocation that are not a sprite, tensorlake, or boat form as SSH targets. Commas are
optional separators, so $scode-ssh-delegate foo and $scode-ssh-delegate foo, bar, baz are complete requests. SSH
uses the current Unix username unless the user supplies another normal SSH target form. Do not require the user to say
that the hosts are available or repeat them in a later task.
Immediately connect to every supplied target and collect only:
- The reported hostname.
IDandVERSION_IDfrom/etc/os-release.- The logical CPU count from
nproc. - Total and available memory from
free.
Use BatchMode=yes and ConnectTimeout=10 and never weaken host-key verification: plain ssh keeps its normal
known_hosts checking, and tailscale ssh checks against the key advertised by the tailnet. Reject unreachable
targets, targets whose SSH argument begins with -, and every OS other than ID=ubuntu with VERSION_ID=26.04. Report
each failure independently. Both supported CLIs currently require at least 4 GiB of RAM, so reject hosts below that
total as well. Retain each successful target, together with the transport selected for it below, in the current
conversation's available worker pool.
Transport selection
The user supplies a plain [user@]host target and never says which transport to use. Prefer tailscale ssh when it
applies, because it verifies the server's host key against the key the Tailscale coordination server advertises for that
node, so a fresh controlling machine with an empty known_hosts connects without a trust-on-first-use prompt and
without weakening StrictHostKeyChecking. Plain ssh remains the path for everything else.
Decide per target, in this order:
- If
tailscaleis onPATHandtailscale ip HOSTsucceeds for the host part of the target, the host is a tailnet peer. A nonzero exit for any reason, including a stopped or logged-out daemon, means "not a peer" for this purpose. Attempttailscale ssh TARGET -o BatchMode=yes -o ConnectTimeout=10 'COMMAND'first. The options must follow the target: everything after the target is passed to the systemssh, and options placed before it make the wrapper print its usage instead of connecting. - If that attempt fails because no host key is known (stderr says
No ... host key is known for HOSTand thenHost key verification failed, where HOST is the MagicDNS name rather than what the user typed), the peer is on the tailnet but is not running Tailscale SSH. Retry once with plainssh -o BatchMode=yes -o ConnectTimeout=10 TARGET 'COMMAND'and its normalknown_hostschecking. If that retry also fails host-key verification (the key is not inknown_hostsandBatchModeforbids the prompt), reject the target and tell the user to connect once manually; do not add the key on their behalf. - A changed-key warning (
REMOTE HOST IDENTIFICATION HAS CHANGED) is a security signal, not a missing Tailscale SSH server. Reject the target, report the warning verbatim, and do not retry over plainssh. Likewise do not retry plainsshafter a timeout or authentication failure fromtailscale ssh; that failure is the result. - If
tailscaleis absent or the host is not a peer, use plainsshdirectly.
NOTE: being a tailnet peer does not mean the node runs Tailscale SSH, and there is no cheap way to tell beforehand.
tailscale status --json and tailscale whois do not expose advertised SSH host keys, and tailscale debug netmap
needs root or operator rights. The attempt itself is the check.
Record the transport that succeeded for each accepted worker as the exact command prefix to reuse: either tailscale ssh TARGET -o BatchMode=yes or ssh -o BatchMode=yes TARGET. Every later command and transfer to that worker uses that
prefix; for rsync that means -e 'tailscale ssh' or -e 'ssh -o BatchMode=yes', which both work unchanged because the
wrapper passes the remote command through to ssh. Transport selection happens only during registration (and again on a
later reprobe of the same target); do not re-run it on each use.
Do not inspect commands, packages, Codex or Claude authentication, project dependencies, or other machine state during this initial inventory. Do not bootstrap a host merely because the user declared it. A later invocation adds successful targets; reprobing a target refreshes its inventory, and a failed reprobe removes it.
Sprites, tensorlake sandboxes, and boat sandboxes, in one paragraph
Registration and everything else about sprites is in sprites.md, about tensorlake sandboxes in tensorlake.md, and
about boat sandboxes in boat.md; this is only so that an SSH-only reader knows what the forms mean. Named sprites and
sandboxes are borrowed: the session runs work on them and never destroys them. Boat has no named form. A budget
(sprites:N, sbx:N, or boat:N, which can also be written boat N) is a concurrency cap, not a consumable count: at
most N owned instances may exist at the same time, destroying one frees its slot, and there is no limit on how many the
session creates over its lifetime. sbx:6 after six create-and-destroy cycles is not "used up"; it still allows six
more alive at once. Boat adds one constraint of its own: because every boat start counts against the plan's start
allowance, boat.md has the session reuse its boat sandboxes and create one only when the start is free. A budget never
touches instances the session did not create. Nothing is installed, transferred, or run on any worker at registration.