Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changes/fleet/feat-16541-reach-relay-profile-7c41d2e8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
bump: minor
---

### Added

- The reach skill starts a relay turn or session in a WSL lane in the plugin profile the task names: it finds the target's `profiles.mjs` through `claude plugin list --json`, runs `launch --unattended` there with the relay's own settings in `--with`, and starts `claude` with the printed command. With no profile named, no plugin-profiles on the target, or a Windows lane, it starts as before and says the profile was not applied.
- The reach skill's prompt line says to name the session that holds a PR, issue or branch in the prompt, and never to tell the target to take the work over on its own judgment.
28 changes: 28 additions & 0 deletions plugins/fleet/evals/reach-start-in-profile/case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
schema_version: "1.1"
name: 'reach-start-in-profile'
context:
scaffold_script: scaffold.sh
graders:
- name: 'finds-profiles-script'
type: 'regex'
pattern: 'ssh\.exe\s+laptop-wsl\s+''?[^''\n]*\bclaude\s+plugin\s+list\s+--json'
flags: 'i'
target: 'last_message'
- name: 'launch-unattended'
type: 'regex'
pattern: 'profiles\.mjs\S*\s+launch\s+["'']?build\b[^\n]*--unattended'
flags: 'i'
target: 'last_message'
- name: 'settings-through-with'
type: 'regex'
pattern: 'profiles\.mjs\S*\s+launch\b[^\n]*--with\s[^\n]*crossSessionInbound'
flags: 'i'
target: 'last_message'
- name: 'starts-with-printed-command'
type: 'llm'
criteria: 'Starts the laptop session with the command `profiles.mjs launch` prints (its `command` or `argv`) in place of a plain `claude`, and says that when launch exits 1 for a missing required tool nothing is started and the reason is reported'
focus: 'trace'
- name: 'skill-fired'
type: 'tool_used'
tool: 'Skill'
input_match: '"skill"\s*:\s*"(?:fleet:)?reach"'
9 changes: 9 additions & 0 deletions plugins/fleet/evals/reach-start-in-profile/prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
tags: ['reach']
allowed_tools: [Read, Glob, Grep, Skill]
expected_outcome: 'Starts a named receiver on the laptop''s WSL lane in its build plugin profile: finds profiles.mjs on the laptop through claude plugin list --json (the installPath of the enabled plugin-profiles@ entry), runs profiles.mjs launch build --folder <dir> --unattended --json there with the receiver''s crossSessionInbound settings passed through --with, and starts the receiver with the printed command in place of claude. Says that a launch refused for a missing required tool starts nothing and is reported.'
---

I'm in the desktop's WSL session (desk-01). Start a Claude session on the laptop's WSL side, in its `build` plugin profile and in `~/repos/app`, that other sessions can keep sending messages to. Give me the exact commands to run; don't run them yourself, and run no shell command to work them out.

In this session the fleet manifest is at `.config/fleet/FLEET.md` in the working directory, not under `~`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"pass": [
{
"answer": "**1. Find plugin-profiles on the laptop:**\n\n```sh\n/mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'claude plugin list --json'\n```\n\nTake the `installPath` of the enabled `plugin-profiles@` entry.",
"why": "quoted remote command"
},
{
"answer": "/mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl claude plugin list --json",
"why": "unquoted remote command"
}
],
"fail": [
{
"answer": "",
"why": "empty reply"
},
{
"answer": "claude plugin list --json",
"why": "runs locally, not on the laptop"
},
{
"answer": "/mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'node ~/.config/plugin-profiles/profiles.mjs launch build'",
"why": "guesses the script path"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"pass": [
{
"answer": "/mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'cd ~/repos/app && node <installPath>/scripts/profiles.mjs launch build --folder ~/repos/app --unattended --json --with \"{\\\"crossSessionInbound\\\":\\\"accept\\\"}\"'",
"why": "launch with --unattended"
},
{
"answer": "node ~/.claude/plugins/cache/m/plugin-profiles/1.0.0/scripts/profiles.mjs launch build --unattended --json",
"why": "resolved path"
}
],
"fail": [
{
"answer": "node <installPath>/scripts/profiles.mjs launch build --folder ~/repos/app --json",
"why": "no --unattended"
},
{
"answer": "node <installPath>/scripts/profiles.mjs apply build --unattended",
"why": "apply, not launch"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"pass": [
{
"answer": "/mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'cd ~/repos/app && node <installPath>/scripts/profiles.mjs launch build --folder ~/repos/app --unattended --json --with \"{\\\"crossSessionInbound\\\":\\\"accept\\\"}\"'",
"why": "settings merged through --with"
}
],
"fail": [
{
"answer": "node <installPath>/scripts/profiles.mjs launch build --unattended --json\nthen: <command> -p -n app-inbox --settings '{\"crossSessionInbound\":\"accept\"}'",
"why": "a second --settings on the start command, which replaces the profile's"
},
{
"answer": "node <installPath>/scripts/profiles.mjs launch build --unattended --json --with /tmp/relay.json",
"why": "--with without the receiver's setting"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"pass": [
{
"answer": [
{
"tool": "Skill",
"input": {
"skill": "fleet:reach"
}
}
],
"why": "qualified name"
},
{
"answer": [
{
"tool": "Skill",
"input": {
"skill": "reach"
}
}
],
"why": "bare name"
}
],
"fail": [
{
"answer": [],
"why": "no Skill call"
},
{
"answer": [
{
"tool": "Skill",
"input": {
"skill": "other-plugin:other-skill"
}
}
],
"why": "another skill"
},
{
"answer": [
{
"tool": "Skill",
"input": {
"skill": "fleet:reach-other"
}
}
],
"why": "a skill whose name only starts the same"
}
]
}
3 changes: 3 additions & 0 deletions plugins/fleet/evals/reach-start-in-profile/scaffold.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
bash "$(dirname "${BASH_SOURCE[0]}")/../fixtures/fleet-manifest.sh"
25 changes: 25 additions & 0 deletions plugins/fleet/evals/reach-start-without-profile/case.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
schema_version: "1.1"
name: 'reach-start-without-profile'
context:
scaffold_script: scaffold.sh
graders:
- name: 'one-shot-turn-over-wsl-hop'
type: 'regex'
pattern: '(?<!\\)\|\s*\S*ssh\.exe\s+laptop-wsl\s+''?[^''\n]*\bclaude\s+-p\b'
flags: 'i'
target: 'last_message'
- name: 'no-profile-launch'
type: 'regex'
pattern: 'profiles\.mjs\S*\s+launch\b'
flags: 'i'
match: 'not_contains'
target: 'last_message'
- name: 'says-profile-not-applied'
type: 'regex'
pattern: '\bprofile\b[^\n]{0,80}\bnot\b[^\n]{0,20}\bappl(?:y|ied)\b|\bno\b[^\n]{0,20}\bprofile\b[^\n]{0,40}\bappl(?:y|ied)\b'
flags: 'i'
target: 'last_message'
- name: 'skill-fired'
type: 'tool_used'
tool: 'Skill'
input_match: '"skill"\s*:\s*"(?:fleet:)?reach"'
9 changes: 9 additions & 0 deletions plugins/fleet/evals/reach-start-without-profile/prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
tags: ['reach']
allowed_tools: [Read, Glob, Grep, Skill]
expected_outcome: 'Names no plugin profile, so composes the one-shot headless turn over the laptop''s WSL hop as the route matrix gives it (printf ''%s\n'' ''...'' | ssh.exe laptop-wsl ''cd ... && claude -p''), runs no profiles.mjs launch, and says with the command that no plugin profile is applied.'
---

I'm in the desktop's WSL session (desk-01). Ask the laptop's Claude to list the local branches in `~/repos/app`. Give me the exact command to run; don't run it yourself, and run no shell command to work it out.

In this session the fleet manifest is at `.config/fleet/FLEET.md` in the working directory, not under `~`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pass": [
{
"answer": "printf '%s\\n' 'List the local branches.' | /mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'cd ~/repos/app && claude -p'\n\nNo plugin profile is applied.",
"why": "plain start"
}
],
"fail": [
{
"answer": "/mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'cd ~/repos/app && node <installPath>/scripts/profiles.mjs launch --unattended --json'",
"why": "runs launch with no profile named"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"pass": [
{
"answer": "```sh\nprintf '%s\\n' 'List the local branches in this repository and reply with the list.' | /mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'cd ~/repos/app && claude -p'\n```\n\nNo plugin profile is applied: you named none, so the turn starts as the route gives it.",
"why": "stdin prompt over the WSL hop"
}
],
"fail": [
{
"answer": "",
"why": "empty reply"
},
{
"answer": "/mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'cd ~/repos/app && git branch'",
"why": "a script, not the laptop's Claude"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"pass": [
{
"answer": "No plugin profile is applied: you named none.",
"why": "no ... profile ... applied"
},
{
"answer": "The turn starts without a plugin profile; the profile was not applied because none was named.",
"why": "profile ... not applied"
}
],
"fail": [
{
"answer": "printf '%s\\n' 'List the local branches.' | /mnt/c/Windows/System32/OpenSSH/ssh.exe laptop-wsl 'cd ~/repos/app && claude -p'",
"why": "command only, says nothing about the profile"
},
{
"answer": "The build profile is applied.",
"why": "claims a profile"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"pass": [
{
"answer": [
{
"tool": "Skill",
"input": {
"skill": "fleet:reach"
}
}
],
"why": "qualified name"
},
{
"answer": [
{
"tool": "Skill",
"input": {
"skill": "reach"
}
}
],
"why": "bare name"
}
],
"fail": [
{
"answer": [],
"why": "no Skill call"
},
{
"answer": [
{
"tool": "Skill",
"input": {
"skill": "other-plugin:other-skill"
}
}
],
"why": "another skill"
},
{
"answer": [
{
"tool": "Skill",
"input": {
"skill": "fleet:reach-other"
}
}
],
"why": "a skill whose name only starts the same"
}
]
}
3 changes: 3 additions & 0 deletions plugins/fleet/evals/reach-start-without-profile/scaffold.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
bash "$(dirname "${BASH_SOURCE[0]}")/../fixtures/fleet-manifest.sh"
8 changes: 7 additions & 1 deletion plugins/fleet/skills/reach/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ dated measurement and how to re-measure it). When a script can do the job, run t
| 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 |

- Give every prompt the whole task: what done looks like, and what should make it stop and report.
Nobody answers a question a headless turn asks.
Nobody answers a question a headless turn asks. When the task touches a PR, issue or branch a
session holds, get that session's name and put it in the prompt, and never tell the target to
take the work over on its own judgment.
- **Start in a profile.** When the task names a plugin profile, start the target's turn or session
in it as [reference/relay.md § Start in the target's plugin profile](reference/relay.md#start-in-the-targets-plugin-profile)
says. With no profile named, or none applied, say with the result that the profile was not
applied.
- **Query and wait has no one-turn form.** Never wait on a `notify_when_idle` notice from a `-p`
sender: in our probe it never reached the sender
([reference/relay.md § Verified behavior](reference/relay.md#verified-behavior)). Send the
Expand Down
32 changes: 32 additions & 0 deletions plugins/fleet/skills/reach/reference/relay.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plain prompt.
- [A named receiver](#a-named-receiver)
- [Multi-turn and the open pipe](#multi-turn-and-the-open-pipe)
- [Background sessions](#background-sessions)
- [Start in the target's plugin profile](#start-in-the-targets-plugin-profile)
- [Mechanisms not used here](#mechanisms-not-used-here)
- [Getting a reply back](#getting-a-reply-back)
- [Signed-out Windows lane](#signed-out-windows-lane)
Expand Down Expand Up @@ -165,6 +166,36 @@ For a session that outlives the hop, the target lane's own supervisor hosts it:
- **Pointer**: [Agent view: Limitations](https://code.claude.com/docs/en/agent-view#limitations),
fetched live.

## Start in the target's plugin profile

When the task names a plugin profile, a turn or session started in a WSL lane (R2, R4, R5) starts
in that lane's profile, through plugin-profiles' `profiles.mjs launch` on the target. Each step
runs over the row's hop; `<dir>` is the directory the session starts in.

1. Find the script: run `claude plugin list --json` on the target and take the `installPath` of
the entry whose `id` starts with `plugin-profiles@` and whose `enabled` is true. The script is
`<installPath>/scripts/profiles.mjs`.
2. Run `launch` there with `--unattended`, since nobody answers a relay start, and put the verb's
own `--settings` JSON in `--with`, so the started session carries one settings file
(`profiles.mjs` merges it into the profile's):

```console
<ssh> <wsl-alias> 'cd <dir> && node <profiles.mjs> launch <profile> --folder <dir> --unattended --json --with "{\"crossSessionInbound\":\"accept\"}"'
```

Leave out `--with` when the verb carries no `--settings`. On exit 1 (the profile switches on a
plugin missing a required tool) start nothing and report the reason it printed.
3. Start the session with the printed `command` in place of `claude`, and the verb's other
arguments after it, without its `--settings`:

```console
printf '%s\n' '<prompt>' | <ssh> <wsl-alias> 'cd <dir> && <command> -p -n <name>'
```

With no profile named, no enabled `plugin-profiles@` entry in step 1, or a Windows lane, start the
session as the row does without this section, and say with the result that the profile was not
applied and why. A Windows lane is left out because the printed `command` is a POSIX `env` line.

## Mechanisms not used here

Each fails the fleet's per-lane account split or needs a human; see the linked page before
Expand Down Expand Up @@ -243,6 +274,7 @@ also rests on documented flag behavior.
| Port 22 script hop | Not probed in this pass |
| `notify_when_idle` from a `-p` sender | Message delivered; the notice never reached the sender, whose turn ended first |
| `-p --remote-control` | Did not connect; Remote Control is interactive only |
| [Start in the target's plugin profile](#start-in-the-targets-plugin-profile) | Untested on a live hop |
| Cost | Most of each one-line `-p` turn's cost was SessionStart hooks and context loading; measure a turn per <https://code.claude.com/docs/en/costs#track-your-costs> |

## What the relay does not change
Expand Down
Loading