Skip to content

Commit e0dca0c

Browse files
AhmedTMMclaude
andauthored
fix: add child VM usage tips to spawn skill to prevent token waste (#3054)
The skill now documents that --headless only provisions (doesn't run the prompt), that agent binaries are at ~/.local/bin/ (not on PATH), and that --print should be used for one-shot prompts as root instead of fighting with permission restrictions. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d1229e9 commit e0dca0c

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openrouter/spawn",
3-
"version": "0.27.1",
3+
"version": "0.27.2",
44
"type": "module",
55
"bin": {
66
"spawn": "cli.js"

packages/cli/src/shared/spawn-skill.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You have the \`spawn\` CLI installed. Use it to provision cloud VMs with AI agen
3030
spawn <agent> <cloud> --headless --output json --prompt "task description"
3131
\`\`\`
3232
33-
## Agents: claude, codex, openclaw, zeroclaw, opencode, kilocode, hermes, junie
33+
## Agents: claude, cursor, codex, openclaw, zeroclaw, opencode, kilocode, hermes, junie
3434
## Clouds: hetzner, digitalocean, aws, gcp, sprite
3535
3636
## Example
@@ -41,6 +41,21 @@ spawn claude hetzner --headless --output json --prompt "Implement the auth modul
4141
4242
Returns JSON: \`{"status":"success","ip_address":"...","ssh_user":"root","server_id":"..."}\`
4343
44+
## Running a prompt on a child VM
45+
46+
**--headless only provisions the VM — it does NOT run the prompt on it.**
47+
To actually execute work on the child, SSH in and run the agent:
48+
49+
\`\`\`bash
50+
ssh -o StrictHostKeyChecking=accept-new root@<ip_address> '~/.local/bin/claude --print "your prompt"'
51+
\`\`\`
52+
53+
### Known gotchas — do NOT waste time rediscovering these:
54+
- Agent binaries are at \`~/.local/bin/\`, NOT on the default PATH. Always use the full path: \`~/.local/bin/claude\`, \`~/.local/bin/cursor\`, etc.
55+
- Claude Code blocks \`--dangerously-skip-permissions\` as root. Use \`--print\` for one-shot prompts instead — it works as root and returns the response directly.
56+
- Do NOT try to create a non-root user to work around root restrictions — it requires copying config files (\`.claude.json\`, \`.claude/settings.json\`, env vars) and is fragile. Just use \`--print\`.
57+
- For long-running tasks, use \`spawn delete --name <name> --yes\` to clean up when done.
58+
4459
## Managing Children
4560
4661
- \`spawn list --json\` — see running children
@@ -61,8 +76,9 @@ const HERMES_SNIPPET = `
6176
6277
You have the \`spawn\` CLI for creating child cloud VMs with AI agents.
6378
Use \`spawn <agent> <cloud> --headless --output json --prompt "task"\` to delegate work.
64-
Available agents: claude, codex, openclaw, zeroclaw, opencode, kilocode, hermes, junie.
79+
Available agents: claude, cursor, codex, openclaw, zeroclaw, opencode, kilocode, hermes, junie.
6580
Cloud credentials are pre-configured. Run \`spawn list --json\` to see children.
81+
Note: --headless only provisions the VM. To run a prompt, SSH in: \`ssh root@<ip> '~/.local/bin/<agent> --print "prompt"'\`.
6682
`;
6783

6884
// ─── Agent config ───────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)