spawn-remote

A command for starting a second Claude Code session on the same remote computer through SSH, using tmux, a terminal tool that keeps programs running in separate sessions. It returns a web link for controlling the new session.

In plain words
What is it for?
Check the required remote setup, start a sibling Claude Code session in the background, and provide its remote-control URL.
Why use it?
It allows another remote-controlled coding session to work in parallel when the current session is also being controlled remotely.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/wenhaochai/claude-plugins/spawn-remote
Clone the repo
git clone --depth 1 https://github.com/wenhaochai/claude-plugins
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,567 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00046 $0.01567
Opus 5 $0.00023 $0.00783
Sonnet 5 $0.00009 $0.00313
Haiku 4.5 $0.00005 $0.00157

Measured 2d ago against content hash c3be7c5e5511, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spawn-remote scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

daily/commands/spawn-remote.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spawn a sibling Claude Code instance in a detached tmux session and return its /remote-control URL. Everything goes through the Bash tool — the parent CC cannot send key shortcuts to the underlying TTY.

When to use

All of the following must hold:

  • User is on a remote machine (typically via SSH).
  • The currently-running Claude Code is itself remote-controlled.
  • User wants a new Claude Code session they can open at https://claude.ai/code/session_<id> and drive in parallel — e.g. delegate a long task while the current one keeps going.

Do not use this for: starting claude in the foreground (use the shell directly), spawning on a different host (this skill assumes localhost), or attaching to an already-running tmux session (use tmux a directly).

Prerequisites (one-shot check)

Run this first; abort and report to the user if anything prints MISSING:. Installing tmux / claude or doing first-run setup is on the user.

command -v tmux >/dev/null || echo "MISSING: tmux"
command -v claude >/dev/null || echo "MISSING: claude"
[ -f "$HOME/.claude.json" ] || echo "MISSING: ~/.claude.json (run claude once interactively first)"
[ -d "$HOME/.claude" ] || echo "MISSING: ~/.claude"

Step 1 — Pick a non-conflicting tmux session name

$ARGUMENTS may contain a desired session name. If empty, auto-pick the first free c<N> with N≥2:

SESSION="$ARGUMENTS"
if [ -z "$SESSION" ]; then
  for i in 2 3 4 5 6 7 8 9; do
    if ! tmux has-session -t "c$i" 2>/dev/null; then SESSION="c$i"; break; fi
  done
fi
[ -z "$SESSION" ] && { echo "ERROR: c2-c9 all taken; pass an explicit name"; exit 1; }
echo "Using session: $SESSION"

If $ARGUMENTS is given but the name is already taken, abort with a clear message — do not silently rename, and do not kill the old one (it may be a sibling the user is actively driving).

Persist $SESSION between bash calls by exporting it or by re-deriving it; do not assume the variable survives across separate Bash tool invocations.

Read the full file on GitHub · 117 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 117 lines · 46 tokens per session scan A c3be7c5e5511

Subscribe to this mod's changes

spawn-remote is a command published in the GitHub repository wenhaochai/claude-plugins (16 stars, last pushed 2d ago), licensed MIT. It adds 46 tokens to every session and 1,567 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.