/fleet:reach [relay]from fleet
Reaches another Claude Code lane on any machine (WSL or Windows, local or remote) to run prompts, queries, or start sessions. Use for cross-machine or cross-OS agent communication.
Ships in fleet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A lane is one Claude Code install with its own sign-in: the WSL distro or native Windows, on each machine.
~/.config/fleet/FLEET.md before composing anything. It holds the real aliases, accounts
and paths for this machine; the commands below use placeholders. Done when you can name the
target host and lane and see its reach entries (alias, port, account, shell).<agent> is the headless turn from Verbs: claude in a WSL lane, <claude-exe> in a
Windows lane. "Tested" means a real run of that exact shape; what each run showed is in
reference/relay.md. The R2 and R3 runs passed the prompt
as an argument; their stdin form below has not been re-probed.
| # | From | To | Command shape | Status |
|---|---|---|---|---|
| R0 | any | same lane | Built-in ListAgents / SendMessage. Not this skill | n/a |
| R1 | WSL | this machine, Windows | cd <win-dir> && <claude-exe> <agent-args> "<prompt>" < /dev/null | tested: script (powershell.exe), list, multi-turn, message a -n receiver |
| R2 | WSL | other machine, WSL | printf '%s\n' '<prompt>' | <ssh> <wsl-alias> 'claude <agent-args>' | tested: script, multi-turn, stream-json, --bg, message an interactive session and a -p receiver across accounts |
| R3 | WSL | other machine, Windows | printf '%s\n' '<prompt>' | <ssh> <wsl-alias> 'cd <win-dir> && <claude-exe> <agent-args>' | reaches claude.exe; needs /login at that machine's console |
| R4 | Windows | this machine, WSL | wsl.exe -d <distro> --cd /tmp --exec <shell> -lc 'claude <agent-args> "<prompt>" < /dev/null' | tested: script from a native-Windows claude.exe (its Bash tool, Git Bash); list |
| R5 | Windows | other machine, WSL | printf '%s\n' '<prompt>' | ssh.exe <wsl-alias> 'claude <agent-args>' | untested from a Windows origin (same hop as R2) |
| R6 | Windows | other machine, Windows | printf '%s\n' '<prompt>' | ssh.exe <wsl-alias> 'cd <win-dir> && <claude-exe> <agent-args>' | untested from a Windows origin (same hop as R3) |
Over SSH a -p turn's prompt goes on stdin, and the quoted remote command carries only the flags,
so no shell on either host parses prompt text. Never add ssh -n to an SSH row: it replaces stdin
with /dev/null and drops the prompt. The local hops (R1, R4) keep the prompt as the last
argument. A verb with no <prompt> drops the printf on an SSH row and the quoted prompt on R1
and R4. --bg is not -p and takes its prompt as an argument, so a background session's prompt
stays inside the remote command. In the tables here and in FLEET.md, \| is an escaped |: type a bare |.
A script with no agent goes over the same hop with the command in place of the claude part; on
R1 that is powershell.exe -NoProfile -Command '<cmd>' from a Windows-side directory. A Windows
script on another machine goes over port 22 instead: <ssh> <win-alias> '<pwsh command>' (see
Port 22).
Placeholders, each filled from FLEET.md or a probe, never guessed:
<ssh>: the Windows OpenSSH client. ssh.exe from Windows; from WSL,
/mnt/c/Windows/System32/OpenSSH/ssh.exe, because the distro holds no key.<wsl-alias> / <win-alias>: the target's wsl-shell (port 2222) and windows-shell (port 22)
aliases.<claude-exe>: /mnt/c/Users/<user>/.local/bin/claude.exe, by absolute path.<win-dir>: a scratch directory under /mnt/c/Users/<user>/ (claude.exe needs a Windows-side
working directory), never a repository that defines the fleet's accounts or firewall./mnt/c paths as given: never check them with file tools (Read, Glob, Grep),
and never ask a subagent's brief to. The hop check in
Verify the hop is what proves them.<distro>: from wsl.exe -l -q. <shell>: the distro account's login shell, so claude is on
PATH.Per-route detail, the receiver's nested quoting, reply patterns, background sessions, and the mechanisms not used here (Remote Control, cloud sessions, Channels) are in reference/relay.md.
Converging dotfiles on any fleet lane is not a route in this matrix: run fleet-converge <lane>,
by its bare name. It does not prompt because dotfiles renders an exact allow rule for that command
on every lane; no Bash(ssh …) rule is added, and the posture below stands for every other verb.
fleet-converge checks and how it reaches each lane, read dotfiles
docs/design-decisions.md, "Converging a lane: fleet-converge".Run the row with hostname && before the agent, -p as <agent-args> and echo ok as
<prompt>, for example printf '%s\n' 'echo ok' | <ssh> <wsl-alias> 'hostname && claude -p': the
hostname proves which machine answered, ok that its Claude is signed in. A Windows lane answering with an
expired-OAuth-session authentication error routed correctly and is signed out: someone runs
/login at that machine's console (or over RDP). Nothing remote fixes it, and no credential
travels in a prompt.
Each verb fills <agent-args> and <prompt> in a matrix row. Every verb but the first starts an
agent, and each agent turn costs real usage, even a one-line turn
(Manage costs: Track your costs; the Cost
row of reference/relay.md § Verified behavior holds the
dated measurement and how to re-measure it). When a script can do the job, run the script.
| Verb | <agent-args> | <prompt> | Status |
|---|---|---|---|
| Run a script | none: the command itself replaces claude ... over the same hop | none | tested on R1, R2, R4; port 22 untested |
| Prompt | -p | the task | tested on R1, R2, R4 |
| Multi-turn | -p --session-id <uuid>, then -p --resume <uuid> against the same lane | each turn's prompt | tested on R1, R2 |
| One open pipe | -p --input-format stream-json --output-format stream-json --verbose | none: user messages as NDJSON on stdin | tested on R2 |
| List sessions | -p | List the sessions you can reach | tested on R1, R4 |
| Message a session | -p | SendMessage to <name>: <text> | tested on R1, R2 |
| Named receiver | -p -n <name> --settings '{"crossSessionInbound":"accept"}' | the standing instructions | tested on R1, R2 |
| Background session | --bg --name <name> "<prompt>", not -p, with < /dev/null on an SSH row; manage with claude agents --json --all, stop <id>, rm <id> | none: it is in <agent-args> | tested on R2, trusted directory only |
notify_when_idle notice from a -p
sender: in our probe it never reached the sender
(reference/relay.md § Verified behavior). Send the
message, then poll claude agents --json in that lane, or --resume the receiver or read its
output.
-p session can receive, fetch
Get a notice when another session goes idle
and Non-interactive sessions
live.--resume survives a disconnect. --resume ids belong to the lane that
made them, so resume against the same row. --session-id picks the id up front, so nothing
parses the first turn's output. Generate no id in this session: a command you hand over keeps
<uuid> for whoever runs it to fill, and a turn you run yourself can start with
--output-format json and resume with the session_id it returns (see "Parse the JSON" in
Gotchas). Say with the handed-over commands that the id exists only on that lane's
machine and account, so every follow-up goes to the same row.claude logs and claude attach by the id from claude agents --json --all (bare --json
lists only active sessions); pass a name only after checking the lane's version against the CLI
reference. logs prints raw TUI output, so read a reply from the transcript (--resume <id>).
-p receiver needs crossSessionInbound: accept. For a session that must stay up, use a
background session, not a -p receiver. Give either one standing instructions as its prompt:
what to do with each message and when to stop. Delivery rules and the pointer are in
reference/relay.md.
-p run ends after its turn, fetch
Run Claude Code programmatically: Background tasks at exit
live.--bare for prompts, never for a receiver: a bare session cannot receive messages or be
listed.-p --remote-control does not connect. Keep it out of
headless recipes.--bare and Remote Control bullets rest on our probes and the flag
behavior in reference/relay.md § Verified behavior; when
one stops holding, fetch
Control inbound messages,
Non-interactive sessions,
Start faster with bare mode
and CLI flags live.Each lane signs into its own claude.ai account so one lane's usage never draws down another's (on the desktop, WSL and Windows differ; the laptop's WSL lane uses a third). So:
ListAgents shows only its own lane.ListAgents shows nothing remote, even with Remote Control connected.The peer tools are same-lane only, and no setting widens them; every other route starts a turn inside the target lane. Do not propose sharing an account: the split is the decision.
ssh-admin is a separate Windows account with no Claude sign-in and no DPAPI. Use port 22 for pwsh
scripts only, with pwsh quoting; anything needing the console user's credentials goes through the
on-demand tasks FLEET.md lists.
Bash(ssh ...) allow rule anywhere in this fleet, and adding one is not the fix for a
prompt. If asked to stop the prompting, say what the rule would cost and decline.bypassPermissions.wsl --shutdown on a target, and never run wsl -d on a target's drift-convergence path:
both take the distro out from under whatever else uses it. The one exception is a start
fleet-converge makes itself, under the guard its pointer names; never run wsl -d on its
behalf.| Neighbor | Owns |
|---|---|
| This skill | Every lane other than this session's: the other lane on this machine, and both lanes on other machines |
Built-in ListAgents / SendMessage | Sessions in this lane, under this lane's account |
| Built-in Remote Control | Human use of a lane's session from a phone or the web, under that lane's account. Not agent-to-agent across accounts |
session-flow:continue-in-background | A detached session in THIS lane |
session-flow:orchestrate | Delegation inside one session, to subagents |
repo-fleet-hygiene:audit | Fleets of REPOSITORIES. Same word, different subject |
~/.ssh/config is wired to.
Git Bash's MSYS ssh reaches no agent and fails with Permission denied (publickey), which reads
like a key problem and is not one.claude -p turn a closed stdin. Over SSH the piped prompt is stdin, and it ends
when printf does. On R1 and R4 redirect < /dev/null. A -p run reads stdin as its input, so
with no prompt argument the piped text is the prompt: see "Pipe data through Claude" and the
stdin-only example under "Customize the system prompt" in
Run Claude Code programmatically,
and the piped-content row of CLI commands.<prompt>. Every SSH row single-quotes the prompt in
printf '%s\n' '<prompt>', and R4 single-quotes the whole command, on the LOCAL shell, so a '
in the prompt ("what's") closes that quote early. The rule follows the origin shell, not the
lane:
'
with '\'', or wrap the prompt argument (on R4, the command) in $'...' and write \'. Doubling ('') silently drops the
apostrophe here: 'what''s' arrives as whats.-p ''...'') and
write an apostrophe as ''\''''. Never use -p "..." from PowerShell, with or without a
doubled '' apostrophe. This form ran correctly on every version probed. Run the SSH rows
from bash, zsh or Git Bash, whose printf is a builtin.
wsl.exe --exec, not --. The quoting rules above assume --exec. For what each option
does, run wsl.exe --help on that machine, as
Basic commands: Help command
directs (the page has no section of its own for --exec).cmd.exe /c prints nothing inside an sshd session and reads
as "interop is broken" when it is not; run the .exe by absolute path.grep '^{' | jq -r .session_id. What a
session-end hook can print is in Hooks: SessionEnd.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub melodic-software/claude-code-plugins --plugin fleetOther plugins' skills for the same job