---
name: delegate
description: Hand a task off to a fresh agent in its own worktree (Herdr or Rex), briefed with what you already found out and told to /ship it
argument-hint: <task description>
title: delegate
canonical_url: https://skilld.dev/gh/victor-falcon/skills/delegate
last_updated: 2026-11-12T13:12:38.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [scripts/multiplexer.sh](https://skilld.dev/api/skills-raw/victor-falcon/skills/delegate/scripts/multiplexer.sh).
>
> If the user asked to install this Skill, run `npx skilld install victor-falcon/skills/delegate`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/delegate`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/victor-falcon/skills/delegate) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/delegate`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/delegate --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/delegate --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

The task to hand off: $ARGUMENTS

You don't implement this. You scout it, brief someone else, and stay free.

Every multiplexer step goes through `scripts/multiplexer.sh`, which ships with this
skill and drives Herdr or Rex, whichever you're running in. Replace `<skill dir>`
below with the base directory this skill was loaded from, as an absolute path, and
keep the quotes. Shell state doesn't survive between Bash calls, so source it at
the start of each one:

```bash
. "<skill dir>/scripts/multiplexer.sh" && mux_backend
```

It must print `herdr` or `rex`. If the file isn't there, or it prints anything
else, say so and stop: this skill needs a Claude Code session running inside Herdr
or Rex.

## 1. Scout before you delegate

Read the repo, write nothing. You're after the things that would cost the other
agent an hour or send it down the wrong path:

- Does the plumbing for this already exist? Point at it by path.
- What's the convention for this kind of change — a sibling file doing the same
  thing? Name it.
- Anything that blocks or reshapes the task: a feature flag that's off, a gate the
  change lands behind, a constraint the task description didn't know about.

Stop as soon as you can brief someone. This is reconnaissance, not implementation.

## 2. Ask me only what changes the work

If scouting turned up a decision that genuinely forks the outcome and you can't
settle it from the repo or a sensible default, ask me **now** — once the agent is
running it can't reach me. Everything else: default it, and say so.

## 3. Create the worktree

First clear out what earlier hand-offs left behind: `mux_worktree_gc` removes every
worktree it created whose PR is merged or closed, with its agents, their tabs
and space (Herdr) or session (Rex), and local branch. It keeps any with uncommitted changes to tracked
files and says so — pass that on to me, don't force it.

```bash
git fetch origin --quiet
. "<skill dir>/scripts/multiplexer.sh" && mux_worktree_gc && mux_worktree_create "$PWD" <kebab-branch> origin/<base> "<label>" ["<group>"]
```

`<label>` is a few plain words naming the task (`dark mode`). Pass
`<group>` only when the caller gave you one (orchestrate does): every worktree with
the same group shares one Herdr space or Rex session, one tab per agent. Herdr
names the space after the group, or the label when there's no group. Each agent
is labelled `herdr.parent=<your terminal>`, so a sidebar can draw its space
under your row. Rex names
the session after the one you're in plus the group or label: `myapp / dark mode`,
which Rex shows as ` myapp - dark mode`. The worktree goes in
`~/.worktrees/<repo>/<branch>`.

It prints `<worktree path><TAB><handle>`. The handle is the Herdr space id
(`sp…`) or the Rex handle (`myapp / dark mode`, plain ASCII, with spaces). Always
quote it. Keep both; don't guess them.

## 4. Start the agent and brief it

Write the brief to a file first; long prompts don't survive shell quoting. Then:

```bash
. "<skill dir>/scripts/multiplexer.sh" && mux_agent_launch <kebab-name> "<handle>" "<worktree path>" <brief-file> --dangerously-skip-permissions
```

The name must match `[a-z][a-z0-9_-]{0,31}`. It returns once the agent has picked
up the brief. Exit status 3 means it's stuck on Claude's folder-trust dialog:
tell me, don't answer it yourself. Under Herdr the agent is an `hc` terminal named
`<kebab-name>`, so `hc get` and `hc read` work on it too.

The brief carries, in order: the task; **everything you found while scouting**, so
it doesn't repeat your work; the decisions I made and the ones you defaulted; what
it must not touch; the deliverable. Last line is `/ship`.

> A launch or prompt that reports a failure may still have landed. Check
> `mux_agent_status <name>` / `mux_agent_read <name>` before reacting, and
> **never re-send**: you'd queue the brief twice.

## 5. Report and get out of the way

Give me the worktree path, the branch, the agent name, and where to follow it: the
Herdr space (named after the group or label), or the Rex session (`<current session> / <group or label>`, shown with a branch icon), where
the agent's tab carries its name. Don't block waiting on it.

Anything scouting surfaced that I should decide but that doesn't block the work —
a rollout step, a cost, a stale assumption — goes here in a line or two, outside
the brief.
