agentsclimarketplace

Delegate to claude code

Skill T0mSIlver/skills/delegate-to-claude-code

Call the Claude Code CLI (`claude`) as a delegated reviewer, second opinion, or edit worker. Use for Claude Code subagent-style delegation with `claude-rc-spawn`, `claude -p`, `--bg`, `--worktree`, `--tmux`, plan/read-only reviewers, acceptEdits/auto edit workers, JSON/stream-json capture, resume flows, and gotchas around permission modes, worktree cleanup, agent personas, and `--dangerously-skip-permissions`. For persistent `claude remote-control` repo servers, use the claude-remote-control-server skill instead.From its SKILL.md

Install
npx -y skills add T0mSIlver/skills --skill delegate-to-claude-code

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 8 commands, including `claude-rc-spawn --cwd "$PWD" --prompt-file ".agent-runs/$slug/prompt.md" --name "$slug-review" --tmux-session "$slug-review" --permission-mode plan --model opus --effort high` and 7 more.

SKILL.md

5.5 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

Delegate to Claude Code (CLI)

Run claude for a second opinion, review, or a delegated edit worker. Default path: claude-rc-spawn — interactive Claude in detached tmux with Remote Control, so the user can watch and steer from claude.ai/code. Use plain claude -p when machine-readable capture matters more than visibility. Model default: --model opus --effort high (sonnet --effort low for trivia).

Happy path

  1. Write the brief to .agent-runs/$slug/prompt.md (slug="claude-$(date +%Y%m%d-%H%M%S)"; mkdir -p ".agent-runs/$slug"): context, exact task, constraints, acceptance criteria, verification commands, output shape. Demand evidence (commands run, exit status, changed files, risks) and state explicitly: verify synchronously — never end the turn waiting on a background monitor or watcher. Workers otherwise park themselves "waiting for the monitor" and yield-loop.

  2. Launch. Reviewer (read-only) via Remote Control tmux:

    claude-rc-spawn \
      --cwd "$PWD" \
      --prompt-file ".agent-runs/$slug/prompt.md" \
      --name "$slug-review" --tmux-session "$slug-review" \
      --permission-mode plan \
      --model opus --effort high
    

    Edit worker: same command, replacing --permission-mode plan with --permission-mode acceptEdits, renaming --name/--tmux-session to "$slug-edit", and adding --worktree "$slug" (Claude creates the worktree and branch).

    Noninteractive fallback (JSON capture, no Remote Control):

    cat ".agent-runs/$slug/prompt.md" | claude -p \
      --model opus --effort high \
      --permission-mode plan \
      --output-format json \
      --name "$slug-review" --add-dir .
    

    For an edit worker replace --permission-mode plan with --permission-mode acceptEdits, replace --output-format json with --output-format stream-json --verbose, and add --worktree "$slug" --max-budget-usd 10. For a fire-and-return background worker use claude --bg --worktree "$slug" --model opus --effort high --permission-mode acceptEdits --name "$slug-edit" "$(cat ".agent-runs/$slug/prompt.md")" and manage it with claude agents --json.

  3. Harvest. --output-format json: final text in .result, session id in .session_id; stream-json --verbose for live logs. claude-rc-spawn saves the prompt and tmux.log under .agent-runs/<tmux-session>/. Watch with tmux attach -t "$slug-review" or from claude.ai/code by name. Resume with claude --continue / --resume <session-id>; add --fork-session to branch. For large work, split maker and checker: run a fresh reviewer over the diff before accepting.

Gotchas

  • Remote Control needs a full claude.ai login. CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY, or a non-default ANTHROPIC_BASE_URL in the environment can break it before the session starts; claude-rc-spawn strips them by default. Remote Control dies with the local process — keep the tmux session alive until the run completes.
  • --worktree starts from origin/HEAD, not your branch. Set worktree.baseRef to head when the worker must see local in-progress state. Worktrees land under .claude/worktrees/<name> (gitignore that dir); -p --worktree runs get no exit prompt, so clean up finished worktrees yourself.
  • A worker that ends its turn "waiting for a monitor" is stuck. Nudge it once (resume the session or paste into its tmux session); if it parks again, take over — its edits are already on disk in the worktree.
  • --agent selects a persona only; hard permissions come from --permission-mode (plan, acceptEdits, auto) — pair them every time. Use acceptEdits for a bounded unattended edit worker, auto when you want background safety checks around broader tool calls.
  • --max-budget-usd caps print-mode (claude -p) runs only.
  • Add --tmux with --worktree when you want Claude Code's built-in tmux handling instead of claude-rc-spawn.
  • claude -p skips the workspace-trust dialog — run it only in directories you trust.
  • --add-dir grants file access; it does not make that directory the working checkout or copy its config.
  • Name every run (--name) so concurrent agents are distinguishable in claude agents and claude.ai/code.

Not possible

  • Remote Control with API-key / claude setup-token / CLAUDE_CODE_OAUTH_TOKEN auth — full claude.ai login only.
  • Budget caps on --bg background agents (--max-budget-usd is print-mode only).
  • --dangerously-skip-permissions outside a bounded, preferably network-isolated container/VM — it can write protected config areas; never the default edit-worker mode.
  • Persistent servers for future mobile/web dispatch — that is claude remote-control server mode; use the claude-remote-control-server skill.

What ships with it: 1 file

7.9 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.